Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

Support Gemini 4 Argon and new Muse models

Emre Sokullucc55ee3a4e04
diff --git a/docs/providers-and-models.md b/docs/providers-and-models.md
index 4c7e71a22..3c123b3f9 100644
--- a/docs/providers-and-models.md
+++ b/docs/providers-and-models.md
@@ -21,6 +21,41 @@ as `openrouter/free` identify the configured route; they do not establish which
upstream model the router selected. Endpoint URLs, credentials, local model paths
and private inference-profile ARNs are omitted from this identity context.
+### Gemini 4 Argon and new Muse models
+
+Settings suggests `gemini-4-argon` on Google Gemini and
+`google/gemini-4-argon`, `meta/muse-wonder`, and `meta/muse-spark-open` on
+OpenRouter. These models support native tools and screenshot input. WebBrain
+infers their 1,048,576-token context unless a user or local runtime overrides it.
+
+Argon uses the existing Google OpenAI-compatible or OpenRouter Chat Completions
+route. Its synchronous output ceiling is 65,536 tokens; background long decode
+is not implemented. WebBrain reserves at least 32,768 tokens including thinking,
+omits ignored sampling controls, and maps unsupported thinking-off requests to
+low reasoning. Muse Wonder and Spark Open also require reasoning: short text
+and classifier calls receive at least 2,048 tokens and use the lowest supported
+effort when disabling reasoning was requested. The Meta-hosted Muse Wonder route
+requires automatic tool choice, like Spark 1.3 Contributor: named choices narrow
+the offered tools, and disabling tools removes them from the request. Spark Open
+retains native tool choices.
+Streamed Google tool-call signatures and OpenRouter reasoning details are
+retained for subsequent tool turns. OpenRouter's opaque replay blocks are
+scoped to the same endpoint, model, and tool-call IDs.
+
+Release/API references: [Google Argon guide](https://ai.google.dev/gemini-api/docs/latest-model),
+[Muse Wonder](https://research.meta.ai/blog/muse-wonder),
+[Muse Spark Open](https://research.meta.ai/blog/muse-spark-open), and the
+[OpenRouter live catalog](https://openrouter.ai/api/v1/models).
+
+Run `npm run test:frontier:live` with `OPENROUTER_API_KEY` and/or
+`GEMINI_API_KEY` in the environment to make paid API probes through the production
+provider. It checks visible text, streaming, native and streamed tool round trips, an
+image-only code, and short classifier output. Add `-- --browser firefox` for the
+Firefox provider. Tool results in this smoke check are supplied fixtures; it
+does not verify real browser task completion. Without a key it exits before
+making any inference calls. Local regression tests use mocked responses and
+cannot establish live account access or upstream availability.
+
### Decision models
Select OpenRouter (the default), TypeSafe directly, or a local/custom System One
diff --git a/package.json b/package.json
index 0028e75b3..ea12944ba 100644
--- a/package.json
+++ b/package.json
@@ -16,9 +16,10 @@
"test:plan-notifications": "node --test test/plan-review-notifications.mjs test/attention-flash-markers.mjs",
"test:billing-notice": "node test/billing-payment-notice.mjs",
"test:provider-limits": "node test/provider-model-limits.mjs",
+ "test:frontier:live": "node scripts/check-frontier-models.mjs",
"test:provider-catalog": "node test/provider-catalog-integrations.mjs",
"test:provider-instances:ui": "node test/provider-instances-ui.mjs",
- "test:openrouter-capabilities": "node --test test/openrouter-model-capabilities.mjs test/muse-tool-choice.mjs test/qwen-tool-calls.mjs test/dolphin-prompted-tools.mjs test/model-retry.mjs",
+ "test:openrouter-capabilities": "node --test test/frontier-model-compatibility.mjs test/openrouter-model-capabilities.mjs test/muse-tool-choice.mjs test/qwen-tool-calls.mjs test/dolphin-prompted-tools.mjs test/model-retry.mjs",
"test:markdown": "node --test test/markdown-render.mjs",
"test:accessibility-tree-benchmark": "node --test test/llm/lib/accessibility-tree-formats.test.mjs test/llm/report-html-encoding.mjs && node test/llm/accessibility-tree-benchmark.mjs --no-exact-tokenizer --check",
"test:attachment-drop": "node test/attachment-drop.mjs",
diff --git a/scripts/check-frontier-models.mjs b/scripts/check-frontier-models.mjs
new file mode 100644
index 000000000..b4435be95
--- /dev/null
+++ b/scripts/check-frontier-models.mjs
@@ -0,0 +1,118 @@
+#!/usr/bin/env node
+// Live API checks using WebBrain's production provider. Tool observations are
+// supplied fixtures; this is not an end-to-end browser automation benchmark.
+import assert from 'node:assert/strict';
+import { readFile } from 'node:fs/promises';
+import { randomUUID } from 'node:crypto';
+
+const args = process.argv.slice(2);
+const argument = name => args.includes(name) ? args[args.indexOf(name) + 1] : null;
+if (args.includes('--help')) {
+ console.log('OPENROUTER_API_KEY=... npm run test:frontier:live\nOptional: GEMINI_API_KEY for the direct Google route. Use -- --browser firefox to check Firefox.\nFilter retries with --model MODEL --probe PROBE.\nRuns paid text, streaming, tool round-trip, screenshot and classifier API probes. Prints no credentials.');
+ process.exit(0);
+}
+const browser = args.includes('--browser') ? args[args.indexOf('--browser') + 1] : 'chrome';
+assert.ok(['chrome', 'firefox'].includes(browser), 'Browser must be chrome or firefox');
+const { OpenAICompatibleProvider } = await import(`../src/${browser}/src/providers/openai.js`);
+const { Agent } = await import(`../src/${browser}/src/agent/agent.js`);
+const { plannerRequestBody } = await import(`../src/${browser}/src/providers/provider-compatibility.js`);
+const targets = [];
+if (process.env.OPENROUTER_API_KEY) {
+ for (const model of ['google/gemini-4-argon', 'meta/muse-wonder', 'meta/muse-spark-open']) {
+ targets.push({ providerName: 'openrouter', baseUrl: 'https://openrouter.ai/api/v1', model, apiKey: process.env.OPENROUTER_API_KEY });
+ }
+}
+if (process.env.GEMINI_API_KEY) targets.push({
+ providerName: 'gemini', baseUrl: 'https://generativelanguage.googleapis.com/v1beta/openai',
+ model: 'gemini-4-argon', apiKey: process.env.GEMINI_API_KEY,
+});
+if (!targets.length) {
+ console.error('No live calls made: set OPENROUTER_API_KEY and/or GEMINI_API_KEY, or pass a key file with node --env-file=/path/to/file.');
+ process.exit(2);
+}
+if (argument('--model')) assert.ok(targets.some(config => config.model === argument('--model')), 'Requested model has no configured test key');
+if (argument('--probe')) assert.ok([
+ 'text', 'streaming', 'tool_round_trip', 'streaming_tool_round_trip', 'screenshot', 'short_classifier',
+].includes(argument('--probe')), 'Unknown probe');
+const image = 'data:image/png;base64,' + (await readFile(new URL('../src/chrome/assets/vision-connection-test.png', import.meta.url))).toString('base64');
+const tools = [{ type: 'function', function: {
+ name: 'read_page', description: 'Read the currently selected page title.', parameters: { type: 'object', properties: {}, additionalProperties: false },
+} }];
+let failures = 0;
+for (const config of targets) {
+ if (argument('--model') && argument('--model') !== config.model) continue;
+ const provider = new OpenAICompatibleProvider(config);
+ const probe = async (name, fn) => {
+ if (argument('--probe') && argument('--probe') !== name) return;
+ const started = Date.now();
+ try {
+ await fn();
+ console.log(JSON.stringify({ browser, provider: config.providerName, model: config.model, probe: name, passed: true, latencyMs: Date.now() - started }));
+ } catch (error) {
+ failures++;
+ // Extract only the error message; metadata can contain account IDs.
+ let detail = String(error.message || error.name);
+ if (error.httpStatus) {
+ try {
+ const parsed = JSON.parse(detail.slice(detail.indexOf('{')));
+ const raw = parsed.error?.metadata?.raw;
+ detail = (typeof raw === 'string' ? JSON.parse(raw)?.error?.message : null)
+ || parsed.error?.message || `HTTP ${error.httpStatus}`;
+ } catch { detail = `HTTP ${error.httpStatus}`; }
+ }
+ console.log(JSON.stringify({ browser, provider: config.providerName, model: config.model, probe: name, passed: false,
+ error: detail.replaceAll(config.apiKey, '[REDACTED]').replace(/sk-or-v1-[a-zA-Z0-9]+/g, '[REDACTED]').slice(0, 600) }));
+ }
+ };
+ const options = () => ({ maxTokens: 4096, signal: AbortSignal.timeout(180000) });
+ await probe('text', async () => {
+ const nonce = `WB_${randomUUID()}`;
+ const result = await provider.chat([{ role: 'user', content: `Reply with exactly ${nonce}` }], options());
+ assert.ok(result.content.includes(nonce), 'Visible text must contain the requested nonce');
+ });
+ await probe('streaming', async () => {
+ const nonce = `WB_${randomUUID()}`;
+ let text = '', terminal = false;
+ for await (const chunk of provider.chatStream([{ role: 'user', content: `Reply with exactly ${nonce}` }], options())) {
+ if (chunk.type === 'text') text += chunk.content;
+ if (chunk.type === 'done') terminal = true;
+ }
+ assert.ok(terminal && text.includes(nonce), 'Stream must finish and contain the requested nonce');
+ });
+ for (const stream of [false, true]) await probe(stream ? 'streaming_tool_round_trip' : 'tool_round_trip', async () => {
+ const messages = [{ role: 'user', content: 'Call read_page once, then repeat its returned page title exactly.' }];
+ const callOptions = { ...options(), tools, toolChoice: 'required' };
+ const result = stream
+ ? await new Agent({})._chatStreamWithCostAllowance(provider, messages, callOptions, null)
+ : await provider.chat(messages, callOptions);
+ assert.equal(result.toolCalls?.length, 1, 'Must return one native call');
+ const call = result.toolCalls[0];
+ assert.equal(call.function?.name, 'read_page');
+ assert.deepEqual(JSON.parse(call.function.arguments), {});
+ const title = `WebBrain probe ${randomUUID()}`;
+ const assistant = Agent.prototype._withResponseItems(
+ { role: 'assistant', content: result.content || '', tool_calls: result.toolCalls },
+ result.responseItems, result.reasoningContent, provider,
+ );
+ messages.push(assistant,
+ { role: 'tool', tool_call_id: call.id, content: JSON.stringify({ title }) });
+ const followUp = await provider.chat(messages, { ...options(), tools, toolChoice: 'none' });
+ assert.ok(followUp.content.includes(title), 'Follow-up must read the supplied tool result');
+ });
+ await probe('screenshot', async () => {
+ assert.equal(provider.supportsVision, true);
+ const result = await provider.chat([{ role: 'user', content: [
+ { type: 'text', text: 'Read the code printed in this image. Reply only with the code.' },
+ { type: 'image_url', image_url: { url: image } },
+ ] }], options());
+ assert.match(result.content, /\bWB7\b/i, 'Must read the image-only code');
+ });
+ await probe('short_classifier', async () => {
+ const result = await provider.chat([{ role: 'user', content: 'Return only this JSON object: {"ready":true}' }], {
+ ...options(), maxTokens: 24, toolChoice: 'none', extraBody: plannerRequestBody(config),
+ });
+ const json = result.content.replace(/^```(?:json)?\s*|\s*```$/g, '').trim();
+ assert.deepEqual(JSON.parse(json), { ready: true });
+ });
+}
+process.exitCode = failures ? 1 : 0;
diff --git a/src/chrome/src/agent/agent.js b/src/chrome/src/agent/agent.js
index 9ee0ebaea..be1923938 100644
--- a/src/chrome/src/agent/agent.js
+++ b/src/chrome/src/agent/agent.js
@@ -27,7 +27,7 @@ import { isSessionQuotaError, serializeConversationForSession, SESSION_CONVERSAT
import { SteeringJournal } from './steering-journal.js';
import { formatErrorMessage } from '../error-format.js';
import { retryModelCall, retryModelStream } from '../providers/model-retry.js';
-import { isQwenConfig } from '../providers/provider-compatibility.js';
+import { isQwenConfig, preserveToolCallSignature } from '../providers/provider-compatibility.js';
import { aggregateMessageCompletion } from '../message-info.js';
import { handleDoneJson } from './cloud-output.js';
import { applyReadPageWindow, fitReadPageWindowResult, isReadPageWindowResult } from './read-page-window.js';
@@ -8398,6 +8398,7 @@ export class Agent extends LoopDetector {
type: 'function',
function: { name: '', arguments: '' },
};
+ preserveToolCallSignature(existing, toolCall);
if (toolCall.id) existing.id = toolCall.id;
if (toolCall.type) existing.type = toolCall.type;
if (toolCall.function?.name) existing.function.name += toolCall.function.name;
@@ -51030,6 +51031,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
if (!toolCallsAccumulator[idx]) {
toolCallsAccumulator[idx] = { id: '', function: { name: '', arguments: '' } };
}
+ preserveToolCallSignature(toolCallsAccumulator[idx], tc);
if (tc.id) toolCallsAccumulator[idx].id = tc.id;
if (tc.function?.name) toolCallsAccumulator[idx].function.name += tc.function.name;
if (tc.function?.arguments) toolCallsAccumulator[idx].function.arguments += tc.function.arguments;
diff --git a/src/chrome/src/providers/context-windows.js b/src/chrome/src/providers/context-windows.js
index 7479962c3..5bb5fbb5f 100644
--- a/src/chrome/src/providers/context-windows.js
+++ b/src/chrome/src/providers/context-windows.js
@@ -289,8 +289,11 @@ export function inferContextWindow(config = {}) {
if (model.includes('claude-')) return 200000;
// Google Gemini
+ if (/(?:^|\/)gemini-4-argon(?=$|:)/.test(model)) return 1048576;
if (/gemini-(?:3|3\.|2\.5)/.test(model)) return M1;
+ if (/(?:^|\/)muse-(?:wonder|spark-open)(?=$|:)/.test(model)) return 1048576;
+
// Cloudflare Workers AI
if (provider === 'cloudflare' && model.includes('@cf/zai-org/glm-5.2')) return K256;
@@ -352,6 +355,11 @@ export function inferMaxOutputTokens(config = {}) {
const model = clean(config.model);
if (!model) return null;
+ // WebBrain uses synchronous Chat Completions, without Argon's background
+ // long-decode continuation. Do not advertise its 1M background output cap.
+ if (/(?:^|\/)gemini-4-argon(?=$|:)/.test(model)) return 65536;
+ if (/(?:^|\/)muse-(?:wonder|spark-open)(?=$|:)/.test(model)) return 943718;
+
// OpenAI and router slugs
if (/^gpt-6(?:\.1)?-(?:luna-pro|sol|astra)(?:[.\-:]|$)/.test(model) || model.includes('/gpt-6.1-sol')) return 128000;
if (/^gpt-5(?:[.\-]|$)/.test(model) || model.includes('/gpt-5')) return 128000;
diff --git a/src/chrome/src/providers/openai.js b/src/chrome/src/providers/openai.js
index dbcd5f3ec..cfeaca8c6 100644
--- a/src/chrome/src/providers/openai.js
+++ b/src/chrome/src/providers/openai.js
@@ -1,4 +1,5 @@
import { BaseLLMProvider } from './base.js';
+import { openRouterReplayIdentity, openRouterReplayItems, projectOpenRouterReplay, accumulateReasoningDetails } from './openrouter-replay.js';
import { normalizeQwenToolResult, normalizeQwenToolStream } from './qwen-tool-calls.js';
import { normalizeDolphinPromptedResult, normalizeDolphinPromptedStream } from './dolphin-prompted-tools.js';
import { retryAfterMs } from './model-retry.js';
@@ -19,6 +20,7 @@ import {
supportsOpenAIAskStreaming,
applyOpenRouterRoutingVariant,
openRouterMuseToolOptions,
+ mandatoryReasoningOptions,
} from './provider-compatibility.js';
import { normalizeRuntimeTraceConfig } from '../trace/runtime-config.js';
import { canonicalizeOllamaBaseUrl } from './context-windows.js';
@@ -55,6 +57,15 @@ function sseDataPayload(line) {
* Provider for OpenAI-compatible APIs (ChatGPT, OpenRouter, any OpenAI-compatible endpoint).
*/
export class OpenAICompatibleProvider extends BaseLLMProvider {
+ _reasoningReplayIdentity() {
+ return openRouterReplayIdentity({ ...this.config, baseUrl: this.baseUrl, model: this.model });
+ }
+
+ _chatMessages(messages, options = {}) {
+ const mapped = super._chatMessages(messages, options);
+ return projectOpenRouterReplay(mapped, messages, { ...this.config, baseUrl: this.baseUrl, model: this.model });
+ }
+
get name() {
return this.config.providerName || 'openai';
}
@@ -599,6 +610,7 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
* compatibility presets, and safe extraBody merge.
*/
_buildChatCompletionsBody(messages, options = {}, stream = false) {
+ options = mandatoryReasoningOptions({ ...this.config, baseUrl: this.baseUrl, model: this.model }, options);
options = qwenToolOptions({ ...this.config, baseUrl: this.baseUrl, model: this.config.model || '' }, options);
options = openRouterMuseToolOptions({ ...this.config, baseUrl: this.baseUrl, model: this.model }, options);
if (this.requiresPromptedTools) {
@@ -1156,6 +1168,9 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
throw new Error(`${this.name} returned invalid JSON in chat response.`);
}
const message = this._chatCompletionMessage(data);
+ const replayItems = openRouterReplayItems(
+ { ...this.config, baseUrl: this.baseUrl, model: this.model }, message?.reasoning_details, message?.tool_calls,
+ );
const result = normalizeQwenToolResult(
{ ...this.config, baseUrl: this.baseUrl, model: this.config.model || '' },
@@ -1164,6 +1179,7 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
content: message?.content || '',
reasoningContent: message?.reasoning_content || message?.reasoning || '',
toolCalls: message?.tool_calls || null,
+ ...(replayItems ? { responseItems: replayItems } : {}),
usage: data.usage || null,
finishReason: String(data?.choices?.[0]?.finish_reason || ''),
raw: data,
@@ -1237,6 +1253,13 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
let finalUsage = null;
let sawTerminalFinish = false;
let terminalFinishReason = '';
+ const keepReasoningReplay = this._reasoningReplayIdentity() !== null;
+ const reasoningDetails = [];
+ const replayCalls = new Map();
+ const replayItems = () => openRouterReplayItems(
+ { ...this.config, baseUrl: this.baseUrl, model: this.model }, reasoningDetails,
+ [...replayCalls.entries()].sort(([a], [b]) => a - b).map(([, call]) => call),
+ );
while (true) {
let chunk;
@@ -1265,6 +1288,7 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
type: 'done',
content: '',
...(terminalFinishReason ? { finishReason: terminalFinishReason } : {}),
+ ...(replayItems() ? { responseItems: replayItems() } : {}),
};
return;
}
@@ -1307,6 +1331,12 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
terminalFinishReason = String(finishReason);
}
const delta = choice?.delta;
+ if (keepReasoningReplay) {
+ accumulateReasoningDetails(reasoningDetails, delta?.reasoning_details);
+ for (const call of delta?.tool_calls || []) {
+ if (call.id) replayCalls.set(call.index ?? 0, { id: call.id });
+ }
+ }
const reasoningDelta = delta?.reasoning_content || delta?.reasoning;
if (typeof reasoningDelta === 'string' && reasoningDelta) {
yield { type: 'reasoning', content: reasoningDelta };
@@ -1321,7 +1351,7 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
}
if (finalUsage) yield { type: 'usage', usage: finalUsage };
if (sawTerminalFinish) {
- yield { type: 'done', content: '', finishReason: terminalFinishReason };
+ yield { type: 'done', content: '', finishReason: terminalFinishReason, ...(replayItems() ? { responseItems: replayItems() } : {}) };
return;
}
if (this._supportsInteractiveAskStreaming()) {
diff --git a/src/chrome/src/providers/openrouter-replay.js b/src/chrome/src/providers/openrouter-replay.js
new file mode 100644
index 000000000..b2e0f9daa
--- /dev/null
+++ b/src/chrome/src/providers/openrouter-replay.js
@@ -0,0 +1,54 @@
+// OpenRouter carries Gemini's opaque signatures in reasoning_details. Use the
+// Agent's existing provider-owned envelope to preserve them across tool turns.
+export function openRouterReplayIdentity(config) {
+ let url;
+ try { url = new URL(config.baseUrl); } catch { return null; }
+ const model = String(config.model || '').trim().toLowerCase();
+ return url.hostname === 'openrouter.ai'
+ && url.pathname.replace(/\/+$/, '') === '/api/v1'
+ && /^(?:google\/gemini-4-argon|meta\/muse-(?:wonder|spark-open))(?=$|:)/.test(model)
+ ? `openrouter:${model}` : null;
+}
+
+export function openRouterReplayItems(config, details, calls = []) {
+ const identity = openRouterReplayIdentity(config);
+ if (!identity || !Array.isArray(details) || !details.length) return null;
+ return [{
+ type: 'webbrain_provider_replay', version: 1,
+ provider: config.providerName || 'openai', model: config.model,
+ providerIdentity: identity,
+ content: [{ type: 'openrouter_reasoning_details', details },
+ ...(calls || []).map(call => ({ type: 'tool_use', id: call.id }))],
+ }];
+}
+
+export function projectOpenRouterReplay(messages, originals, config) {
+ const identity = openRouterReplayIdentity(config);
+ if (!identity) return messages;
+ return messages.map((message, index) => {
+ const { reasoning_details: _unownedDetails, ...clean } = message;
+ const state = originals[index]?._reasoning_replay?.providerState;
+ if (state?.providerIdentity !== identity || state.version !== 1
+ || state.provider !== (config.providerName || 'openai') || state.model !== config.model
+ || !Array.isArray(state.content)) return clean;
+ const ids = state.content.filter(block => block.type === 'tool_use').map(block => block.id);
+ const calls = clean.tool_calls || [];
+ if (ids.length !== calls.length || ids.some((id, i) => !id || id !== calls[i]?.id)) return clean;
+ const details = state.content.find(block => block.type === 'openrouter_reasoning_details')?.details;
+ return Array.isArray(details) ? { ...clean, reasoning_details: details } : clean;
+ });
+}
+
+export function accumulateReasoningDetails(accumulator, details) {
+ for (const detail of Array.isArray(details) ? details : []) {
+ if (!detail || typeof detail !== 'object') continue;
+ const existing = Number.isInteger(detail.index)
+ ? accumulator.find(block => block.index === detail.index) : null;
+ if (!existing) { accumulator.push({ ...detail }); continue; }
+ for (const [key, value] of Object.entries(detail)) {
+ if (['text', 'data', 'summary'].includes(key) && typeof value === 'string') {
+ existing[key] = String(existing[key] || '') + value;
+ } else existing[key] = value;
+ }
+ }
+}
diff --git a/src/chrome/src/providers/provider-compatibility.js b/src/chrome/src/providers/provider-compatibility.js
index ac18525ab..379260621 100644
--- a/src/chrome/src/providers/provider-compatibility.js
+++ b/src/chrome/src/providers/provider-compatibility.js
@@ -20,7 +20,86 @@ export const OPENROUTER_ROUTING_VARIANTS = Object.freeze(['standard', 'nitro', '
// it without duplicating the explicit-override precedence in supportsVision.
const BASE_VISION_MODEL_PATTERN = /gpt-4o|gpt-4\.1|gpt-4-turbo|gpt-5|gpt-6(?:\.1)?-(?:luna-pro|sol|astra)(?:$|[-_.:/])|claude|gemini|grok|minimax-m3|kimi-k(?:-?3|2\.[5-9])|llava|qwen.*vl|qwen2.*vl|qwen3.*vl|qwen3\.[5-9]|qwen3p8-27b|pixtral|llama.*vision|gemma.*vision|gemma-?[34]|step-3/;
export function baseModelNameSniffedVision(model) {
- return BASE_VISION_MODEL_PATTERN.test(String(model || ''));
+ return BASE_VISION_MODEL_PATTERN.test(String(model || ''))
+ || /(?:^|\/)muse-(?:wonder|spark-open)(?=$|:)/i.test(String(model || '').trim());
+}
+
+// Gemini's OpenAI-compatible tool calls carry opaque replay signatures.
+// Later argument-only deltas must not erase the signature on the first delta.
+export function preserveToolCallSignature(target, delta) {
+ const signature = delta?.extra_content?.google?.thought_signature;
+ if (typeof signature === 'string' && signature) {
+ target.extra_content = {
+ ...target.extra_content,
+ google: { ...target.extra_content?.google, thought_signature: signature },
+ };
+ }
+}
+
+// These launch contracts are endpoint-scoped: a similarly named local model
+// may use a different template or support disabling thinking.
+function mandatoryReasoningModel(config = {}) {
+ let url;
+ try { url = new URL(config.baseUrl || ''); } catch { return null; }
+ const model = String(config.model || '').trim().toLowerCase().replace(OPENROUTER_MODEL_VARIANT_SUFFIXES, '');
+ const router = url.hostname === 'openrouter.ai';
+ const argon = (router && model === 'google/gemini-4-argon')
+ || (url.hostname === 'generativelanguage.googleapis.com'
+ && url.pathname.replace(/\/+$/, '') === '/v1beta/openai' && model === 'gemini-4-argon');
+ if (argon) return { argon: true, router, minimumEffort: 'low', maxTokens: 65536 };
+ if (router && ['meta/muse-wonder', 'meta/muse-spark-open'].includes(model)) {
+ return { router, minimumEffort: model === 'meta/muse-wonder' ? 'minimal' : 'low', maxTokens: 943718 };
+ }
+ return null;
+}
+
+export function mandatoryReasoningOptions(config = {}, options = {}) {
+ const contract = mandatoryReasoningModel(config);
+ if (!contract) return options;
+ // Argon's output budget includes thinking. Google recommends at least 32k;
+ // short text/classifier calls on Muse also need room beyond their JSON.
+ const textOnly = options.toolChoice === 'none' || !options.tools?.length;
+ const minimum = contract.argon ? 32768 : textOnly ? 2048 : 1;
+ return { ...options, maxTokens: Math.min(contract.maxTokens, Math.max(minimum, Number(options.maxTokens) || 4096)) };
+}
+
+function normalizeMandatoryReasoningBody(body, config, perRequestExtraBody) {
+ const contract = mandatoryReasoningModel(config);
+ if (!contract) return body;
+ const reasoning = isPlainObject(body.reasoning) ? { ...body.reasoning } : {};
+ let effort = body.reasoning_effort || reasoning.effort;
+ // Classifiers disable thinking per call. Their override must beat an effort
+ // inherited from settings. Conversely, an explicit per-call effort can
+ // override a saved disabled setting unless this call also disables it.
+ const requestedEffort = perRequestExtraBody?.reasoning_effort || perRequestExtraBody?.reasoning?.effort;
+ const disabled = reasoning.enabled === false
+ && (!requestedEffort || perRequestExtraBody?.reasoning?.enabled === false);
+ if (disabled || ['none', 'off', 'minimal'].includes(effort)) {
+ effort = contract.minimumEffort;
+ }
+ if (contract.argon && ['xhigh', 'max'].includes(effort)) effort = 'high';
+ if (contract.minimumEffort === 'low' && effort === 'max') effort = 'xhigh';
+ delete reasoning.enabled;
+ if (effort) reasoning.effort = effort;
+ if (contract.router) {
+ delete body.reasoning_effort;
+ if (Object.keys(reasoning).length) body.reasoning = reasoning;
+ else delete body.reasoning;
+ } else {
+ delete body.reasoning;
+ const configured = normalizeProviderCompatibility(config).reasoningEffort;
+ if (!effort && configured !== 'auto') {
+ effort = ['off', 'minimal'].includes(configured) ? 'low'
+ : ['xhigh', 'max'].includes(configured) ? 'high' : configured;
+ }
+ if (effort) body.reasoning_effort = effort;
+ }
+ if (contract.argon) {
+ delete body.temperature;
+ delete body.top_p;
+ delete body.top_k;
+ }
+ return body;
}
// OpenRouter model-specific capability helpers (pure model-id checks; callers
@@ -152,13 +231,13 @@ export const RESERVED_EXTRA_BODY_KEYS = new Set([
const UNSAFE_OBJECT_KEYS = new Set(['__proto__', 'prototype', 'constructor']);
-/** Muse Spark on OpenRouter accepts only automatic tool selection. Custom
+/** Meta's hosted Muse routes accept only automatic tool selection. Custom
* imported provider names still speak the same endpoint/model contract. */
export function openRouterMuseToolOptions(config = {}, options = {}) {
let openRouter = false;
try { openRouter = new URL(config.baseUrl || '').hostname.toLowerCase() === 'openrouter.ai'; } catch { /* not an OpenRouter endpoint */ }
const model = String(config.model || '').trim().toLowerCase().replace(OPENROUTER_MODEL_VARIANT_SUFFIXES, '');
- if (!openRouter || model !== 'meta/muse-spark-1.3-contributor') return options;
+ if (!openRouter || !['meta/muse-spark-1.3-contributor', 'meta/muse-wonder'].includes(model)) return options;
// Muse cannot disable reasoning. Small classifier budgets otherwise end in
// hidden reasoning with no JSON output, even after the portable retry.
const disabledReasoning = options.extraBody?.reasoning?.enabled === false;
@@ -175,7 +254,7 @@ export function openRouterMuseToolOptions(config = {}, options = {}) {
const choice = options.toolChoice;
const name = choice && typeof choice === 'object' ? choice.function?.name || choice.name : null;
const tools = name ? (options.tools || []).filter(tool => tool?.function?.name === name || tool?.name === name) : options.tools;
- if (name && !tools.length) throw new Error(`Requested tool '${name}' is not available for Muse Spark.`);
+ if (name && !tools.length) throw new Error(`Requested tool '${name}' is not available for Muse.`);
return { ...options, tools, toolChoice: 'auto' };
}
@@ -653,7 +732,7 @@ export function mergeProviderRequestBody(body, config = {}, perRequestExtraBody
// per-call planner/vision override must clear an effort inherited from the
// configured compatibility preset (see deepseek-config.js).
if (isDirectDeepSeekConfig(config)) stripDisabledDeepSeekReasoningEffort(result);
- return result;
+ return normalizeMandatoryReasoningBody(result, config, perRequestExtraBody);
}
export function validateProviderExtraBody(value) {
diff --git a/src/chrome/src/ui/settings.js b/src/chrome/src/ui/settings.js
index 746678485..a2a5be164 100644
--- a/src/chrome/src/ui/settings.js
+++ b/src/chrome/src/ui/settings.js
@@ -3344,7 +3344,7 @@ function renderProviders() {
fields: [
{ key: 'apiKey', labelKey: 'st.provider.field.api_key', type: 'password', placeholder: 'sk-or-...' },
{ key: 'model', labelKey: 'st.provider.field.model', type: 'text', placeholder: 'openrouter/free',
- suggestions: ['openrouter/free', 'anthropic/claude-opus-5.5', 'qwen/qwen3.8-27b', 'moonshotai/kimi-k3', 'z-ai/glm-5.3', 'minimax/minimax-m3'] },
+ suggestions: ['openrouter/free', 'google/gemini-4-argon', 'meta/muse-wonder', 'meta/muse-spark-open', 'anthropic/claude-opus-5.5', 'qwen/qwen3.8-27b', 'moonshotai/kimi-k3', 'z-ai/glm-5.3', 'minimax/minimax-m3'] },
{ key: 'baseUrl', labelKey: 'st.provider.field.api_base_url', type: 'text', placeholder: 'https://openrouter.ai/api/v1' },
PROMPT_TIER_FIELD,
TOOL_MODE_FIELD,
@@ -3393,7 +3393,7 @@ function renderProviders() {
fields: [
{ key: 'apiKey', labelKey: 'st.provider.field.api_key', type: 'password', placeholder: 'AIza...' },
{ key: 'model', labelKey: 'st.provider.field.model', type: 'text', placeholder: 'gemini-3.1-pro',
- suggestions: ['gemini-3.1-pro', 'gemini-3.7-flash', 'gemini-3.6-flash', 'gemini-3.5-flash', 'gemini-3.1-flash-lite'] },
+ suggestions: ['gemini-4-argon', 'gemini-3.1-pro', 'gemini-3.7-flash', 'gemini-3.6-flash', 'gemini-3.5-flash', 'gemini-3.1-flash-lite'] },
{ key: 'baseUrl', labelKey: 'st.provider.field.api_base_url', type: 'text', placeholder: 'https://generativelanguage.googleapis.com/v1beta/openai' },
...COST_ESTIMATE_FIELDS,
],
diff --git a/src/firefox/src/agent/agent.js b/src/firefox/src/agent/agent.js
index 9337e5e6b..f59bae5d2 100644
--- a/src/firefox/src/agent/agent.js
+++ b/src/firefox/src/agent/agent.js
@@ -26,7 +26,7 @@ import { isSessionQuotaError, serializeConversationForSession, SESSION_CONVERSAT
import { SteeringJournal } from './steering-journal.js';
import { formatErrorMessage } from '../error-format.js';
import { retryModelCall, retryModelStream } from '../providers/model-retry.js';
-import { isQwenConfig } from '../providers/provider-compatibility.js';
+import { isQwenConfig, preserveToolCallSignature } from '../providers/provider-compatibility.js';
import { aggregateMessageCompletion } from '../message-info.js';
import { handleDoneJson } from './cloud-output.js';
import { applyReadPageWindow, fitReadPageWindowResult, isReadPageWindowResult } from './read-page-window.js';
@@ -8223,6 +8223,7 @@ export class Agent extends LoopDetector {
type: 'function',
function: { name: '', arguments: '' },
};
+ preserveToolCallSignature(existing, toolCall);
if (toolCall.id) existing.id = toolCall.id;
if (toolCall.type) existing.type = toolCall.type;
if (toolCall.function?.name) existing.function.name += toolCall.function.name;
@@ -43135,6 +43136,7 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
if (!toolCallsAccumulator[idx]) {
toolCallsAccumulator[idx] = { id: '', function: { name: '', arguments: '' } };
}
+ preserveToolCallSignature(toolCallsAccumulator[idx], tc);
if (tc.id) toolCallsAccumulator[idx].id = tc.id;
if (tc.function?.name) toolCallsAccumulator[idx].function.name += tc.function.name;
if (tc.function?.arguments) toolCallsAccumulator[idx].function.arguments += tc.function.arguments;
diff --git a/src/firefox/src/providers/context-windows.js b/src/firefox/src/providers/context-windows.js
index 7479962c3..5bb5fbb5f 100644
--- a/src/firefox/src/providers/context-windows.js
+++ b/src/firefox/src/providers/context-windows.js
@@ -289,8 +289,11 @@ export function inferContextWindow(config = {}) {
if (model.includes('claude-')) return 200000;
// Google Gemini
+ if (/(?:^|\/)gemini-4-argon(?=$|:)/.test(model)) return 1048576;
if (/gemini-(?:3|3\.|2\.5)/.test(model)) return M1;
+ if (/(?:^|\/)muse-(?:wonder|spark-open)(?=$|:)/.test(model)) return 1048576;
+
// Cloudflare Workers AI
if (provider === 'cloudflare' && model.includes('@cf/zai-org/glm-5.2')) return K256;
@@ -352,6 +355,11 @@ export function inferMaxOutputTokens(config = {}) {
const model = clean(config.model);
if (!model) return null;
+ // WebBrain uses synchronous Chat Completions, without Argon's background
+ // long-decode continuation. Do not advertise its 1M background output cap.
+ if (/(?:^|\/)gemini-4-argon(?=$|:)/.test(model)) return 65536;
+ if (/(?:^|\/)muse-(?:wonder|spark-open)(?=$|:)/.test(model)) return 943718;
+
// OpenAI and router slugs
if (/^gpt-6(?:\.1)?-(?:luna-pro|sol|astra)(?:[.\-:]|$)/.test(model) || model.includes('/gpt-6.1-sol')) return 128000;
if (/^gpt-5(?:[.\-]|$)/.test(model) || model.includes('/gpt-5')) return 128000;
diff --git a/src/firefox/src/providers/openai.js b/src/firefox/src/providers/openai.js
index c8de3ee7e..ef74bf9d3 100644
--- a/src/firefox/src/providers/openai.js
+++ b/src/firefox/src/providers/openai.js
@@ -1,4 +1,5 @@
import { BaseLLMProvider } from './base.js';
+import { openRouterReplayIdentity, openRouterReplayItems, projectOpenRouterReplay, accumulateReasoningDetails } from './openrouter-replay.js';
import { normalizeQwenToolResult, normalizeQwenToolStream } from './qwen-tool-calls.js';
import { normalizeDolphinPromptedResult, normalizeDolphinPromptedStream } from './dolphin-prompted-tools.js';
import { retryAfterMs } from './model-retry.js';
@@ -19,6 +20,7 @@ import {
supportsOpenAIAskStreaming,
applyOpenRouterRoutingVariant,
openRouterMuseToolOptions,
+ mandatoryReasoningOptions,
} from './provider-compatibility.js';
import { normalizeRuntimeTraceConfig } from '../trace/runtime-config.js';
import { RESEARCH_DATA_COLLECTION } from '../trace/research-consent.js';
@@ -56,6 +58,15 @@ function sseDataPayload(line) {
* Provider for OpenAI-compatible APIs (ChatGPT, OpenRouter, any OpenAI-compatible endpoint).
*/
export class OpenAICompatibleProvider extends BaseLLMProvider {
+ _reasoningReplayIdentity() {
+ return openRouterReplayIdentity({ ...this.config, baseUrl: this.baseUrl, model: this.model });
+ }
+
+ _chatMessages(messages, options = {}) {
+ const mapped = super._chatMessages(messages, options);
+ return projectOpenRouterReplay(mapped, messages, { ...this.config, baseUrl: this.baseUrl, model: this.model });
+ }
+
get name() {
return this.config.providerName || 'openai';
}
@@ -616,6 +627,7 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
* compatibility presets, and safe extraBody merge.
*/
_buildChatCompletionsBody(messages, options = {}, stream = false) {
+ options = mandatoryReasoningOptions({ ...this.config, baseUrl: this.baseUrl, model: this.model }, options);
options = qwenToolOptions({ ...this.config, baseUrl: this.baseUrl, model: this.config.model || '' }, options);
options = openRouterMuseToolOptions({ ...this.config, baseUrl: this.baseUrl, model: this.model }, options);
if (this.requiresPromptedTools) {
@@ -1173,6 +1185,9 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
throw new Error(`${this.name} returned invalid JSON in chat response.`);
}
const message = this._chatCompletionMessage(data);
+ const replayItems = openRouterReplayItems(
+ { ...this.config, baseUrl: this.baseUrl, model: this.model }, message?.reasoning_details, message?.tool_calls,
+ );
const result = normalizeQwenToolResult(
{ ...this.config, baseUrl: this.baseUrl, model: this.config.model || '' },
@@ -1181,6 +1196,7 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
content: message?.content || '',
reasoningContent: message?.reasoning_content || message?.reasoning || '',
toolCalls: message?.tool_calls || null,
+ ...(replayItems ? { responseItems: replayItems } : {}),
usage: data.usage || null,
finishReason: String(data?.choices?.[0]?.finish_reason || ''),
raw: data,
@@ -1254,6 +1270,13 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
let finalUsage = null;
let sawTerminalFinish = false;
let terminalFinishReason = '';
+ const keepReasoningReplay = this._reasoningReplayIdentity() !== null;
+ const reasoningDetails = [];
+ const replayCalls = new Map();
+ const replayItems = () => openRouterReplayItems(
+ { ...this.config, baseUrl: this.baseUrl, model: this.model }, reasoningDetails,
+ [...replayCalls.entries()].sort(([a], [b]) => a - b).map(([, call]) => call),
+ );
while (true) {
let chunk;
@@ -1282,6 +1305,7 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
type: 'done',
content: '',
...(terminalFinishReason ? { finishReason: terminalFinishReason } : {}),
+ ...(replayItems() ? { responseItems: replayItems() } : {}),
};
return;
}
@@ -1324,6 +1348,12 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
terminalFinishReason = String(finishReason);
}
const delta = choice?.delta;
+ if (keepReasoningReplay) {
+ accumulateReasoningDetails(reasoningDetails, delta?.reasoning_details);
+ for (const call of delta?.tool_calls || []) {
+ if (call.id) replayCalls.set(call.index ?? 0, { id: call.id });
+ }
+ }
const reasoningDelta = delta?.reasoning_content || delta?.reasoning;
if (typeof reasoningDelta === 'string' && reasoningDelta) {
yield { type: 'reasoning', content: reasoningDelta };
@@ -1338,7 +1368,7 @@ export class OpenAICompatibleProvider extends BaseLLMProvider {
}
if (finalUsage) yield { type: 'usage', usage: finalUsage };
if (sawTerminalFinish) {
- yield { type: 'done', content: '', finishReason: terminalFinishReason };
+ yield { type: 'done', content: '', finishReason: terminalFinishReason, ...(replayItems() ? { responseItems: replayItems() } : {}) };
return;
}
if (this._supportsInteractiveAskStreaming()) {
diff --git a/src/firefox/src/providers/openrouter-replay.js b/src/firefox/src/providers/openrouter-replay.js
new file mode 100644
index 000000000..b2e0f9daa
--- /dev/null
+++ b/src/firefox/src/providers/openrouter-replay.js
@@ -0,0 +1,54 @@
+// OpenRouter carries Gemini's opaque signatures in reasoning_details. Use the
+// Agent's existing provider-owned envelope to preserve them across tool turns.
+export function openRouterReplayIdentity(config) {
+ let url;
+ try { url = new URL(config.baseUrl); } catch { return null; }
+ const model = String(config.model || '').trim().toLowerCase();
+ return url.hostname === 'openrouter.ai'
+ && url.pathname.replace(/\/+$/, '') === '/api/v1'
+ && /^(?:google\/gemini-4-argon|meta\/muse-(?:wonder|spark-open))(?=$|:)/.test(model)
+ ? `openrouter:${model}` : null;
+}
+
+export function openRouterReplayItems(config, details, calls = []) {
+ const identity = openRouterReplayIdentity(config);
+ if (!identity || !Array.isArray(details) || !details.length) return null;
+ return [{
+ type: 'webbrain_provider_replay', version: 1,
+ provider: config.providerName || 'openai', model: config.model,
+ providerIdentity: identity,
+ content: [{ type: 'openrouter_reasoning_details', details },
+ ...(calls || []).map(call => ({ type: 'tool_use', id: call.id }))],
+ }];
+}
+
+export function projectOpenRouterReplay(messages, originals, config) {
+ const identity = openRouterReplayIdentity(config);
+ if (!identity) return messages;
+ return messages.map((message, index) => {
+ const { reasoning_details: _unownedDetails, ...clean } = message;
+ const state = originals[index]?._reasoning_replay?.providerState;
+ if (state?.providerIdentity !== identity || state.version !== 1
+ || state.provider !== (config.providerName || 'openai') || state.model !== config.model
+ || !Array.isArray(state.content)) return clean;
+ const ids = state.content.filter(block => block.type === 'tool_use').map(block => block.id);
+ const calls = clean.tool_calls || [];
+ if (ids.length !== calls.length || ids.some((id, i) => !id || id !== calls[i]?.id)) return clean;
+ const details = state.content.find(block => block.type === 'openrouter_reasoning_details')?.details;
+ return Array.isArray(details) ? { ...clean, reasoning_details: details } : clean;
+ });
+}
+
+export function accumulateReasoningDetails(accumulator, details) {
+ for (const detail of Array.isArray(details) ? details : []) {
+ if (!detail || typeof detail !== 'object') continue;
+ const existing = Number.isInteger(detail.index)
+ ? accumulator.find(block => block.index === detail.index) : null;
+ if (!existing) { accumulator.push({ ...detail }); continue; }
+ for (const [key, value] of Object.entries(detail)) {
+ if (['text', 'data', 'summary'].includes(key) && typeof value === 'string') {
+ existing[key] = String(existing[key] || '') + value;
+ } else existing[key] = value;
+ }
+ }
+}
diff --git a/src/firefox/src/providers/provider-compatibility.js b/src/firefox/src/providers/provider-compatibility.js
index ac18525ab..379260621 100644
--- a/src/firefox/src/providers/provider-compatibility.js
+++ b/src/firefox/src/providers/provider-compatibility.js
@@ -20,7 +20,86 @@ export const OPENROUTER_ROUTING_VARIANTS = Object.freeze(['standard', 'nitro', '
// it without duplicating the explicit-override precedence in supportsVision.
const BASE_VISION_MODEL_PATTERN = /gpt-4o|gpt-4\.1|gpt-4-turbo|gpt-5|gpt-6(?:\.1)?-(?:luna-pro|sol|astra)(?:$|[-_.:/])|claude|gemini|grok|minimax-m3|kimi-k(?:-?3|2\.[5-9])|llava|qwen.*vl|qwen2.*vl|qwen3.*vl|qwen3\.[5-9]|qwen3p8-27b|pixtral|llama.*vision|gemma.*vision|gemma-?[34]|step-3/;
export function baseModelNameSniffedVision(model) {
- return BASE_VISION_MODEL_PATTERN.test(String(model || ''));
+ return BASE_VISION_MODEL_PATTERN.test(String(model || ''))
+ || /(?:^|\/)muse-(?:wonder|spark-open)(?=$|:)/i.test(String(model || '').trim());
+}
+
+// Gemini's OpenAI-compatible tool calls carry opaque replay signatures.
+// Later argument-only deltas must not erase the signature on the first delta.
+export function preserveToolCallSignature(target, delta) {
+ const signature = delta?.extra_content?.google?.thought_signature;
+ if (typeof signature === 'string' && signature) {
+ target.extra_content = {
+ ...target.extra_content,
+ google: { ...target.extra_content?.google, thought_signature: signature },
+ };
+ }
+}
+
+// These launch contracts are endpoint-scoped: a similarly named local model
+// may use a different template or support disabling thinking.
+function mandatoryReasoningModel(config = {}) {
+ let url;
+ try { url = new URL(config.baseUrl || ''); } catch { return null; }
+ const model = String(config.model || '').trim().toLowerCase().replace(OPENROUTER_MODEL_VARIANT_SUFFIXES, '');
+ const router = url.hostname === 'openrouter.ai';
+ const argon = (router && model === 'google/gemini-4-argon')
+ || (url.hostname === 'generativelanguage.googleapis.com'
+ && url.pathname.replace(/\/+$/, '') === '/v1beta/openai' && model === 'gemini-4-argon');
+ if (argon) return { argon: true, router, minimumEffort: 'low', maxTokens: 65536 };
+ if (router && ['meta/muse-wonder', 'meta/muse-spark-open'].includes(model)) {
+ return { router, minimumEffort: model === 'meta/muse-wonder' ? 'minimal' : 'low', maxTokens: 943718 };
+ }
+ return null;
+}
+
+export function mandatoryReasoningOptions(config = {}, options = {}) {
+ const contract = mandatoryReasoningModel(config);
+ if (!contract) return options;
+ // Argon's output budget includes thinking. Google recommends at least 32k;
+ // short text/classifier calls on Muse also need room beyond their JSON.
+ const textOnly = options.toolChoice === 'none' || !options.tools?.length;
+ const minimum = contract.argon ? 32768 : textOnly ? 2048 : 1;
+ return { ...options, maxTokens: Math.min(contract.maxTokens, Math.max(minimum, Number(options.maxTokens) || 4096)) };
+}
+
+function normalizeMandatoryReasoningBody(body, config, perRequestExtraBody) {
+ const contract = mandatoryReasoningModel(config);
+ if (!contract) return body;
+ const reasoning = isPlainObject(body.reasoning) ? { ...body.reasoning } : {};
+ let effort = body.reasoning_effort || reasoning.effort;
+ // Classifiers disable thinking per call. Their override must beat an effort
+ // inherited from settings. Conversely, an explicit per-call effort can
+ // override a saved disabled setting unless this call also disables it.
+ const requestedEffort = perRequestExtraBody?.reasoning_effort || perRequestExtraBody?.reasoning?.effort;
+ const disabled = reasoning.enabled === false
+ && (!requestedEffort || perRequestExtraBody?.reasoning?.enabled === false);
+ if (disabled || ['none', 'off', 'minimal'].includes(effort)) {
+ effort = contract.minimumEffort;
+ }
+ if (contract.argon && ['xhigh', 'max'].includes(effort)) effort = 'high';
+ if (contract.minimumEffort === 'low' && effort === 'max') effort = 'xhigh';
+ delete reasoning.enabled;
+ if (effort) reasoning.effort = effort;
+ if (contract.router) {
+ delete body.reasoning_effort;
+ if (Object.keys(reasoning).length) body.reasoning = reasoning;
+ else delete body.reasoning;
+ } else {
+ delete body.reasoning;
+ const configured = normalizeProviderCompatibility(config).reasoningEffort;
+ if (!effort && configured !== 'auto') {
+ effort = ['off', 'minimal'].includes(configured) ? 'low'
+ : ['xhigh', 'max'].includes(configured) ? 'high' : configured;
+ }
+ if (effort) body.reasoning_effort = effort;
+ }
+ if (contract.argon) {
+ delete body.temperature;
+ delete body.top_p;
+ delete body.top_k;
+ }
+ return body;
}
// OpenRouter model-specific capability helpers (pure model-id checks; callers
@@ -152,13 +231,13 @@ export const RESERVED_EXTRA_BODY_KEYS = new Set([
const UNSAFE_OBJECT_KEYS = new Set(['__proto__', 'prototype', 'constructor']);
-/** Muse Spark on OpenRouter accepts only automatic tool selection. Custom
+/** Meta's hosted Muse routes accept only automatic tool selection. Custom
* imported provider names still speak the same endpoint/model contract. */
export function openRouterMuseToolOptions(config = {}, options = {}) {
let openRouter = false;
try { openRouter = new URL(config.baseUrl || '').hostname.toLowerCase() === 'openrouter.ai'; } catch { /* not an OpenRouter endpoint */ }
const model = String(config.model || '').trim().toLowerCase().replace(OPENROUTER_MODEL_VARIANT_SUFFIXES, '');
- if (!openRouter || model !== 'meta/muse-spark-1.3-contributor') return options;
+ if (!openRouter || !['meta/muse-spark-1.3-contributor', 'meta/muse-wonder'].includes(model)) return options;
// Muse cannot disable reasoning. Small classifier budgets otherwise end in
// hidden reasoning with no JSON output, even after the portable retry.
const disabledReasoning = options.extraBody?.reasoning?.enabled === false;
@@ -175,7 +254,7 @@ export function openRouterMuseToolOptions(config = {}, options = {}) {
const choice = options.toolChoice;
const name = choice && typeof choice === 'object' ? choice.function?.name || choice.name : null;
const tools = name ? (options.tools || []).filter(tool => tool?.function?.name === name || tool?.name === name) : options.tools;
- if (name && !tools.length) throw new Error(`Requested tool '${name}' is not available for Muse Spark.`);
+ if (name && !tools.length) throw new Error(`Requested tool '${name}' is not available for Muse.`);
return { ...options, tools, toolChoice: 'auto' };
}
@@ -653,7 +732,7 @@ export function mergeProviderRequestBody(body, config = {}, perRequestExtraBody
// per-call planner/vision override must clear an effort inherited from the
// configured compatibility preset (see deepseek-config.js).
if (isDirectDeepSeekConfig(config)) stripDisabledDeepSeekReasoningEffort(result);
- return result;
+ return normalizeMandatoryReasoningBody(result, config, perRequestExtraBody);
}
export function validateProviderExtraBody(value) {
diff --git a/src/firefox/src/ui/settings.js b/src/firefox/src/ui/settings.js
index de85f8e85..b245f273b 100644
--- a/src/firefox/src/ui/settings.js
+++ b/src/firefox/src/ui/settings.js
@@ -2932,7 +2932,7 @@ function renderProviders() {
fields: [
{ key: 'apiKey', labelKey: 'st.provider.field.api_key', type: 'password', placeholder: 'sk-or-...' },
{ key: 'model', labelKey: 'st.provider.field.model', type: 'text', placeholder: 'openrouter/free',
- suggestions: ['openrouter/free', 'anthropic/claude-opus-5.5', 'qwen/qwen3.8-27b', 'moonshotai/kimi-k3', 'z-ai/glm-5.3', 'minimax/minimax-m3'] },
+ suggestions: ['openrouter/free', 'google/gemini-4-argon', 'meta/muse-wonder', 'meta/muse-spark-open', 'anthropic/claude-opus-5.5', 'qwen/qwen3.8-27b', 'moonshotai/kimi-k3', 'z-ai/glm-5.3', 'minimax/minimax-m3'] },
{ key: 'baseUrl', labelKey: 'st.provider.field.api_base_url', type: 'text', placeholder: 'https://openrouter.ai/api/v1' },
PROMPT_TIER_FIELD,
TOOL_MODE_FIELD,
@@ -2981,7 +2981,7 @@ function renderProviders() {
fields: [
{ key: 'apiKey', labelKey: 'st.provider.field.api_key', type: 'password', placeholder: 'AIza...' },
{ key: 'model', labelKey: 'st.provider.field.model', type: 'text', placeholder: 'gemini-3.1-pro',
- suggestions: ['gemini-3.1-pro', 'gemini-3.7-flash', 'gemini-3.6-flash', 'gemini-3.5-flash', 'gemini-3.1-flash-lite'] },
+ suggestions: ['gemini-4-argon', 'gemini-3.1-pro', 'gemini-3.7-flash', 'gemini-3.6-flash', 'gemini-3.5-flash', 'gemini-3.1-flash-lite'] },
{ key: 'baseUrl', labelKey: 'st.provider.field.api_base_url', type: 'text', placeholder: 'https://generativelanguage.googleapis.com/v1beta/openai' },
...COST_ESTIMATE_FIELDS,
],
diff --git a/test/frontier-model-compatibility.mjs b/test/frontier-model-compatibility.mjs
new file mode 100644
index 000000000..f4c299dab
--- /dev/null
+++ b/test/frontier-model-compatibility.mjs
@@ -0,0 +1,188 @@
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+
+const models = ['google/gemini-4-argon', 'meta/muse-wonder', 'meta/muse-spark-open'];
+const tools = [{ type: 'function', function: { name: 'read_page', parameters: { type: 'object', properties: {} } } }];
+
+for (const browser of ['chrome', 'firefox']) {
+ const { OpenAICompatibleProvider } = await import(`../src/${browser}/src/providers/openai.js`);
+ const { inferMaxOutputTokens, inferContextWindow } = await import(`../src/${browser}/src/providers/context-windows.js`);
+ const { plannerRequestBody } = await import(`../src/${browser}/src/providers/provider-compatibility.js`);
+ const router = model => ({ providerName: 'openrouter', baseUrl: 'https://openrouter.ai/api/v1', model });
+
+ test(`${browser}: launch models expose vision, tools and full context with overrides intact`, () => {
+ for (const model of models) {
+ const config = router(model);
+ const provider = new OpenAICompatibleProvider(config);
+ assert.equal(provider.supportsVision, true, model);
+ assert.equal(provider.supportsTools, true, model);
+ assert.equal(provider.contextWindow, 1048576, model);
+ assert.equal(new OpenAICompatibleProvider({ ...config, visionMode: 'off' }).supportsVision, false);
+ assert.equal(new OpenAICompatibleProvider({ ...config, supportsVision: false }).supportsVision, false);
+ assert.equal(new OpenAICompatibleProvider({ ...config, contextWindow: 16384 }).contextWindow, 16384);
+ assert.equal(inferContextWindow({ ...config, category: 'local' }), 16384);
+ assert.equal(new OpenAICompatibleProvider(router(`${model}:nitro`)).supportsVision, true);
+ assert.equal(inferMaxOutputTokens(config), model.includes('argon') ? 65536 : 943718);
+ }
+ assert.equal(new OpenAICompatibleProvider(router('meta/muse-voice-transcribe')).supportsVision, false);
+ assert.equal(new OpenAICompatibleProvider(router('meta/muse-wonderful')).supportsVision, false);
+ });
+
+ test(`${browser}: mandatory reasoning survives classifier overrides without disabling native tools`, () => {
+ for (const model of models) {
+ const config = router(model);
+ const provider = new OpenAICompatibleProvider(config);
+ for (const stream of [false, true]) {
+ const classifier = provider._buildChatCompletionsBody([], {
+ maxTokens: 24, toolChoice: 'none', extraBody: plannerRequestBody(config),
+ }, stream);
+ assert.equal(classifier.reasoning.effort, model === 'meta/muse-wonder' ? 'minimal' : 'low');
+ assert.equal(Object.hasOwn(classifier.reasoning, 'enabled'), false);
+ assert.equal(classifier.max_tokens, model.includes('argon') ? 32768 : 2048);
+ const body = provider._buildChatCompletionsBody([], { tools, toolChoice: 'required' }, stream);
+ assert.equal(body.tool_choice, model === 'meta/muse-wonder' ? 'auto' : 'required');
+ assert.deepEqual(body.tools, tools);
+ assert.equal(body.stream, stream);
+ }
+ }
+ });
+
+ test(`${browser}: classifier disabling overrides inherited high reasoning`, () => {
+ for (const model of models) {
+ for (const inherited of [
+ { reasoningEffort: 'high' },
+ { compat: { reasoningEffort: 'high' } },
+ { extraBody: { reasoning: { effort: 'high' } } },
+ ]) {
+ const config = { ...router(model), ...inherited };
+ const provider = new OpenAICompatibleProvider(config);
+ for (const stream of [false, true]) {
+ const body = provider._buildChatCompletionsBody([], {
+ maxTokens: 24, toolChoice: 'none', extraBody: plannerRequestBody(config),
+ }, stream);
+ assert.equal(body.reasoning.effort, model === 'meta/muse-wonder' ? 'minimal' : 'low', model);
+ assert.equal(Object.hasOwn(body.reasoning, 'enabled'), false);
+ assert.equal(body.max_tokens, model.includes('argon') ? 32768 : 2048);
+ const normal = provider._buildChatCompletionsBody([], { tools, maxTokens: 4096 }, stream);
+ assert.equal(normal.reasoning.effort, 'high', 'Normal tool calls retain the configured effort');
+ }
+ }
+ }
+ });
+
+ test(`${browser}: Argon normalizes sampling and effort after all custom body merges`, () => {
+ const configs = [router(models[0]), {
+ providerName: 'gemini', baseUrl: 'https://generativelanguage.googleapis.com/v1beta/openai', model: 'gemini-4-argon',
+ }];
+ for (const config of configs) {
+ const provider = new OpenAICompatibleProvider({ ...config, reasoningEffort: 'off', extraBody: { temperature: 0.2, top_p: 0.9, top_k: 5 } });
+ const body = provider._buildChatCompletionsBody([], { maxTokens: 128000 });
+ assert.equal(body.max_tokens, 65536);
+ for (const key of ['temperature', 'top_p', 'top_k']) assert.equal(Object.hasOwn(body, key), false);
+ assert.equal(config.providerName === 'gemini' ? body.reasoning_effort : body.reasoning.effort, 'low');
+ const high = provider._buildChatCompletionsBody([], { extraBody: { reasoning_effort: 'max' } });
+ assert.equal(config.providerName === 'gemini' ? high.reasoning_effort : high.reasoning.effort, 'high');
+ }
+ });
+
+ test(`${browser}: endpoint-scoped launch workarounds preserve unrelated and local contracts`, () => {
+ for (const config of [router('other-model'), { ...router(models[0]), baseUrl: 'https://openrouter.ai.example/v1' }, {
+ providerName: 'local', category: 'local', model: 'muse-spark-open', baseUrl: 'http://localhost:8000/v1',
+ }]) {
+ const body = new OpenAICompatibleProvider(config)._buildChatCompletionsBody([], {
+ maxTokens: 24, temperature: 0.2, extraBody: { reasoning: { enabled: false } },
+ });
+ assert.equal(body.max_tokens, 24);
+ assert.equal(body.temperature, 0.2);
+ assert.deepEqual(body.reasoning, { enabled: false });
+ }
+ });
+
+ test(`${browser}: nonstream tool calls retain provider signatures for the next request`, async () => {
+ const provider = new OpenAICompatibleProvider(router(models[0]));
+ const call = { id: 'call-1', type: 'function', function: { name: 'read_page', arguments: '{}' }, extra_content: { google: { thought_signature: 'opaque-test-signature' } } };
+ const original = globalThis.fetch;
+ globalThis.fetch = async () => new Response(JSON.stringify({ choices: [{ message: { content: '', tool_calls: [call] }, finish_reason: 'tool_calls' }] }), { headers: { 'Content-Type': 'application/json' } });
+ try {
+ const result = await provider.chat([{ role: 'user', content: 'Read this page.' }], { tools });
+ const body = provider._buildChatCompletionsBody([
+ { role: 'assistant', content: '', tool_calls: result.toolCalls },
+ { role: 'tool', tool_call_id: call.id, content: 'Page title: Example' },
+ ], { tools });
+ assert.deepEqual(body.messages[0].tool_calls[0], call);
+ assert.equal(body.messages[1].tool_call_id, call.id);
+ } finally { globalThis.fetch = original; }
+ });
+
+ test(`${browser}: streamed signed calls survive the actual Ask accumulator and replay`, async () => {
+ const { Agent } = await import(`../src/${browser}/src/agent/agent.js`);
+ const agent = new Agent({});
+ agent._checkCostAllowance = async () => null;
+ agent._recordCostUsage = async () => null;
+ const provider = new OpenAICompatibleProvider(router(models[0]));
+ const original = globalThis.fetch;
+ const deltas = [
+ { index: 0, id: 'signed-call', type: 'function', function: { name: 'read_page', arguments: '' }, extra_content: { google: { thought_signature: 'opaque-signature' } } },
+ { index: 0, function: { arguments: '{}' } },
+ ];
+ const events = deltas.map(call => `data: ${JSON.stringify({ choices: [{ delta: { tool_calls: [call] } }] })}\n\n`).join('')
+ + 'data: {"choices":[{"delta":{},"finish_reason":"tool_calls"}]}\n\ndata: [DONE]\n\n';
+ globalThis.fetch = async () => new Response(events, { headers: { 'Content-Type': 'text/event-stream' } });
+ try {
+ const result = await agent._chatStreamWithCostAllowance(provider, [], { tools }, {});
+ const body = provider._buildChatCompletionsBody([{ role: 'assistant', content: '', tool_calls: result.toolCalls }], { tools });
+ assert.equal(body.messages[0].tool_calls[0].extra_content.google.thought_signature, 'opaque-signature');
+ assert.equal(body.messages[0].tool_calls[0].function.arguments, '{}');
+ } finally { globalThis.fetch = original; }
+ });
+
+ test(`${browser}: OpenRouter reasoning details survive native tool turns with endpoint and model ownership`, async () => {
+ const { Agent } = await import(`../src/${browser}/src/agent/agent.js`);
+ const { serializeConversationForSession } = await import(`../src/${browser}/src/agent/conversation-persistence.js`);
+ const agent = new Agent({});
+ const config = router(models[0]);
+ const provider = new OpenAICompatibleProvider(config);
+ const call = { id: 'encrypted-call', type: 'function', function: { name: 'read_page', arguments: '{}' } };
+ const details = [{ type: 'reasoning.encrypted', data: 'opaque-block', id: call.id, format: 'google-gemini-v1', index: 0 }];
+ const original = globalThis.fetch;
+ globalThis.fetch = async () => new Response(JSON.stringify({ choices: [{ message: { tool_calls: [call], reasoning_details: details }, finish_reason: 'tool_calls' }] }));
+ try {
+ const result = await provider.chat([], { tools });
+ const message = agent._withResponseItems({ role: 'assistant', content: '', tool_calls: result.toolCalls }, result.responseItems, '', provider);
+ const stored = serializeConversationForSession([message, { role: 'tool', tool_call_id: call.id, content: 'Example' }]).messages;
+ const body = provider._buildChatCompletionsBody(stored, { tools });
+ assert.deepEqual(body.messages[0].reasoning_details, details);
+ assert.equal(Object.hasOwn(body.messages[0], '_reasoning_replay'), false);
+ for (const changed of [{ ...config, model: models[1] }, { ...config, baseUrl: 'https://api.example.test/v1' }]) {
+ const foreign = new OpenAICompatibleProvider(changed)._buildChatCompletionsBody(stored, { tools });
+ assert.equal(Object.hasOwn(foreign.messages[0], 'reasoning_details'), false);
+ assert.equal(Object.hasOwn(foreign.messages[0], '_reasoning_replay'), false);
+ }
+ const edited = structuredClone(stored);
+ edited[0].tool_calls[0].id = 'replacement-call';
+ assert.equal(Object.hasOwn(provider._buildChatCompletionsBody(edited, { tools }).messages[0], 'reasoning_details'), false);
+ } finally { globalThis.fetch = original; }
+ });
+
+ test(`${browser}: streamed OpenRouter encrypted fragments reassemble before the tool follow-up`, async () => {
+ const { Agent } = await import(`../src/${browser}/src/agent/agent.js`);
+ const agent = new Agent({});
+ agent._checkCostAllowance = async () => null;
+ agent._recordCostUsage = async () => null;
+ const provider = new OpenAICompatibleProvider(router(models[0]));
+ const original = globalThis.fetch;
+ const deltas = [
+ { reasoning_details: [{ type: 'reasoning.encrypted', data: 'first-', index: 0 }] },
+ { reasoning_details: [{ type: 'reasoning.encrypted', data: 'second', index: 0 }], tool_calls: [{ index: 0, id: 'call-1', function: { name: 'read_page', arguments: '{}' } }] },
+ ];
+ const events = deltas.map(delta => `data: ${JSON.stringify({ choices: [{ delta }] })}\n\n`).join('')
+ + 'data: {"choices":[{"delta":{},"finish_reason":"tool_calls"}]}\n\ndata: [DONE]\n\n';
+ globalThis.fetch = async () => new Response(events, { headers: { 'Content-Type': 'text/event-stream' } });
+ try {
+ const result = await agent._chatStreamWithCostAllowance(provider, [], { tools }, {});
+ const message = agent._withResponseItems({ role: 'assistant', content: '', tool_calls: result.toolCalls }, result.responseItems, '', provider);
+ const body = provider._buildChatCompletionsBody([message], { tools });
+ assert.deepEqual(body.messages[0].reasoning_details, [{ type: 'reasoning.encrypted', data: 'first-second', index: 0 }]);
+ } finally { globalThis.fetch = original; }
+ });
+}
diff --git a/test/llm/analysis/2026-10-16-frontier-model-compatibility/live-smoke.json b/test/llm/analysis/2026-10-16-frontier-model-compatibility/live-smoke.json
new file mode 100644
index 000000000..2f59bdb55
--- /dev/null
+++ b/test/llm/analysis/2026-10-16-frontier-model-compatibility/live-smoke.json
@@ -0,0 +1,488 @@
+{
+ "date": "2026-10-16",
+ "recorded_at_utc": "2026-10-16T01:06:09.775814+00:00",
+ "base_commit": "21e3643937cdd9e04b0b67a6c31ba337b26c6310",
+ "tested_working_tree": "uncommitted local changes",
+ "route": "https://openrouter.ai/api/v1/chat/completions",
+ "live_checks": {
+ "browsers": [
+ "chrome",
+ "firefox"
+ ],
+ "unique_probes": 36,
+ "passed": 36,
+ "failed": 0,
+ "scope": "Live upstream API calls through WebBrain production providers and tool replay aggregation; tool observations are supplied fixtures. No real browser task completion claim. Direct Google API route not live tested."
+ },
+ "observations": [
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "google/gemini-4-argon",
+ "probe": "text",
+ "passed": true
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "google/gemini-4-argon",
+ "probe": "streaming",
+ "passed": true
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "google/gemini-4-argon",
+ "probe": "tool_round_trip",
+ "passed": true
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "google/gemini-4-argon",
+ "probe": "screenshot",
+ "passed": true
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "google/gemini-4-argon",
+ "probe": "short_classifier",
+ "passed": true
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "meta/muse-wonder",
+ "probe": "text",
+ "passed": true
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "meta/muse-wonder",
+ "probe": "streaming",
+ "passed": true
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "meta/muse-wonder",
+ "probe": "tool_round_trip",
+ "passed": false,
+ "error": "HTTP 400"
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "meta/muse-wonder",
+ "probe": "screenshot",
+ "passed": true
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "meta/muse-wonder",
+ "probe": "short_classifier",
+ "passed": true
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "meta/muse-spark-open",
+ "probe": "text",
+ "passed": true
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "meta/muse-spark-open",
+ "probe": "streaming",
+ "passed": true
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "meta/muse-spark-open",
+ "probe": "tool_round_trip",
+ "passed": true
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "meta/muse-spark-open",
+ "probe": "screenshot",
+ "passed": true
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "meta/muse-spark-open",
+ "probe": "short_classifier",
+ "passed": true
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "google/gemini-4-argon",
+ "probe": "text",
+ "passed": true,
+ "latencyMs": 3245
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "google/gemini-4-argon",
+ "probe": "streaming",
+ "passed": true,
+ "latencyMs": 3280
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "google/gemini-4-argon",
+ "probe": "tool_round_trip",
+ "passed": true,
+ "latencyMs": 5148
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "google/gemini-4-argon",
+ "probe": "screenshot",
+ "passed": true,
+ "latencyMs": 3703
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "google/gemini-4-argon",
+ "probe": "short_classifier",
+ "passed": true,
+ "latencyMs": 2094
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "meta/muse-wonder",
+ "probe": "text",
+ "passed": true,
+ "latencyMs": 2290
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "meta/muse-wonder",
+ "probe": "streaming",
+ "passed": true,
+ "latencyMs": 3576
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "meta/muse-wonder",
+ "probe": "tool_round_trip",
+ "passed": true,
+ "latencyMs": 3794
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "meta/muse-wonder",
+ "probe": "screenshot",
+ "passed": true,
+ "latencyMs": 14277
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "meta/muse-wonder",
+ "probe": "short_classifier",
+ "passed": true,
+ "latencyMs": 1223
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "meta/muse-spark-open",
+ "probe": "text",
+ "passed": true,
+ "latencyMs": 2792
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "meta/muse-spark-open",
+ "probe": "streaming",
+ "passed": true,
+ "latencyMs": 1279
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "meta/muse-spark-open",
+ "probe": "tool_round_trip",
+ "passed": true,
+ "latencyMs": 5589
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "meta/muse-spark-open",
+ "probe": "screenshot",
+ "passed": true,
+ "latencyMs": 11352
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "meta/muse-spark-open",
+ "probe": "short_classifier",
+ "passed": true,
+ "latencyMs": 863
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "google/gemini-4-argon",
+ "probe": "streaming_tool_round_trip",
+ "passed": true,
+ "latencyMs": 4981
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "meta/muse-wonder",
+ "probe": "streaming_tool_round_trip",
+ "passed": true,
+ "latencyMs": 3979
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "meta/muse-spark-open",
+ "probe": "streaming_tool_round_trip",
+ "passed": true,
+ "latencyMs": 3039
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "google/gemini-4-argon",
+ "probe": "streaming_tool_round_trip",
+ "passed": true,
+ "latencyMs": 7101
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "meta/muse-wonder",
+ "probe": "streaming_tool_round_trip",
+ "passed": true,
+ "latencyMs": 3407
+ },
+ {
+ "browser": "firefox",
+ "provider": "openrouter",
+ "model": "meta/muse-spark-open",
+ "probe": "streaming_tool_round_trip",
+ "passed": true,
+ "latencyMs": 7738
+ },
+ {
+ "browser": "chrome",
+ "provider": "openrouter",
+ "model": "meta/muse-wonder",
+ "probe": "tool_round_trip",
+ "passed": true,
+ "latencyMs": 3470
+ }
+ ],
+ "resolved_failure": {
+ "model": "meta/muse-wonder",
+ "browser": "chrome",
+ "probe": "tool_round_trip",
+ "initial_http_status": 400,
+ "cause": "Meta accepts only auto tool choice; required, none and named choices are rejected.",
+ "repair": "Use auto, narrow named choices to their offered tool, and remove tools for none.",
+ "retry_passed": true
+ },
+ "local_validation": {
+ "provider_capabilities": {
+ "passed": 132,
+ "failed": 0
+ },
+ "related_privacy_identity_build_and_stream_tests": {
+ "passed": 57,
+ "failed": 0
+ },
+ "model_limits": "passed",
+ "provider_catalog": "passed",
+ "unpacked_builds": [
+ "chrome 40.7.1",
+ "firefox 40.7.1"
+ ],
+ "broader_provider_regressions": {
+ "passed": 133,
+ "failed": 1,
+ "failure": "standalone WebGPU control uses a per-run provider without changing global selection",
+ "baseline_evidence": "The failing assertion checks src/chrome/src/background.js. That file and the assertion are unchanged; the same regex matches the background at baseline HEAD."
+ }
+ },
+ "source_sha256": {
+ "docs/providers-and-models.md": "fd90081fee049255e1d6ffd0616646fb69a147a9d109712a2703d2627b325a34",
+ "package.json": "707cb8acb17bd131deec7715d04c2fe79e1516af42eb64dee2de51e4fc25e698",
+ "src/chrome/src/agent/agent.js": "64d932980c773345633f68c6af448baa29d7a382b5b3256a392425bdd85a5370",
+ "src/chrome/src/providers/context-windows.js": "266c923744cfe2cad5bcec58babc5673a77e6a1721303c9227f194e8a0716143",
+ "src/chrome/src/providers/openai.js": "94d7821102c877a8686d1b3151b3e2ccd7c87656f4d9eb898db8737372cdeed6",
+ "src/chrome/src/providers/provider-compatibility.js": "ef6ea5011322d1dafe651a2e5c46c169d02a0a4ce707255643b1928fc40b2dec",
+ "src/chrome/src/ui/settings.js": "6a3d89ef8c9ada0314e823da8c4cfee6ad2071d0006ccfa21fe74720a6218c3d",
+ "src/firefox/src/agent/agent.js": "a04af0b0e6904d3550763bd50427fae267e0e2a476f69a11ac3f6c5eb59a53cd",
+ "src/firefox/src/providers/context-windows.js": "266c923744cfe2cad5bcec58babc5673a77e6a1721303c9227f194e8a0716143",
+ "src/firefox/src/providers/openai.js": "596730e75a70c172e9f28795cf1433b0fdc801c3bcb6ef6212ce8228c2d6922b",
+ "src/firefox/src/providers/provider-compatibility.js": "ef6ea5011322d1dafe651a2e5c46c169d02a0a4ce707255643b1928fc40b2dec",
+ "src/firefox/src/ui/settings.js": "b4981742c1f5ad2b2f229b289d8a18894284b06b8aa8468b4d8985c119db2d50",
+ "test/muse-tool-choice.mjs": "7549553bf394ea1e28c490d55a735239841f49e5bb5f8a6b2aec663587e2fd06",
+ "scripts/check-frontier-models.mjs": "db34dc5acfb573b97db192ed3daf926871184d52e2b5407ba80a5692c5b439f1",
+ "src/chrome/src/providers/openrouter-replay.js": "a5bf13f409fad2fb1d48554c89300995184bace641649b84f3aaed3db7f53709",
+ "src/firefox/src/providers/openrouter-replay.js": "a5bf13f409fad2fb1d48554c89300995184bace641649b84f3aaed3db7f53709",
+ "test/frontier-model-compatibility.mjs": "4e8a340c62c644c224e699286df97c089e2aa0ca58a80f64220af487b2007f65"
+ },
+ "review_followup": {
+ "recorded_at_utc": "2026-10-16T01:31:59.203342+00:00",
+ "issue": "Classifier disabling retained an inherited high reasoning effort.",
+ "repair": "Per-call disabling takes precedence over saved effort. Explicit per-call effort still overrides saved disabled settings when the call itself does not disable thinking.",
+ "reproduction": {
+ "failed_before_fix": 2,
+ "passed_before_fix": 0,
+ "test_name": "classifier disabling overrides inherited high reasoning"
+ },
+ "validation": {
+ "provider_capabilities": {
+ "passed": 134,
+ "failed": 0
+ },
+ "related_privacy_identity_build_and_stream_tests": {
+ "passed": 59,
+ "failed": 0
+ },
+ "model_limits": "passed",
+ "provider_catalog": "passed",
+ "unpacked_builds": [
+ "chrome 40.7.1",
+ "firefox 40.7.1"
+ ]
+ },
+ "live_inference_after_fix": false,
+ "source_sha256": {
+ "src/chrome/src/providers/provider-compatibility.js": "df6f75064ebf9053970d4bd413f66fc12faba87dffc2cca0a59e875882a9a8c6",
+ "src/firefox/src/providers/provider-compatibility.js": "df6f75064ebf9053970d4bd413f66fc12faba87dffc2cca0a59e875882a9a8c6",
+ "test/frontier-model-compatibility.mjs": "68a6526e2d1b9924e82f3e6b5c228aefe6fe30ed31833066b3527a16d35e69a6"
+ }
+ },
+ "local_proxy_validation": {
+ "route": "http://127.0.0.1:8317/v1/chat/completions",
+ "model": "gemini-4-argon-high",
+ "passed": 12,
+ "failed": 0,
+ "scope": "Live API probes through Chrome and Firefox provider implementations, with supplied tool observations and vision enabled. No installed settings changed. Recorded before the classifier review fix; this local endpoint does not use the changed mandatory reasoning normalizer.",
+ "observations": [
+ {
+ "browser": "chrome",
+ "provider": "local-openai-proxy",
+ "model": "gemini-4-argon-high",
+ "probe": "text",
+ "passed": true,
+ "latencyMs": 4265
+ },
+ {
+ "browser": "chrome",
+ "provider": "local-openai-proxy",
+ "model": "gemini-4-argon-high",
+ "probe": "streaming",
+ "passed": true,
+ "latencyMs": 3153
+ },
+ {
+ "browser": "chrome",
+ "provider": "local-openai-proxy",
+ "model": "gemini-4-argon-high",
+ "probe": "tool_round_trip",
+ "passed": true,
+ "latencyMs": 6146
+ },
+ {
+ "browser": "chrome",
+ "provider": "local-openai-proxy",
+ "model": "gemini-4-argon-high",
+ "probe": "streaming_tool_round_trip",
+ "passed": true,
+ "latencyMs": 7979
+ },
+ {
+ "browser": "chrome",
+ "provider": "local-openai-proxy",
+ "model": "gemini-4-argon-high",
+ "probe": "screenshot",
+ "passed": true,
+ "latencyMs": 3786
+ },
+ {
+ "browser": "chrome",
+ "provider": "local-openai-proxy",
+ "model": "gemini-4-argon-high",
+ "probe": "short_classifier",
+ "passed": true,
+ "latencyMs": 2907
+ },
+ {
+ "browser": "firefox",
+ "provider": "local-openai-proxy",
+ "model": "gemini-4-argon-high",
+ "probe": "text",
+ "passed": true,
+ "latencyMs": 3233
+ },
+ {
+ "browser": "firefox",
+ "provider": "local-openai-proxy",
+ "model": "gemini-4-argon-high",
+ "probe": "streaming",
+ "passed": true,
+ "latencyMs": 5038
+ },
+ {
+ "browser": "firefox",
+ "provider": "local-openai-proxy",
+ "model": "gemini-4-argon-high",
+ "probe": "tool_round_trip",
+ "passed": true,
+ "latencyMs": 5829
+ },
+ {
+ "browser": "firefox",
+ "provider": "local-openai-proxy",
+ "model": "gemini-4-argon-high",
+ "probe": "streaming_tool_round_trip",
+ "passed": true,
+ "latencyMs": 36788
+ },
+ {
+ "browser": "firefox",
+ "provider": "local-openai-proxy",
+ "model": "gemini-4-argon-high",
+ "probe": "screenshot",
+ "passed": true,
+ "latencyMs": 4625
+ },
+ {
+ "browser": "firefox",
+ "provider": "local-openai-proxy",
+ "model": "gemini-4-argon-high",
+ "probe": "short_classifier",
+ "passed": true,
+ "latencyMs": 4409
+ }
+ ]
+ }
+}
diff --git a/test/muse-tool-choice.mjs b/test/muse-tool-choice.mjs
index 9adab6513..bb1320198 100644
--- a/test/muse-tool-choice.mjs
+++ b/test/muse-tool-choice.mjs
@@ -3,7 +3,8 @@ import assert from 'node:assert/strict';
for (const browser of ['chrome', 'firefox']) {
const { OpenAICompatibleProvider } = await import(`../src/${browser}/src/providers/openai.js`);
- const config = { providerName: 'webbrain_me', baseUrl: 'https://openrouter.ai/api/v1', model: 'meta/muse-spark-1.3-contributor' };
+ for (const model of ['meta/muse-spark-1.3-contributor', 'meta/muse-wonder']) {
+ const config = { providerName: 'webbrain_me', baseUrl: 'https://openrouter.ai/api/v1', model };
const tools = ['read_page', 'done'].map(name => ({ type: 'function', function: { name, parameters: { type: 'object', properties: {} } } }));
test(`${browser}: Muse uses auto and preserves restricted tools in chat and streaming`, () => {
const provider = new OpenAICompatibleProvider(config);
@@ -59,4 +60,5 @@ for (const browser of ['chrome', 'firefox']) {
assert.equal(Object.hasOwn(regular, 'reasoning'), false);
}
});
+ }
}