OpenCode with Anthropic fails through Connect configured client

Abierto
#8,288 1 comentario 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
TypeScript
Estrellas
16.9k
Forks
1.3k
Merge medio
20 h 9 min
PR fusionados (30 d)
690

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de lidge-jun/opencodex

Todos los issues de lidge-jun/opencodex

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.