Skip to content
Closed
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
2 changes: 2 additions & 0 deletions src/adapters/openai-responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2124,7 +2124,9 @@ export function stripOpenAiOnlyWebSearchFields(body: unknown): unknown {
*/
const MUSE_SPARK_WEB_SEARCH_STRICT_MODELS = new Set([
"muse-spark-1.3-contributor",
"muse-spark-1.3-contributor-free",
"muse-spark-1.2-contributor",
"muse-spark-1.2-contributor-free",
]);

const MUSE_SPARK_WEB_SEARCH_STRICT_RESPONSE_URLS = new Set([
Expand Down
16 changes: 16 additions & 0 deletions tests/providers/muse-spark-web-search-compat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,22 @@ describe("#2617/#3378 Muse Spark web_search compatibility", () => {
expect(Object.hasOwn(nested, "indexed_web_access")).toBe(false);
});

/**
* The Contributor Free tiers ride the same Zen Responses wire with the same
* gateway contract, so a Codex `web_search` + refused-field body 400s for them
* exactly like the paid tiers.
*/
test("Contributor Free tiers get the same web_search sanitization", () => {
for (const modelId of ["muse-spark-1.2-contributor-free", "muse-spark-1.3-contributor-free"]) {
const body = build(modelId, { tools: [webSearchTool()] });
const tool = toolsOf(body)[0]!;
expect(tool.type).toBe("web_search");
expect(tool.search_context_size).toBe("medium");
expect(Object.hasOwn(tool, "search_content_types")).toBe(false);
expect(Object.hasOwn(tool, "indexed_web_access")).toBe(false);
}
});

test("OpenCode Go applies the same Muse compatibility guard", () => {
const body = buildForProvider(ZEN_GO_PROVIDER, "muse-spark-1.3-contributor", {
tools: [webSearchTool()],
Expand Down
Loading