Skip to content

fix(opencode): route Muse Spark 1.2 models to OpenAI Responses API - #10874

Merged
diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.50from
zoser69:fix/opencode-muse-spark-responses
Aug 21, 2026
Merged

diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.50from
zoser69:fix/opencode-muse-spark-responses

Conversation

@zoser69

@zoser69 zoser69 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

OpenCode Zen serves muse-spark-1.2 and muse-spark-1.2-contributor-free only on the OpenAI Responses API endpoint (https://opencode.ai/zen/v1/responses), not /chat/completions. This is confirmed in the official OpenCode Zen docs (https://opencode.ai/docs/zen/ — both model ids list https://opencode.ai/zen/v1/responses as their endpoint).

Without targetFormat: "openai-responses" these models fall through to the default chat/completions pass-through and the upstream returns null/empty content (reported in #10867).

Change

Declared both models in open-sse/config/providers/registry/opencode/index.ts with:

  • targetFormat: "openai-responses" (route to /responses)
  • supportsReasoning: true (forward reasoning_effort)

The opencode provider is passthroughModels: true, so this only sets the wire format and capability flags — the live upstream model list already advertises both ids.

Behavior notes

  • After the fix, oc/muse-spark-1.2-contributor-free resolves to the /responses endpoint and returns real output_text instead of null.
  • The model's thinking is internal/hidden (closed-source Meta model); it does not emit a separate reasoning item for display. That is expected behavior, not a bug — this PR only fixes the endpoint routing so content is returned at all.

Test plan

  • Restart OmniRoute
  • curl .../v1/models | grep muse-spark lists oc/muse-spark-1.2 and oc/muse-spark-1.2-contributor-free
  • Send a request to /v1/chat/completions with oc/muse-spark-1.2-contributor-free → non-null content returned

Closes #10867 (root-cause fix; the issue also discusses the hidden-thinking nuance).

OpenCode Zen serves muse-spark-1.2 and muse-spark-1.2-contributor-free
ONLY on the Responses API endpoint (https://opencode.ai/zen/v1/responses),
not /chat/completions. Without targetFormat:"openai-responses" they fall
through to the default chat/completions pass-through and the upstream
returns null/empty content (issue diegosouzapw#10867).

Declaring them with targetFormat:"openai-responses" + supportsReasoning
makes chatCore route them to /responses and forward reasoning_effort.
The opencode provider is passthrough, so this only sets the wire format
and capability flags — the live upstream model list already advertises
both ids.
@zoser69
zoser69 requested a review from diegosouzapw as a code owner August 20, 2026 16:51
@diegosouzapw
diegosouzapw merged commit 374b387 into diegosouzapw:release/v3.8.50 Aug 21, 2026
0 of 3 checks passed
maxmad64bis added a commit to maxmad64bis/OmniRoute that referenced this pull request Aug 21, 2026
… alias

PROVIDER_MODELS is keyed by a provider's public alias (e.g. "oc"), not
its raw registry id ("opencode") -- OpencodeExecutor.execute() called
getModelTargetFormat() with the raw id, so it silently missed every
registry entry and fell back to "openai" for buildUrl()/buildHeaders(),
while chatCore's own (correctly aliased) request-body translation still
switched to the Responses API shape for targetFormat:"openai-responses"
models. Net effect: a Responses-shaped body got sent to the
/chat/completions URL, and upstream returned a degenerate empty response.

Surfaced live by diegosouzapw#10874, which added the first targetFormat:"openai-responses"
entries to the opencode provider's registry (oc/muse-spark-1.2 and
oc/muse-spark-1.2-contributor-free) -- no prior model in this registry
exercised this code path, so the alias mismatch was never triggered
before. Extracted the alias resolution into resolveOpencodeTargetFormat(),
mirroring chatCore/targetFormat.ts's own resolveChatCoreTargetFormat().
maxmad64bis added a commit to maxmad64bis/OmniRoute that referenced this pull request Aug 21, 2026
… alias

PROVIDER_MODELS is keyed by a provider's public alias (e.g. "oc"), not
its raw registry id ("opencode") -- OpencodeExecutor.execute() called
getModelTargetFormat() with the raw id, so it silently missed every
registry entry and fell back to "openai" for buildUrl()/buildHeaders(),
while chatCore's own (correctly aliased) request-body translation still
switched to the Responses API shape for targetFormat:"openai-responses"
models. Net effect: a Responses-shaped body got sent to the
/chat/completions URL, and upstream returned a degenerate empty response.

Surfaced live by diegosouzapw#10874, which added the first targetFormat:"openai-responses"
entries to the opencode provider's registry (oc/muse-spark-1.2 and
oc/muse-spark-1.2-contributor-free) -- no prior model in this registry
exercised this code path, so the alias mismatch was never triggered
before. Extracted the alias resolution into resolveOpencodeTargetFormat(),
mirroring chatCore/targetFormat.ts's own resolveChatCoreTargetFormat().
diegosouzapw pushed a commit that referenced this pull request Aug 21, 2026
… too (#11049)

⭐5 — Muse Spark responde só na Responses API; #10874 corrigiu só o provider `opencode`, mas `opencode-zen` (faltava targetFormat em 2 entries) e `opencode-go` (6 entries effort-tier) nunca receberam. Espelha a declaração. freebuff NÃO tocado (backend codebuff.com /chat/completions distinto, verificado). TDD 2/2 + 18/18 irmãos. Fecha #11048. Base-red #9985 inherited.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…iegosouzapw#10874)

OpenCode Zen serves muse-spark-1.2 and muse-spark-1.2-contributor-free only on the OpenAI Responses API endpoint, not /chat/completions. Declares targetFormat: "openai-responses" for both so requests route correctly instead of returning null/empty content. Closes diegosouzapw#10867.

Validated in an isolated worktree boarded onto origin/release/v3.8.50 (0 conflicts, 1 file):
- Added a TDD regression test (tests/unit/opencode-muse-spark-responses-10867.test.ts) since the PR had none — confirmed RED against origin/release/v3.8.50 (entries absent) and GREEN on this branch, pushed fix-in-place.
- check-file-size, check-changelog-integrity: OK.
- typecheck:core: clean.
- check-complexity / check-cognitive-complexity: OK, both under baseline.

Co-authored-by: zoser69 <zoser69@users.noreply.github.com>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
… too (diegosouzapw#11049)

⭐5 — Muse Spark responde só na Responses API; diegosouzapw#10874 corrigiu só o provider `opencode`, mas `opencode-zen` (faltava targetFormat em 2 entries) e `opencode-go` (6 entries effort-tier) nunca receberam. Espelha a declaração. freebuff NÃO tocado (backend codebuff.com /chat/completions distinto, verificado). TDD 2/2 + 18/18 irmãos. Fecha diegosouzapw#11048. Base-red diegosouzapw#9985 inherited.
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.

[BUG] OpenAI API returns null content when model output consists of reasoning tokens (e.g. command-code/meta/muse-spark-1.2-contributor)

3 participants