Skip to content

Commit fa85931

Browse files
Merge pull request #876 from corbitsdev/cl-7672-route-opencode-go-muse-spark-models-through-the-responses
Route OpenCode Go Muse Spark models through the Responses API
2 parents 60a0501 + 90efb9d commit fa85931

7 files changed

Lines changed: 40 additions & 5 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ parallel copies under `docs/` or `scripts/notes/`. At cut time: rename
4040
cycles through a closed live-activity set (`working`, `warping`,
4141
`buzzing`, `grinding`, `thinking`, `doing`, `cooking`, `creating`,
4242
`imagining`, `inventing`) instead of going blank.
43+
- OpenCode Go routes Muse Spark 1.2 Contributor and Muse Spark 1.3
44+
Contributor through the Responses API instead of chat completions.
4345

4446

4547
## [0.3.19] - 2026-09-10

‎packages/opencode-go/src/endpoint.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ describe("protocolForGoModel", () => {
1414
test("returns protocol for known models", () => {
1515
expect(protocolForGoModel("kimi-k2.7-code")).toBe("chat-completions");
1616
expect(protocolForGoModel("gpt-5.6-luna")).toBe("responses");
17+
expect(protocolForGoModel("muse-spark-1.3-contributor")).toBe("responses");
18+
expect(protocolForGoModel("muse-spark-1.2-contributor")).toBe("responses");
1719
expect(protocolForGoModel("minimax-m3")).toBe("messages");
1820
});
1921

@@ -48,6 +50,18 @@ describe("resolveGoEndpoint", () => {
4850
expect(ep.baseURL).toContain("/zen/go/v1");
4951
});
5052

53+
test("routes Muse Spark Contributor models to openai-responses adapter", () => {
54+
for (const id of [
55+
"muse-spark-1.3-contributor",
56+
"muse-spark-1.2-contributor",
57+
]) {
58+
const ep = resolveGoEndpoint(id);
59+
expect(ep.adapter).toBe("openai-responses");
60+
expect(ep.protocol).toBe("responses");
61+
expect(ep.baseURL).toContain("/zen/go/v1");
62+
}
63+
});
64+
5165
test("routes messages models to anthropic base", () => {
5266
const ep = resolveGoEndpoint("minimax-m3");
5367
expect(ep.adapter).toBe("anthropic");

‎packages/opencode-go/src/models.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ export interface GoModel {
1414
export const OPENCODE_GO_MODELS = [
1515
{ id: "grok-4.5", name: "Grok 4.5", protocol: "chat-completions" },
1616
{ id: "gpt-5.6-luna", name: "GPT 5.6 Luna", protocol: "responses" },
17+
{
18+
id: "muse-spark-1.3-contributor",
19+
name: "Muse Spark 1.3 Contributor",
20+
protocol: "responses",
21+
},
22+
{
23+
id: "muse-spark-1.2-contributor",
24+
name: "Muse Spark 1.2 Contributor",
25+
protocol: "responses",
26+
},
1727
{ id: "glm-5.2", name: "GLM-5.2", protocol: "chat-completions" },
1828
{ id: "glm-5.1", name: "GLM-5.1", protocol: "chat-completions" },
1929
{ id: "kimi-k3", name: "Kimi K3", protocol: "chat-completions" },

‎src/config.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,13 +1986,13 @@ describe("refreshLiveProviderCatalog", () => {
19861986

19871987
globalThis.fetch = (async () =>
19881988
Response.json({
1989-
data: [{ id: "grok-4.5" }, { id: "muse-spark-1.2-contributor" }],
1989+
data: [{ id: "grok-4.5" }, { id: "live-only-fixture-model" }],
19901990
})) as unknown as typeof fetch;
19911991
await prefetchGoModels();
19921992

19931993
const warm = await refreshLiveProviderCatalog(settings, resolved);
19941994
const warmGo = warm.find((c) => c.name === "go");
1995-
expect(warmGo?.models).toContain("muse-spark-1.2-contributor");
1995+
expect(warmGo?.models).toContain("live-only-fixture-model");
19961996
expect(warm.find((c) => c.name === "fp")?.models).toEqual(["fp-large"]);
19971997
expect(
19981998
buildProviderCatalog(settings, resolved).find((c) => c.name === "go")

‎src/provider/billing-product.test.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,21 @@ describe("isGoModelOnZenPath", () => {
102102
).toBe(false);
103103
});
104104

105-
test("false for a live-only Go id on Zen (protocol map, not picker membership)", () => {
105+
test("true when a packaged Muse Spark model sits on a Zen-billed provider", () => {
106106
expect(
107107
isGoModelOnZenPath("muse-spark-1.2-contributor", {
108108
name: "zen",
109109
baseURL: "https://opencode.ai/zen/v1",
110110
}),
111+
).toBe(true);
112+
});
113+
114+
test("false for a live-only Go id on Zen (protocol map, not picker membership)", () => {
115+
expect(
116+
isGoModelOnZenPath("live-only-fixture-model", {
117+
name: "zen",
118+
baseURL: "https://opencode.ai/zen/v1",
119+
}),
111120
).toBe(false);
112121
});
113122

‎src/provider/opencode-go-models.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from "./opencode-go-models.js";
1313

1414
const originalFetch = globalThis.fetch;
15-
const LIVE_ONLY_ID = "muse-spark-1.2-contributor";
15+
const LIVE_ONLY_ID = "live-only-fixture-model";
1616
const GO_MODELS_URL = "https://opencode.ai/zen/go/v1/models";
1717

1818
beforeEach(() => {

‎src/tui/provider-setup.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ describe("runProviderSetup Ollama discovery", () => {
751751
});
752752

753753
describe("runProviderSetup Go models", () => {
754-
const LIVE_ONLY_ID = "muse-spark-1.2-contributor";
754+
const LIVE_ONLY_ID = "live-only-fixture-model";
755755

756756
test("choiceFromDef lists selectable Go ids", () => {
757757
const go = providerChoiceById("opencode-go");

0 commit comments

Comments
 (0)