Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(vision): widen the chain to every free vision route, and make depth free first
nirholas73620ae6a714
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex c9206b331..f9e036e2c 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -14,6 +14,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Control a 3D agent with your hands, no camera needed**: Your laptop already has a motion sensor: the speakers and the microphone. The new Sonar page plays a tone too high to hear, then listens for how your hand bends it on the way back, the same effect that drops the pitch of a passing siren. Sweep your hand across the keyboard and the agent on screen steps to its next gesture. Push your palm toward the screen and the camera moves in. Lift your hand and hold it, and the camera turns around the agent. Nothing is recorded and nothing leaves the page, and every gesture is on the keyboard too, so the page works with the microphone switched off. The sensing itself is two small modules you are free to point at anything, documented for developers. (`/sonar`) `[feature]`- **Generated motion clips rebuilt so they no longer slide across the floor**: The generated half of the animation library was written in the wrong rest pose and carried a constant forward drift that was never in the original motion, which made characters glide instead of plant their feet. Every published clip was re-derived from the motion already generated, re-checked against the quality gate, and republished: 39 clips that now pass are live, and the 94 that still failed on foot-sliding were withdrawn rather than left on the shelf. No new generation was needed, because the motion was correct all along and only written down wrong. (`/animations`) `[fix, improvement]`- **Repaired the free AI lanes, which had been quietly answering nothing**: Several of the free AI models the platform falls back to had been retired by their provider and were answering every request with a Gone error. Nothing logged it as a problem, because a dead model looks the same as a busy one to a fallback chain: it just moves on. The cost was real though, since each dead entry ate one of the limited retry slots that should have gone to a lane that could actually answer, making the whole chain fail sooner and more often under load. Every model id is now checked against the provider's live catalog, the dead ones are replaced with working models, and the same applies to the search-and-memory embedding lane, which had been failing for two weeks. Older stored memories keep working: they are tagged with the model that created them and still resolve. `[fix, infra]`+- **The image check behind generated models now has ten providers instead of four**: The check that inspects a generated model before you see it was leaning on a single working AI provider, because one of the two free ones was retired by its vendor and the other three were unavailable. It now draws on every free vision-capable provider we could find, including a second host serving the exact same model so one provider being busy no longer stops the check. Depth was made free first: a request used to share its time limit out among all the providers on the list, so adding providers made every one of them slower, and the first and best provider got squeezed hardest. Each request now spends its time on the two or three most likely to answer and simply has more of them to choose from as busy ones recover. `[improvement, infra]`- **The image check now moves on when a model answers in the wrong format**: Generated models are inspected by a vision model before you see them, and that inspection asks several providers in turn so one being busy is never the end of it. The catch was that a provider only had to reply, not reply usefully: a model that narrated its thinking instead of returning the requested format counted as the answer, and the healthy providers waiting behind it were never asked. A reply the check cannot read is now treated as that provider failing, so it moves straight to the next one, and it only gives up once every provider has been tried. The practical effect is that the quality check returns a real verdict far more often, and when it cannot, the reason it reports names the provider that actually lost. `[fix, improvement]`- **three.ws now reads in 47 languages**: The site has carried translated text for a long time, but the language picker only ever offered English and Spanish, so almost nobody could reach the rest. Those catalogs are being finished and checked one at a time, and the switcher now offers 47 languages. Each one is complete across every piece of text on the site, close to twenty thousand phrases, with nothing left sitting in English and nothing left half translated. A language only appears in the switcher once its translation is finished, so anything you can pick is a language the whole site speaks. Retired labels that no longer appear anywhere were cleared out at the same time, so no page shows a stale phrase in one language that it does not show in another. Right to left languages are included. `[feature, improvement]`- **Two scheduled jobs that had never once run are now running**: The daily portfolio snapshot and the 15-minute global events ingest were both declared and deployed but had no schedule attached, so neither had ever fired. Both are now scheduled and enabled. The events feed backfills a few files per tick rather than all at once, and the snapshot refuses to record a day it cannot price properly, so neither one writes a hole into history while it catches up. `[fix, infra]`diff --git a/api/_lib/vision.js b/api/_lib/vision.jsindex f611aa5b5..d43afab3e 100644--- a/api/_lib/vision.js+++ b/api/_lib/vision.js@@ -97,11 +97,40 @@ const NVIDIA_VISION_MODELS = [// model's `reasoning` object at https://openrouter.ai/api/v1/models before// assuming either works; a model with `mandatory: true` rejects 'none' with a// 400.+// Enumerated from https://openrouter.ai/api/v1/models on 2026-09-10 by filtering+// `:free` routes whose architecture.input_modalities includes "image": ten+// exist, and this list carries nine of them. The tenth,+// nvidia/nemotron-3.5-content-safety:free, is a safety classifier rather than a+// general VLM and is deliberately excluded; asking it to score a render is not+// what it does.+//+// ORDER IS A HEURISTIC, not a measurement, and it is ranked by how likely a+// route is to emit clean JSON rather than narrate:+// 1. Routes whose model record says reasoning default_enabled:false lead.+// They have nothing to switch off and nothing to narrate.+// 2. Then the dedicated vision (VL) route.+// 3. Then general routes with no declared reasoning default.+// 4. Reasoning-by-default routes go last, each carrying reasoning.effort:none+// (see the note above about the host-specific parameter). nemotron-omni+// sits at the back of that group because it is the one caught returning an+// empty message.content in production.+// Replace this ordering with measured latency and JSON-success rates by running+// `node scripts/probe-vision-lanes.mjs`, which sends the real rubric payload to+// every route and ranks them.const OPENROUTER_VISION_MODELS = [- { model: 'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free', extraBody: { reasoning: { effort: 'none' } } },{ model: 'google/gemma-4-31b-it:free' },{ model: 'google/gemma-4-26b-a4b-it:free' },+ { model: 'inclusionai/ling-3.0-flash-vl:free', extraBody: { reasoning: { effort: 'none' } } },+ { model: 'dots-studio/dots-3-note-preview:free' },+ { model: 'nex-agi/nex-n2.5-pro:free' },+ { model: 'nex-agi/nex-n2.5-mini:free' },+ { model: 'thinkingmachines/inkling-small:free', extraBody: { reasoning: { effort: 'none' } } },+ { model: 'thinkingmachines/inkling:free', extraBody: { reasoning: { effort: 'none' } } },+ { model: 'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free', extraBody: { reasoning: { effort: 'none' } } },];+// Cloudflare Workers AI's vision route. Same weights as the NIM lane above, so+// it is a capacity and quota hedge rather than a new capability.+const CLOUDFLARE_VISION_MODEL = '@cf/meta/llama-3.2-11b-vision-instruct';// Paid last-resort tail. gpt-5.4-nano is vision-capable and already priced in// llm-pricing.js, keeping the backstop cheap and the spend ledger truthful.const OPENAI_VISION_MODEL = 'gpt-5.4-nano';@@ -135,6 +164,9 @@ const VISION_LANE_COOLDOWN_SECONDS = 45;// Below this a lane cannot complete a VLM call, so handing it a smaller slice// only burns budget the next rung could have used.const MIN_LANE_ATTEMPT_MS = 3_500;+// How many rungs behind the current one the budget is held open for. Two means+// a request plans for three attempts: a generous one and two fallbacks.+const MAX_RESERVED_LANES = 2;// Share of the remaining deadline the image inline fetch may take. It runs// BEFORE any lane, so an uncapped one starves the whole chain: at the measured// 20s timeout against a 24s deadline it left 4s for every provider combined.@@ -196,7 +228,17 @@ export function laneAttemptTimeout(remainingMs, lanesLeft, timeoutMs) {// budget nobody else needs yet. A lane that fails fast hands its unused// share straight to the next one, because `remainingMs` is re-read per// attempt.- const reserve = MIN_LANE_ATTEMPT_MS * Math.max(0, lanesLeft - 1);+ // Reserve for the next few rungs, NOT for all of them. Reserving per remaining+ // lane makes the chain punish its own depth a second way: at twelve rungs the+ // reserve (3.5s x 11) exceeds the whole 29s deadline, so the first and best+ // lane collapses back to the floor and we are back to the starvation this+ // formula was written to end. A request cannot realistically walk twelve+ // providers anyway; it should spend its budget on the two or three most+ // likely to answer. Capping the reserve decouples the DEPTH of the chain+ // (how many providers exist, which is pure upside as cooldowns rotate+ // across requests) from the SPEND of one request (bounded, and weighted+ // toward the lane in hand).+ const reserve = MIN_LANE_ATTEMPT_MS * Math.min(Math.max(0, lanesLeft - 1), MAX_RESERVED_LANES);const share = Math.max(MIN_LANE_ATTEMPT_MS, remainingMs - reserve);// The floor may exceed the share when the budget is nearly spent; capping it// by what is actually left keeps the attempt inside the deadline either way.@@ -290,6 +332,21 @@ export function visionChain() {}));}}+ // Cloudflare Workers AI: the SAME llama-3.2-11b-vision weights the free NIM+ // lane already answers with, served on a different host behind a different+ // quota. That is the point of it. Until now one NVIDIA model carried the+ // entire chain (the list lost nemotron-nano-12b-v2-vl to a hard 410 on+ // 2026-08-26), so a single throttle took vision down platform-wide. This rung+ // is a proven model, not a new bet. The vendor is already wired for text in+ // llm.js and gated on the same pair of vars, so it costs no new credential.+ if (env.CLOUDFLARE_ACCOUNT_ID && env.CLOUDFLARE_AI_API_TOKEN) {+ chain.push(openaiCompatVisionProvider({+ name: 'cloudflare',+ key: env.CLOUDFLARE_AI_API_TOKEN,+ url: `https://api.cloudflare.com/client/v4/accounts/${env.CLOUDFLARE_ACCOUNT_ID}/ai/v1/chat/completions`,+ model: CLOUDFLARE_VISION_MODEL,+ }));+ }// Vertex Gemini credits anchor: multimodal (Gemini Flash reads image_url// parts, data URIs included, through the same OpenAI-compatible endpoint),// keyless (OAuth token minted per request), billed to GCP credits. Sitsdiff --git a/data/changelog.json b/data/changelog.jsonindex e2fe33afb..26ec41d6e 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -28098,6 +28098,15 @@"fix","improvement"]+ },+ {+ "date": "2026-09-10",+ "title": "The image check behind generated models now has ten providers instead of four",+ "summary": "The check that inspects a generated model before you see it was leaning on a single working AI provider, because one of the two free ones was retired by its vendor and the other three were unavailable. It now draws on every free vision-capable provider we could find, including a second host serving the exact same model so one provider being busy no longer stops the check. Depth was made free first: a request used to share its time limit out among all the providers on the list, so adding providers made every one of them slower, and the first and best provider got squeezed hardest. Each request now spends its time on the two or three most likely to answer and simply has more of them to choose from as busy ones recover.",+ "tags": [+ "improvement",+ "infra"+ ]}]}diff --git a/public/changelog-recent.json b/public/changelog-recent.jsonindex 7a0ebe32c..e8fb2ba55 100644--- a/public/changelog-recent.json+++ b/public/changelog-recent.json@@ -1,11 +1,11 @@{- "generated_at": "2026-09-10T20:30:13.068Z",+ "generated_at": "2026-09-10T20:40:54.003Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},- "total": 3668,+ "total": 3669,"complete": false,"full_feed": "/changelog.json","entries": [@@ -94,6 +94,17 @@"infra"]},+ {+ "date": "2026-09-10",+ "type": "update",+ "title": "The image check behind generated models now has ten providers instead of four",+ "summary": "The check that inspects a generated model before you see it was leaning on a single working AI provider, because one of the two free ones was retired by its vendor and the other three were unavailable. It now draws on every free vision-capable provider we could find, including a second host serving the exact same model so one provider being busy no longer stops the check. Depth was made free first: a request used to share its time limit out among all the providers on the list, so adding providers made every one of them slower, and the first and best provider got squeezed hardest. Each request now spends its time on the two or three most likely to answer and simply has more of them to choose from as busy ones recover.",+ "link": null,+ "tags": [+ "improvement",+ "infra"+ ]+ },{"date": "2026-09-10","type": "update",@@ -1606,17 +1617,6 @@"tags": ["fix"]- },- {- "date": "2026-09-07",- "type": "update",- "title": "The Blender tools now show you the render instead of describing it",- "summary": "Asking an assistant to render a 3D model used to hand back a file path, which is useless if the assistant cannot open files on your disk. The rendered image now comes back with the answer, scaled to fit, while the full-resolution PNG still lands on disk. That turns a look at this model into one step, so an assistant can render, spot the problem, fix it and render again. Reading a file also reports its texture budget now: every image with its resolution and byte size, plus the total, which is usually what actually decides whether a model is small enough to ship, and it was previously reported as nothing more than a count. Two reliability fixes came out of real use: several requests at once now queue instead of all starting Blender at the same moment and exhausting the machine, and when Blender is installed but momentarily will not start you get a message saying exactly that, with the details, rather than being told to install software you already have.",- "link": null,- "tags": [- "improvement",- "feature"- ]}]}diff --git a/public/changelog.json b/public/changelog.jsonindex 6f3917fd3..b13558bd9 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-09-10T20:30:13.046Z",+ "generated_at": "2026-09-10T20:40:53.981Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -91,6 +91,17 @@"infra"]},+ {+ "date": "2026-09-10",+ "type": "update",+ "title": "The image check behind generated models now has ten providers instead of four",+ "summary": "The check that inspects a generated model before you see it was leaning on a single working AI provider, because one of the two free ones was retired by its vendor and the other three were unavailable. It now draws on every free vision-capable provider we could find, including a second host serving the exact same model so one provider being busy no longer stops the check. Depth was made free first: a request used to share its time limit out among all the providers on the list, so adding providers made every one of them slower, and the first and best provider got squeezed hardest. Each request now spends its time on the two or three most likely to answer and simply has more of them to choose from as busy ones recover.",+ "link": null,+ "tags": [+ "improvement",+ "infra"+ ]+ },{"date": "2026-09-10","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 9762dfe6c..fe03abf5f 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -70,6 +70,14 @@<category>fix</category><description>Several of the free AI models the platform falls back to had been retired by their provider and were answering every request with a Gone error. Nothing logged it as a problem, because a dead model looks the same as a busy one to a fallback chain: it just moves on. The cost was real though, since each dead entry ate one of the limited retry slots that should have gone to a lane that could actually answer, making the whole chain fail sooner and more often under load. Every model id is now checked against the provider's live catalog, the dead ones are replaced with working models, and the same applies to the search-and-memory embedding lane, which had been failing for two weeks. Older stored memories keep working: they are tagged with the model that created them and still resolve.</description></item>+ <item>+ <title>The image check behind generated models now has ten providers instead of four</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-09-10:The image check behind generated models now has ten providers instead of four</guid>+ <pubDate>Thu, 10 Sep 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>The check that inspects a generated model before you see it was leaning on a single working AI provider, because one of the two free ones was retired by its vendor and the other three were unavailable. It now draws on every free vision-capable provider we could find, including a second host serving the exact same model so one provider being busy no longer stops the check. Depth was made free first: a request used to share its time limit out among all the providers on the list, so adding providers made every one of them slower, and the first and best provider got squeezed hardest. Each request now spends its time on the two or three most likely to answer and simply has more of them to choose from as busy ones recover.</description>+ </item><item><title>The image check now moves on when a model answers in the wrong format</title><link>https://three.ws/changelog</link>diff --git a/public/features.json b/public/features.jsonindex 4f095bd40..d873ead11 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-09-10T20:30:13.034Z",+ "generated_at": "2026-09-10T20:40:53.969Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/scripts/probe-vision-lanes.mjs b/scripts/probe-vision-lanes.mjsnew file mode 100644index 000000000..b1be5137d--- /dev/null+++ b/scripts/probe-vision-lanes.mjs@@ -0,0 +1,153 @@+#!/usr/bin/env node+// Probe every free vision route with the payload the pipeline actually sends,+// and rank them by whether they return parseable JSON and how fast.+//+// Why this exists: the vision chain's lane order was a guess, and a guess is how+// a rung that answers HTTP 200 with an empty message.content sat at the front of+// the chain eating a slice of every request's deadline. A model list is only as+// good as the payload it was checked against, so this sends the real thing: an+// image plus a scoring rubric that demands a JSON object back.+//+// node scripts/probe-vision-lanes.mjs # OpenRouter free routes+// node scripts/probe-vision-lanes.mjs --all # also re-probe configured lanes+// node scripts/probe-vision-lanes.mjs --image <url>+//+// Needs OPENROUTER_API_KEY. On a machine without it:+// OPENROUTER_API_KEY=$(node scripts/read-service-env.mjs '^OPENROUTER_API_KEY$' --raw) \+// node scripts/probe-vision-lanes.mjs+//+// Output is a table ordered best-first. Feed that order straight back into+// OPENROUTER_VISION_MODELS in api/_lib/vision.js.++import { parseArgs } from 'node:util';++const MODELS_URL = 'https://openrouter.ai/api/v1/models';+const CHAT_URL = 'https://openrouter.ai/api/v1/chat/completions';+const DEFAULT_IMAGE = 'https://three.ws/partners/openai/social-card-studio.png';+const PER_LANE_TIMEOUT_MS = 30_000;++// The shape api/_lib/forge-quality-gate.js asks for. Anything that cannot answer+// this cannot serve the quality gate, whatever it scores on a toy prompt.+const RUBRIC = [+ 'You are scoring a render of a generated 3D asset.',+ 'Judge realism, completeness, and visible defects.',+ 'Reply with ONLY a JSON object, no prose and no code fence:',+ '{"score":<0-100>,"realism":<0-100>,"completeness":<0-100>,"defects":[<strings>],"reason":"<one sentence>"}',+].join(' ');++const { values } = parseArgs({+ options: {+ image: { type: 'string', default: DEFAULT_IMAGE },+ all: { type: 'boolean', default: false },+ json: { type: 'boolean', default: false },+ },+ strict: false,+});++const key = process.env.OPENROUTER_API_KEY;+if (!key) {+ console.error('OPENROUTER_API_KEY is not set. See the header of this file for how to resolve it.');+ process.exit(2);+}++/** Same tolerance the runtime applies, so a pass here means a pass there. */+function parseJsonLoose(text) {+ const trimmed = String(text || '').trim();+ const fenced = trimmed.replace(/^```(?:json)?\s*/i, '').replace(/\s*```$/, '');+ const start = fenced.search(/[[{]/);+ const candidate = start >= 0 ? fenced.slice(start) : fenced;+ try {+ return JSON.parse(candidate);+ } catch {+ const m = candidate.match(/[{[][\s\S]*[}\]]/);+ if (m) return JSON.parse(m[0]);+ throw new Error('not valid JSON');+ }+}++async function freeVisionRoutes() {+ const res = await fetch(MODELS_URL, { signal: AbortSignal.timeout(30_000) });+ if (!res.ok) throw new Error(`models list ${res.status}`);+ const { data } = await res.json();+ return data+ .filter((m) => m.id.endsWith(':free'))+ .filter((m) => (m.architecture?.input_modalities || []).includes('image'))+ .map((m) => ({ id: m.id, reasoning: m.reasoning || {} }));+}++async function probe(route, imageUrl) {+ const body = {+ model: route.id,+ max_tokens: 1536,+ temperature: 0,+ messages: [+ {+ role: 'user',+ content: [+ { type: 'text', text: RUBRIC },+ { type: 'image_url', image_url: { url: imageUrl } },+ ],+ },+ ],+ };+ // A model that reasons by default will spend the budget narrating unless it+ // is told not to, and its record says whether it accepts being told.+ if (route.reasoning?.default_enabled && route.reasoning?.mandatory === false) {+ body.reasoning = { effort: 'none' };+ }+ const startedAt = Date.now();+ try {+ const res = await fetch(CHAT_URL, {+ method: 'POST',+ headers: { 'content-type': 'application/json', authorization: `Bearer ${key}` },+ body: JSON.stringify(body),+ signal: AbortSignal.timeout(PER_LANE_TIMEOUT_MS),+ });+ const ms = Date.now() - startedAt;+ if (!res.ok) {+ const detail = (await res.text().catch(() => '')).slice(0, 90).replace(/\s+/g, ' ');+ return { ...route, ok: false, ms, verdict: `http ${res.status}`, detail };+ }+ const data = await res.json();+ const text = (data.choices?.[0]?.message?.content || '').trim();+ if (!text) return { ...route, ok: false, ms, verdict: 'empty content', detail: 'reasoned instead of answering' };+ try {+ const json = parseJsonLoose(text);+ const scored = typeof json.score === 'number';+ return { ...route, ok: scored, ms, verdict: scored ? 'json ok' : 'json without score', detail: text.slice(0, 60).replace(/\s+/g, ' ') };+ } catch {+ return { ...route, ok: false, ms, verdict: 'unparseable', detail: text.slice(0, 60).replace(/\s+/g, ' ') };+ }+ } catch (e) {+ return { ...route, ok: false, ms: Date.now() - startedAt, verdict: 'unreachable', detail: String(e.message).slice(0, 60) };+ }+}++const routes = await freeVisionRoutes();+console.error(`probing ${routes.length} free vision route(s) against ${values.image}\n`);++const results = [];+for (const route of routes) {+ const r = await probe(route, values.image);+ results.push(r);+ console.error(` ${r.ok ? 'PASS' : 'fail'} ${String(r.ms).padStart(6)}ms ${r.id} ${r.verdict}`);+}++results.sort((a, b) => (a.ok === b.ok ? a.ms - b.ms : a.ok ? -1 : 1));++if (values.json) {+ console.log(JSON.stringify(results, null, 2));+} else {+ console.log('\nRanked best-first. Paste the passing ids into OPENROUTER_VISION_MODELS:\n');+ for (const r of results) {+ const think = r.reasoning?.default_enabled && r.reasoning?.mandatory === false+ ? ", extraBody: { reasoning: { effort: 'none' } }"+ : '';+ const mark = r.ok ? ' ' : '// ';+ console.log(`\t${mark}{ model: '${r.id}'${think} }, // ${r.ms}ms ${r.verdict}`);+ }+}++const passed = results.filter((r) => r.ok).length;+console.error(`\n${passed}/${results.length} route(s) returned a usable score.`);+process.exit(passed > 0 ? 0 : 1);diff --git a/tests/api/vision-lane-health.test.js b/tests/api/vision-lane-health.test.jsindex e09d27509..a1470673f 100644--- a/tests/api/vision-lane-health.test.js+++ b/tests/api/vision-lane-health.test.js@@ -77,6 +77,19 @@ describe('laneAttemptTimeout', () => {expect(remaining).toBe(0);for (const ms of slices) expect(ms).toBeGreaterThanOrEqual(3_500);});+ it('bounds one request to a few attempts however deep the chain is', () => {+ // Twelve rungs is depth for the chain, not spend for the request: the+ // budget still buys a generous first attempt plus the reserved fallbacks,+ // and then the deadline stops the walk honestly.+ let remaining = 29_000;+ let attempts = 0;+ for (let lanesLeft = 12; lanesLeft > 0 && remaining > 0; lanesLeft--) {+ remaining -= laneAttemptTimeout(remaining, lanesLeft, 25_000);+ attempts++;+ }+ expect(attempts).toBeLessThanOrEqual(4);+ expect(remaining).toBe(0);+ });it('does not shrink the first lane as the chain grows', () => {// The regression that took the forge quality gate to 0 verdicts in 10.// Its deadline is 29s and the chain went from 3 lanes to 6 when the@@ -84,10 +97,13 @@ describe('laneAttemptTimeout', () => {// fell from ~9.7s to ~4.8s, just under what the scoring rubric needs.const sixLanes = laneAttemptTimeout(29_000, 6, 25_000);const equalDivision = Math.floor(29_000 / 6); // 4_833, the old policy- expect(sixLanes).toBe(11_500);- expect(sixLanes).toBeGreaterThan(equalDivision * 2);- // Deep chains still leave the first lane more than a single VLM call needs.- expect(laneAttemptTimeout(29_000, 8, 25_000)).toBeGreaterThan(4_000);+ expect(sixLanes).toBe(22_000);+ expect(sixLanes).toBeGreaterThan(equalDivision * 4);+ // The reserve is capped, so DEPTH no longer costs the first lane anything.+ // Three rungs or twelve, the lane in hand gets the same generous slice;+ // otherwise adding providers would quietly re-create the starvation.+ expect(laneAttemptTimeout(29_000, 3, 25_000)).toBe(22_000);+ expect(laneAttemptTimeout(29_000, 12, 25_000)).toBe(22_000);});it('never exceeds the caller timeout and never outlives the deadline', () => {expect(laneAttemptTimeout(60_000, 1, 20_000)).toBe(20_000);diff --git a/tests/vision-json-lane-failover.test.js b/tests/vision-json-lane-failover.test.jsindex c3f9e92f2..d3ac6e8ce 100644--- a/tests/vision-json-lane-failover.test.js+++ b/tests/vision-json-lane-failover.test.js@@ -114,22 +114,22 @@ describe('reasoning lanes are told not to think', () => {// true and mandatory: false, so it reasons unless told otherwise and it// accepts being told. Left on, the thinking eats the lane's slice of the// deadline and message.content comes back empty (observed live).- // Fail the first rung so the walk actually reaches the OpenRouter lanes;- // asserting on a chain that stopped at lane 1 would pass vacuously.- fetchSpy- .mockResolvedValueOnce(reply('not json'))- .mockResolvedValue(reply(JSON.stringify(VERDICT)));- await call();+ // Fail every rung so the walk covers the whole chain; asserting on a chain+ // that stopped at its first lane would pass vacuously.+ fetchSpy.mockResolvedValue(reply('not json'));+ await expect(call()).rejects.toThrow();const bodies = fetchSpy.mock.calls.map(([, init]) => JSON.parse(init.body));- const nim = bodies.find((b) => String(b.model).includes('llama-3.2'));- const nemotron = bodies.find((b) => String(b.model).includes('nemotron'));-expect(bodies.length).toBeGreaterThan(1);- expect(nemotron).toBeDefined();- // Only the reasoning route carries it. The parameter is host-specific, so- // putting it on NVIDIA's own lane would be a silent no-op there.- expect(nemotron.reasoning).toEqual({ effort: 'none' });++ // Whatever carries the parameter must carry the value that disables it.+ const reasoningLanes = bodies.filter((b) => b.reasoning !== undefined);+ expect(reasoningLanes.length).toBeGreaterThan(0);+ for (const b of reasoningLanes) expect(b.reasoning).toEqual({ effort: 'none' });++ // The parameter is host-specific: on NVIDIA's own lane it is a no-op, so+ // it must not be sent there and imply a protection that is not real.+ const nim = bodies.find((b) => String(b.model).includes('llama-3.2') && !String(b.model).startsWith('@cf/'));expect(nim).toBeDefined();expect(nim.reasoning).toBeUndefined();});