OpenCode with Anthropic fails through Connect configured client

Đang mở
#8,288 4 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
ai, backend-api-design

Hướng nghiên cứu

Start by reading the open PR #8194, which addresses instruction placement, and trace how Connect generates OpenCode configuration and how Anthropic translation handles top-level instructions versus developer messages. The report also calls out export, launcher injection, and managed refresh as configuration paths. Done means the reproduced OpenCode request succeeds through the configured Anthropic account, with consistent instruction translation across those paths.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

account-pool provider provider-compatibility
Client or integration

Other

Provider or upstream service

Anthropic OAuth, using an Anthropic subscription. Model tested: claude-opus-5-5.

OpenCodex version

OpenCodex 2.98.0 and OpenCode 2.2.5.

Endpoint or capability

OpenCode configuration generated by Connect.

Current behaviour

OpenCode requests through OpenCodex fail with HTTP 400. Codex requests through the same Anthropic account and model have succeeded.

I opened PR #8194 to address the difference in instruction placement. That PR remains open.

Expected behaviour

I want to use Anthropic through OpenCode and OpenCodex, as I already do through Codex.

Equivalent instruction content should follow a consistent translation path. If this use has an intentional limitation, please clarify what OpenCodex supports.

Minimal redacted request or reproduction
1. Configure an Anthropic OAuth account in OpenCodex.
2. Use the dashboard's Connect feature to configure OpenCode.
3. Start an OpenCode session and select opencodex/anthropic/claude-opus-5-5.
4. Send a prompt.
5. Observe the Anthropic rejection below.
Actual response or error
HTTP 400 invalid_request_error

Third-party apps now draw from your extra usage, not your plan limits.
Add more at claude.ai/settings/usage and keep going.
Upstream documentation

No documentation links supplied. This report is based on the Connect reproduction above.

Suggested mapping or implementation notes

My current view is that two things need attention:

  • Connect should configure OpenCode V2 to use Responses. Export, launcher injection and managed refresh should generate the same configuration.
  • Anthropic translation should account for the different ways clients supply instructions.

The instruction difference is reproducible offline:

{
  "instructions": "The agent instructions"
}

currently enters the translated system prompt, whereas:

{
  "input": [
    {
      "role": "developer",
      "content": "The agent instructions"
    }
  ]
}

follows the existing developer-message mapping, which places that content in Anthropic user messages.

Additional context and attachments

No response

Checks
  • I searched existing provider and compatibility issues.
  • The request and response were redacted.
  • The expected behaviour is based on an upstream specification or a concrete client requirement.
Ngôn ngữ chính
TypeScript
Star
16.9k
Fork
1.3k
Merge trung bình
23 giờ
Pull request đã merge (30 ngày)
687

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của lidge-jun/opencodex

Tất cả issue của lidge-jun/opencodex

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.