Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/providers/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,10 @@ export const PROVIDER_REGISTRY: readonly ProviderRegistryEntry[] = [
// The DeepSeek vision preview id is metadata-only here: the Go roster is
// discovered live, so it applies the moment the gateway serves the id.
[DEEPSEEK_VISION_PREVIEW_MODEL]: 1_048_576,
// Muse Spark 1.2 Contributor serves a 1,048,576-token (1M) context window over
// /responses on Zen Go, matching its 1.1 sibling (Meta developer docs, verified 2026-08-28).
// Without this declaration the catalog falls back to 128k, capping real usable context.
"muse-spark-1.2-contributor": 1_048_576,
},
modelInputModalities: {
"kimi-k3": ["text", "image"],
Expand Down
54 changes: 54 additions & 0 deletions tests/opencode-go-muse-context.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* OpenCode Go Muse Spark 1.2 Contributor context window regression.
*
* Muse Spark serves a 1,048,576-token (1M) context window over /responses on Zen Go,
* matching its 1.1 sibling. The registry declared no modelContextWindows entry, so the
* catalog fell back to the 128k unknown-window default and the Codex app capped real
* usable context well below what the model supports. These tests lock the declaration
* in and prove the catalog advertises the full 1M window for Muse.
*/
import { describe, expect, test } from "bun:test";
import { applyProviderConfigHints } from "../src/codex/catalog";
import { getProviderRegistryEntry, PROVIDER_REGISTRY } from "../src/providers/registry";
import { providerConfigSeed } from "../src/providers/derive";
import type { OcxProviderConfig } from "../src/types";

const MUSE_MODEL = "muse-spark-1.2-contributor";
const MUSE_CONTEXT = 1_048_576;

/** Seeded OpenCode Go provider config for the Muse Spark context assertions. */
function opencodeGo(): OcxProviderConfig {
const entry = getProviderRegistryEntry("opencode-go");
if (!entry) throw new Error("missing opencode-go registry fixture");
return { ...providerConfigSeed(entry), apiKey: "test-key" };
}

describe("OpenCode Go Muse Spark context window", () => {
test("registry declares the 1M context window for Muse", () => {
const entry = PROVIDER_REGISTRY.find(e => e.id === "opencode-go");
expect(entry?.modelContextWindows?.[MUSE_MODEL]).toBe(MUSE_CONTEXT);
});

test("the registry seed carries the 1M context window for Muse", () => {
const prov = opencodeGo();
expect(prov.modelContextWindows?.[MUSE_MODEL]).toBe(MUSE_CONTEXT);
});

test("applyProviderConfigHints exposes the 1M context window for Muse", () => {
const prov = opencodeGo();
const hinted = applyProviderConfigHints("opencode-go", prov, {
id: MUSE_MODEL,
provider: "opencode-go",
});
expect(hinted.contextWindow).toBe(MUSE_CONTEXT);
});

test("a discovered row with no window inherits the configured 1M window", () => {
const prov = opencodeGo();
const hinted = applyProviderConfigHints("opencode-go", prov, {
id: MUSE_MODEL,
provider: "opencode-go",
});
expect(hinted.contextWindow).toBe(MUSE_CONTEXT);
});
});
Loading