OpenCode with Anthropic fails through Connect configured client

オープン
#8,288 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
TypeScript
スター
16.9k
フォーク
1.3k
平均マージ
20時間 9分
マージ済み PR(30日)
690

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

lidge-jun/opencodex のほかの issue

lidge-jun/opencodex の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。