OpenCode with Anthropic fails through Connect configured client

Aperta
#8,288 1 commento 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
TypeScript
Stelle
16.9k
Fork
1.3k
Merge medio
20h 9m
PR unite (30g)
690

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lidge-jun/opencodex

Tutte le issue di lidge-jun/opencodex

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.