Skip to content

fix(provider): align opencode-go model protocols with zen and upstream - #1409

Merged
corbits-triage[bot] merged 3 commits into
mainfrom
cl-10534-model-protocols
Oct 13, 2026
Merged

corbits-triage[bot] merged 3 commits into
mainfrom
cl-10534-model-protocols

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Reconcile opencode-go vs zen model protocol disagreement (CL-10534)

packages/opencode-go/src/models.ts and packages/zen/src/models.ts share the same model-catalog architecture but disagreed on protocol for overlapping model ids. Live re-verification against the upstream gateway docs (both fetched 11/10/2026; Go docs last updated Oct 11, 2026) shows the two gateways are not protocol-identical: the Go gateway and the Zen gateway serve some of the same model ids over different wire protocols. Each package's protocol map must match its own gateway.

Live re-check of the five flipped models

Model id Original opencode-go PR v1 flip Live Go docs (11/10/2026) Live Zen docs (11/10/2026) Verdict
grok-4.5 chat-completions responses not in current Go catalog; Go Grok family (grok-4.7, grok-4.6) = /zen/go/v1/responses /zen/v1/responses flip CONFIRMED — kept responses
minimax-m3 messages chat-completions /zen/go/v1/messages /zen/v1/chat/completions flip REVERTED — Go serves MiniMax over Messages; original was right for Go
minimax-m2.7 messages chat-completions /zen/go/v1/messages /zen/v1/chat/completions flip REVERTED — same
minimax-m2.5 messages chat-completions not in current Go catalog; Go MiniMax family (M3/M2.7) = messages /zen/v1/chat/completions flip REVERTED — family + original code; no live Go contradiction
qwen3.8-max messages chat-completions /zen/go/v1/messages /zen/v1/chat/completions flip REVERTED — Go serves Qwen3.8 Max over Messages

Bottom line: the four reverted flips were wrong because the PR's first pass used the Zen gateway as the single source of truth; the Go gateway actually serves MiniMax and Qwen3.8 Max over the Anthropic Messages API. grok-4.5 stays responses (Go Grok family protocol + Zen live docs).

Missed adjacent live Go models — added to the fallback seed

The packaged fallback missed 16 models present in the live Go catalog. Added with protocols straight from the live Go docs endpoint table:

  • Responses: grok-4.7, grok-4.6, gpt-6-luna
  • Messages: claude-haiku-5-5, qwen3.8-flash
  • Chat Completions: glm-5.3-flash, glm-5.3, longcat-2.0, longcat-2.5-preview-free, step-5-preview-free, deepseek-v4.1-flash, deepseek-v4-flash-vision-exp, mimo-v2.6-flash, mimo-v2.6-pro, hy4-preview, space-bunny

Net change vs main

  • grok-4.5: chat-completions → responses (confirmed)
  • minimax-m3, minimax-m2.7, minimax-m2.5, qwen3.8-max: unchanged from main (messages) — the v1 flips were reverted
  • 16 live Go models added to the packaged fallback with live-documented protocols
  • Zen unchanged (already matches the Zen gateway docs)

Tests pinning the corrected mapping

  • packages/opencode-go/src/endpoint.test.ts: pins protocolForGoModel + resolveGoEndpoint for the confirmed flip (grok-4.5 → responses), the reverted mappings (MiniMax family, qwen3.8-max → messages/anthropic), and every newly-added live model.
  • src/config/inference-sources.test.ts: minimax-m3 and qwen3.8-max route to the opencode-go-messages source (https://opencode.ai/zen/go).
  • src/provider/cache-ttl.test.ts, src/session/cache-ttl-resume.test.ts: Anthropic-protocol representative stays minimax-m3.

Verification (all clean)

  • bun test packages/opencode-go/src packages/zen/src — 44 pass, 0 fail
  • Affected src suites (inference-sources, config, providers, cache-ttl, cache-ttl-resume, anthropic-session-adapter, model-catalogs, identity-divergence) — 303 pass, 0 fail
  • bun run typecheck — clean
  • oxfmt --check + oxlint on changed files — clean

Live sources: https://opencode.ai/docs/go/ (endpoint table, last updated Oct 11, 2026) and https://opencode.ai/docs/zen/ — both fetched 11/10/2026.

@linear-code

linear-code Bot commented Oct 12, 2026

Copy link
Copy Markdown

CL-10534

@corbits-triage

Copy link
Copy Markdown
Contributor

No changes needed from you. A maintainer will review this pull request.

@TheGreatAxios
TheGreatAxios force-pushed the cl-10534-model-protocols branch from 2ec64df to 63fb3e8 Compare October 12, 2026 05:44
@TheGreatAxios TheGreatAxios changed the title fix(opencode-go): reconcile model protocols with zen (CL-10534) fix(provider): align opencode-go model protocols with zen and upstream Oct 12, 2026

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review · Comment

Aligns the opencode-go protocol map with the live Go gateway endpoint table and wires those ids through the existing runtime routing.

Findings

No findings. Checked packages/opencode-go/src/models.ts against the live Go endpoint table. grok-4.5 is responses. MiniMax and qwen3.8-max stay messages. New ids use the same PROTOCOL_BY_ID array that feeds resolveGoEndpoint.

@corbits-triage
corbits-triage Bot merged commit 140ab34 into main Oct 13, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant