From 374b387b350ccb447c2845ec1cf322f910c946f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=85=D8=B5=D8=B7=D9=81=D9=89=20=D9=85=D8=AD=D9=85=D9=88?= =?UTF-8?q?=D8=AF=20=D9=84=D8=B7=D9=81=D9=89=20=D9=85=D8=B5=D8=B7=D9=81?= =?UTF-8?q?=D9=89=20=D9=85=D8=AD=D9=85=D9=88=D8=AF?= Date: Fri, 21 Aug 2026 05:40:55 +0300 Subject: [PATCH] fix(opencode): route Muse Spark 1.2 models to OpenAI Responses API (#10874) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #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 --- .../providers/registry/opencode/index.ts | 20 +++++++++++++++++++ ...pencode-muse-spark-responses-10867.test.ts | 20 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 tests/unit/opencode-muse-spark-responses-10867.test.ts diff --git a/open-sse/config/providers/registry/opencode/index.ts b/open-sse/config/providers/registry/opencode/index.ts index 4aaa6ea046..07f228b77e 100644 --- a/open-sse/config/providers/registry/opencode/index.ts +++ b/open-sse/config/providers/registry/opencode/index.ts @@ -22,6 +22,26 @@ export const opencodeProvider: RegistryEntry = { supportsReasoning: true, interleavedField: "reasoning_content", }, + // #MUSE_SPARK: Muse Spark is served by OpenCode Zen ONLY on the OpenAI + // Responses API (https://opencode.ai/zen/v1/responses), not /chat/completions + // (confirmed in the official OpenCode Zen docs: https://opencode.ai/docs/zen/). + // Without targetFormat:"openai-responses" these models fall through to the + // default chat/completions pass-through and the upstream returns null/empty + // content (see issue #10867). The opencode provider is passthrough, so + // declaring them here only sets the wire format / capability flags — the + // live upstream model list already advertises both ids. + { + id: "muse-spark-1.2", + name: "Muse Spark 1.2", + supportsReasoning: true, + targetFormat: "openai-responses", + }, + { + id: "muse-spark-1.2-contributor-free", + name: "Muse Spark 1.2 Contributor Free", + supportsReasoning: true, + targetFormat: "openai-responses", + }, { id: "deepseek-v4-flash-free", name: "DeepSeek V4 Flash Free", supportsReasoning: true }, // #6998: 2026-07-14 refresh — the upstream free tier rotated its lineup; // minimax-m3-free, minimax-m2.5-free, ling-2.6-1t-free, diff --git a/tests/unit/opencode-muse-spark-responses-10867.test.ts b/tests/unit/opencode-muse-spark-responses-10867.test.ts new file mode 100644 index 0000000000..d39a32b259 --- /dev/null +++ b/tests/unit/opencode-muse-spark-responses-10867.test.ts @@ -0,0 +1,20 @@ +import test from "node:test"; +import assert from "node:assert/strict"; +import { opencodeProvider } from "../../open-sse/config/providers/registry/opencode/index.ts"; + +// #10867: Muse Spark is served by OpenCode Zen only on the OpenAI Responses API +// (/responses), not /chat/completions. Without targetFormat:"openai-responses" +// these models fall through to the default chat/completions pass-through and the +// upstream returns null/empty content. +test("muse-spark-1.2 and muse-spark-1.2-contributor-free route to the Responses API", () => { + for (const id of ["muse-spark-1.2", "muse-spark-1.2-contributor-free"]) { + const model = opencodeProvider.models.find((m) => m.id === id); + assert.ok(model, `${id} should be registered in the opencode provider`); + assert.equal( + model?.targetFormat, + "openai-responses", + `${id} must target the Responses API, not the default chat/completions pass-through` + ); + assert.equal(model?.supportsReasoning, true); + } +});