Skip to content

fix(catalog): route opencode-go muse-spark to responses api - #8980

Merged
can1357 merged 1 commit into
mainfrom
farm/0fcd16ec/fix-opencode-go-muse-spark-responses
Aug 19, 2026
Merged

can1357 merged 1 commit into
mainfrom
farm/0fcd16ec/fix-opencode-go-muse-spark-responses

Conversation

@roboomp

@roboomp roboomp commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Repro

opencode-go/muse-spark-1.2 throws OpenAI completions stream closed before a finish_reason was received on every tool-call turn (reported by @Ayush12358; also hit by @AIast0r and @veermetri05). Invoking the opencode-go descriptor resolver reproduces the misroute:

muse-spark-1.2             -> { api: "openai-completions", baseUrl: "https://opencode.ai/zen/go/v1" }   # wrong
muse-spark-1.2 (npm=openai) -> { api: "openai-responses",   baseUrl: "https://opencode.ai/zen/go/v1" }   # correct

Cause

The OpenCode Go gateway serves Muse Spark 1.2 (and muse-spark-1.2-contributor) only at https://opencode.ai/zen/go/v1/responses (OpenAI Responses transport, @ai-sdk/openai per the Go endpoints table). OPENCODE_GO_API_RESOLUTION in packages/catalog/src/provider-models/openai-compat.ts only maps a model to openai-responses when the discovered /zen/go/v1/models metadata carries provider.npm === "@ai-sdk/openai". That hint is absent for the muse-spark ids, so they fall through to the default openai-completions; omp POSTs to /v1/chat/completions, and the completions stream parser (packages/ai/src/providers/openai-completions.ts) throws when the stream closes with no finish_reason.

Fix

  • Pin muse-spark-1.2 and muse-spark-1.2-contributor to openai-responses in OPENCODE_GO_API_RESOLUTION, mirroring the existing deepseek-v4-flash override.
  • Add a resolver regression in packages/catalog/test/opencode-provider.test.ts asserting both ids resolve to { api: "openai-responses", baseUrl: "https://opencode.ai/zen/go/v1" }.
  • Changelog entry under packages/catalog [Unreleased] > Fixed.

No models.json regen: opencode-go uses authoritative runtime discovery and has no bundled muse-spark entry, so the resolution rules govern this at runtime.

Verification

bun test test/opencode-provider.test.ts test/issue-1617-repro.test.ts test/meta-provider.test.ts (packages/catalog) — 12 pass, 0 fail. The new resolver test fails before the override and passes after.

Fixes #8957

The OpenCode Go gateway serves muse-spark-1.2 and
muse-spark-1.2-contributor only at /zen/go/v1/responses, but the
/zen/go/v1/models discovery omits the provider.npm hint, so the
resolver fell through to openai-completions. The completions parser
then closed the stream without a finish_reason on every tool-call turn.

Pin both ids to openai-responses in OPENCODE_GO_API_RESOLUTION, mirroring
the existing deepseek-v4-flash override, and add a resolver regression.

Fixes #8957
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@can1357
can1357 merged commit 3319e8b into main Aug 19, 2026
20 of 21 checks passed
bchap1n added a commit to bchap1n/oh-my-pi that referenced this pull request Aug 20, 2026
Console Go gateway at /zen/go/v1/responses only allows tool_choice auto;
forced named choices (think) 400. Downgrade via compat flag so
mapOpenAIResponsesToolChoiceForTools returns auto.

Fixes forced think 400 for muse-spark-1.2-contributor on opencode-go/zen.
Separate from can1357#8980 (API pin) and can1357#8999 (thinking levels).
darsrc pushed a commit to darsrc/dar-oh-my-pi that referenced this pull request Oct 10, 2026
darsrc pushed a commit to darsrc/dar-oh-my-pi that referenced this pull request Oct 10, 2026
Console Go gateway at /zen/go/v1/responses only allows tool_choice auto;
forced named choices (think) 400. Downgrade via compat flag so
mapOpenAIResponsesToolChoiceForTools returns auto.

Fixes forced think 400 for muse-spark-1.2-contributor on opencode-go/zen.
Separate from can1357#8980 (API pin) and can1357#8999 (thinking levels).
@can1357
can1357 deleted the farm/0fcd16ec/fix-opencode-go-muse-spark-responses branch November 2, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

muse spark 1.2 from opencode go repeatedly throws errors

2 participants