Skip to content

反代反重力的 claude 在 opencode 中使用出现 unexpected EOF 错误 #1400

@airoswell

Description

@airoswell

Is it a request payload issue?
[ ] Yes, this is a request payload issue. I am using a client/cURL to send a request payload, but I received an unexpected error.
[x] No, it's another issue.

Describe the bug

使用反重力反代出来的 claude-sonnet-4-5(-thinking), claude-opus-4-5(-thinking),然后在 opencode 里通过 "npm": "@ai-sdk/anthropic"调用,频繁出现下面截图所示的错误。

相同的端口在 claude code 中使用非常顺畅,不会出任何错误。

CLI Type
反重力

Model Name
claude-sonnet-4-5(-thinking), claude-opus-4-5(-thinking)

LLM Client
opencode

Request Information
The best way is to paste the cURL command of the HTTP request here.
Alternatively, you can set request-log: true in the config.yaml file and then upload the detailed log file.

Expected behavior
不出现错误,像在 claude code 中使用一样。

Screenshots

Image

OS Type
macOS 15.0 (24A335)

Additional context

Opencode 配置

"CPAPlus-anthropic": {
      "npm": "@ai-sdk/anthropic",
      "name": "CPAPlus-anthropic",
      "options": {
        "baseURL": "http://localhost:8318/v1",
        "apiKey": "sk-123456",
      },
      "models": {
        "kiro-claude-sonnet-4-5-agentic": {
          "name": "kiro-claude-sonnet-4-5-agentic",
          "reasoning": true,
          "tool_call": true,
        },
        "claude-opus-4-5-thinking": {
          "name": "claude-opus-4-5-thinking",
          "reasoning": true,
          "tool_call": true,
        },
        "claude-sonnet-4-5-thinking": {
          "name": "claude-sonnet-4-5-thinking",
          "reasoning": true,
          "tool_call": true,
        },
      },
    },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions