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
fix(forge): let a failed photo job fall through to TripoSG instead of dead-ending
nirholas82c4b040a67c
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex c7c8cbcc3..004ca54c3 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,6 +7,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr## 2026-09-30- **59 more pages now read in your language**: Pick any of the 85 languages in the language menu and 59 more pages now follow it, including the Airdrop Checker, Portfolio, Drops, Crews, Launch, the Agent Monitor and the rig and embed doctors. Titles, buttons, form labels, hints, error messages and the text shown when a page is shared all translate. Live numbers and statuses on those pages (counters, balances, scan results, play and pause buttons) keep updating in every language: the translation step now recognises a value the page has already filled in and leaves it alone, instead of putting a placeholder like "Loading" back over it. (`/airdrops`) `[improvement, fix]`+- **Photo to 3D keeps going when its main engines go down**: When a photo-to-3D job fails partway through, it already moves to the next engine on its own. Until now that only worked while another textured engine was up, so when the two main engines failed together last week, photo generations stopped completely. There is now one more rung: our own TripoSG engine takes over the job and delivers the shape of your model without textures, and the progress screen tells you when that happens. You get a model you can work with instead of an error, and whenever a textured engine is up, it is still used first. (`/image-to-3d`) `[fix, improvement]`## 2026-09-29diff --git a/api/_lib/forge-failover.js b/api/_lib/forge-failover.jsindex a39a96e2d..5e6d1b82a 100644--- a/api/_lib/forge-failover.js+++ b/api/_lib/forge-failover.js@@ -21,8 +21,8 @@// of a bare error string.//// Ordering policy mirrors forge-tiers.js exactly: our own GPU workers first-// (zero vendor cost), then free external lanes, then the paid platform default-// last. HuggingFace Spaces cannot be auto-redispatched from a poll (its+// (zero vendor cost), then free external lanes, then the paid platform default,+// then the geometry-only TripoSG lane as the final rung. HuggingFace Spaces cannot be auto-redispatched from a poll (its// provider blocks through the whole generation), so it appears only in the// retry_backends suggestions, where the client's fresh POST can ride it.//@@ -45,13 +45,22 @@ const TTL_S = 2 * 3600;export const MAX_FAILOVER_HOPS = 3;// Lanes that can be re-dispatched FROM A POLL: async submit/status providers-// only, ordered self-host free → paid last resort. HuggingFace is excluded-// (blocking submit — see module header); NVIDIA is excluded (text-only, and a-// poll-time redispatch always reconstructs from a stored reference image).-const ASYNC_REDISPATCH_ORDER = ['trellis_selfhost', 'hunyuan3d', 'trellis'];+// only, ordered self-host free → paid → geometry-only last resort. HuggingFace+// is excluded (blocking submit, see module header); NVIDIA is excluded+// (text-only, and a poll-time redispatch always reconstructs from a stored+// reference image).+//+// TripoSG closes the chain. It returns an untextured mesh, so it only runs+// once every textured lane has failed or is marked down. Without it the+// 2026-09-18..28 worker outage, which took Hunyuan3D and TRELLIS self-host+// down together, ended roughly 400 photo jobs a day in a hard failure while+// the TripoSG worker sat healthy.+const ASYNC_REDISPATCH_ORDER = ['trellis_selfhost', 'hunyuan3d', 'trellis', 'triposg'];// Lanes a CLIENT can retry with a fresh POST, per input mode. A fresh POST may// ride blocking lanes too, so HuggingFace joins here; NVIDIA only serves text.+// TripoSG is absent: its public lane is sketch-only, so a fresh photo POST+// naming it would be refused. It serves photos only as the poll-time rung.const SUGGESTION_ORDER_IMAGE = ['trellis_selfhost', 'hunyuan3d', 'huggingface', 'trellis'];const SUGGESTION_ORDER_TEXT = ['nvidia', 'trellis_selfhost', 'hunyuan3d', 'huggingface', 'trellis'];@@ -181,6 +190,18 @@ export async function submitFailoverJob({ backend, imageUrl, prompt, tierId, patreturn { extJobId: job.extJobId, handle: encodeJobToken({ provider: 'gcp', kind: null, taskId: job.extJobId }) };}+ if (backend === 'triposg') {+ const { createRegenProvider } = await import('../_providers/gcp.js');+ // The photo pipeline (gcp provider mode 'triposg'), not the scribble one:+ // the stored input is a reference photo and it takes no text prompt.+ const job = await createRegenProvider().submit({+ mode: 'triposg',+ sourceUrl: imageUrl,+ params: { target_polycount: tier.polycount },+ });+ return { extJobId: job.extJobId, handle: encodeJobToken({ provider: 'gcp', kind: null, taskId: job.extJobId }) };+ }+if (backend === 'trellis') {const { createRegenProvider } = await import('../_providers/replicate.js');const job = await createRegenProvider().submit({diff --git a/api/_providers/gcp.js b/api/_providers/gcp.jsindex b6628acf8..8c86b2628 100644--- a/api/_providers/gcp.js+++ b/api/_providers/gcp.js@@ -86,6 +86,9 @@ function serviceUrlForMode(mode) {case 'segment':return readEnv('GCP_SEGMENT_URL');case 'sketch':+ case 'triposg':+ // One TripoSG worker (workers/model-triposg) serves both: `sketch` is its+ // scribble pipeline, `triposg` its photo pipeline.return readEnv('GCP_TRIPOSG_URL');case 'trellis':// Self-hosted Microsoft TRELLIS image→3D worker (workers/model-trellis):@@ -319,6 +322,21 @@ function buildWorkerRequest(request) {};}+ if (mode === 'triposg') {+ // Photo→3D on the TripoSG worker's image pipeline (in-process background+ // removal, 50-step sampler). Geometry only, no textures, so forge uses it+ // as the last image lane, behind every lane that returns a textured GLB.+ const body = { images: [sourceUrl], mode: 'image' };+ if (Number.isFinite(Number(params?.target_polycount))) {+ body.target_polycount = Math.round(Number(params.target_polycount));+ }+ return {+ path: '/infer',+ resultKey: 'result_gcs_url',+ body,+ };+ }+if (mode === 'video2scene') {// Streaming video → 3D point cloud (workers/model-video2scene, LingBot-Map).// The source is a public video URL; an `images` array of frames is the@@ -408,6 +426,8 @@ const MODE_ETA = {rembg: 5,segment: 45,sketch: 45,+ // The photo pipeline runs 50 sampler steps against scribble's 16.+ triposg: 60,text2motion: 30,rerig: 45,video2scene: 240,diff --git a/data/changelog.json b/data/changelog.jsonindex 22756f2d1..a3806e421 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -28845,6 +28845,16 @@"fix"],"link": "/airdrops"+ },+ {+ "date": "2026-09-30",+ "title": "Photo to 3D keeps going when its main engines go down",+ "summary": "When a photo-to-3D job fails partway through, it already moves to the next engine on its own. Until now that only worked while another textured engine was up, so when the two main engines failed together last week, photo generations stopped completely. There is now one more rung: our own TripoSG engine takes over the job and delivers the shape of your model without textures, and the progress screen tells you when that happens. You get a model you can work with instead of an error, and whenever a textured engine is up, it is still used first.",+ "tags": [+ "fix",+ "improvement"+ ],+ "link": "/image-to-3d"}]}diff --git a/docs/forge-pipeline.md b/docs/forge-pipeline.mdindex 95f1ed04d..87f05f203 100644--- a/docs/forge-pipeline.md+++ b/docs/forge-pipeline.md@@ -147,7 +147,7 @@ Async jobs get an opaque HMAC-signed token (`f1.<payload>.<sig>`, `api/_lib/forgEvery non-terminal poll also carries honest timing: `elapsed_seconds` (the age of the *job*, from `created_at`, not of the tab watching it), `eta_seconds` (the lane's typical total) and `eta_remaining_seconds`. The remaining figure is floored at 5, because the estimate is a typical duration rather than a deadline and a countdown that goes negative reads as "stuck" on a job that is merely slower than average. A `queued` poll on a scale-to-zero self-host lane additionally carries `cold_start` and `cold_start_seconds` (that lane's spin-up budget). `laneColdStart()` is module-scope for exactly this reason: it used to be a closure inside the submit handler, so only the submit response could say a worker was booting, and a client that never saw it (a coalesced job, a page resumed after a reload, a failover successor) was told "queued" with no explanation for a wait that is a container boot rather than a stall. `forgeStageNarration()` and `coldStartState()` in [src/shared/forge-frames.js](../src/shared/forge-frames.js) turn those fields into the same copy on every surface, off the payload and never off a local clock, and the flag clears on the first real `running` poll rather than on a timer. The in-flight job id is also written to `localStorage`, so an interrupted browser session resumes polling for up to 30 minutes; background completion persists the result to the user's gallery either way (see [Background generation](./forge-background-generation.md)).-**Poll-time failover** (`api/_lib/forge-failover.js`) closes the nastier gap: a self-host worker can accept a task and fail it minutes later, in a poll handled by a different instance that no longer holds the request. On a failed poll the module recovers the original inputs (prompt plus reference image) from the creation row, resubmits to the next configured lane, and binds old handle to new handle in Redis (2 hour TTL). The client keeps polling the same job id and simply sees `status: running` with a new `backend`. Hops are capped by `MAX_FAILOVER_HOPS = 3` (one primary plus up to three backups). The redispatch order is `trellis_selfhost`, `hunyuan3d`, `trellis`: HuggingFace is excluded because its provider blocks through the whole generation (cannot be ridden from a poll), and NVIDIA is excluded because poll-time redispatch always reconstructs from a stored reference image, which NIM rejects. Both failover paths (this attended one and the unattended finalizer sweep) link the failed attempt to its successor row (`forge_creations.superseded_by`, migration `20260814200000_forge_failover_supersede.sql`), so the outcome ledger, the forge health sensor and `npm run forge:errors` count a recovered attempt as a recovery, not a loss.+**Poll-time failover** (`api/_lib/forge-failover.js`) closes the nastier gap: a self-host worker can accept a task and fail it minutes later, in a poll handled by a different instance that no longer holds the request. On a failed poll the module recovers the original inputs (prompt plus reference image) from the creation row, resubmits to the next configured lane, and binds old handle to new handle in Redis (2 hour TTL). The client keeps polling the same job id and simply sees `status: running` with a new `backend`. Hops are capped by `MAX_FAILOVER_HOPS = 3` (one primary plus up to three backups). The redispatch order is `trellis_selfhost`, `hunyuan3d`, `trellis`, then `triposg` as the final rung. TripoSG runs its photo pipeline (gcp provider mode `triposg`) and returns untextured geometry, so it only serves a job once every textured lane has failed or is marked down; the client's lane note says the result will have no textures. It was added after the 2026-09-18 to 09-28 outage, when Hunyuan3D and TRELLIS self-host failed together, Replicate was unconfigured, and roughly 400 photo jobs a day ended in a hard failure while the TripoSG worker was healthy. TripoSG stays out of the `retry_backends` suggestions because its public lane is sketch-only. HuggingFace is excluded because its provider blocks through the whole generation (cannot be ridden from a poll), and NVIDIA is excluded because poll-time redispatch always reconstructs from a stored reference image, which NIM rejects. Both failover paths (this attended one and the unattended finalizer sweep) link the failed attempt to its successor row (`forge_creations.superseded_by`, migration `20260814200000_forge_failover_supersede.sql`), so the outcome ledger, the forge health sensor and `npm run forge:errors` count a recovered attempt as a recovery, not a loss.**Designed terminal failure.** When no successor is possible, the failed response carries `retryable: true` plus `retry_backends: [...]`, the ordered configured lanes a client can one-click resubmit to. A failure is never a bare string. The whole module is fail-open: no Redis disables automatic redispatch but keeps suggestions; no DB disables recovery but never turns a clean failure into a hang.diff --git a/docs/forge.md b/docs/forge.mdindex 93c2e90e8..493e3e80f 100644--- a/docs/forge.md+++ b/docs/forge.md@@ -35,7 +35,7 @@ Each backend declares which paths it serves, whether it needs a bring-your-own-k- **TRELLIS (free)** on NVIDIA NIM (Microsoft TRELLIS). Zero vendor cost, and the last free lane in the chain: it serves a text prompt when every self-host worker and Space is cold or down. Text-only, so it rejects user photos and photo submissions route elsewhere.- **Hunyuan3D / TRELLIS (free)** on Hugging Face Spaces. The free photo-to-3D lane and a High-tier engine, with automatic failover across Hunyuan3D 2.1, Hunyuan3D 2, TRELLIS, and TripoSR. Queue waits vary.- **TRELLIS (self-host)** and **Hunyuan3D (self-host)**, our own scale-to-zero Cloud Run GPU workers, and the named defaults: TRELLIS at Draft and Standard, Hunyuan3D at High. Zero vendor cost, so free-first routing prefers them first. Self-host TRELLIS is a native single-hop image-to-3D lane; Hunyuan3D leads on people and organic subjects.-- **TripoSG (self-host)**, the sketch-only scribble worker. Untextured geometry from a drawing.+- **TripoSG (self-host)**, the sketch-only scribble worker. Untextured geometry from a drawing. It also serves photos as the last automatic failover rung: when every textured photo lane has failed mid-job, the job continues on TripoSG's photo pipeline and returns the shape without textures rather than failing.- **TRELLIS** on Replicate, a paid platform lane. Selectable explicitly and used as the last-resort fallback only on deployments with no free engine configured.- **Meshy 6**, **Tripo v3.1**, **Rodin (Hyper3D)**, BYOK geometry-first engines with quad topology and a real poly target. You supply your own key.- **Stable Fast 3D** (Stability, BYOK) and **Replicate (your account)** (BYOK), single-image reconstruction lanes.diff --git a/docs/image-to-3d.md b/docs/image-to-3d.mdindex 696c02f0a..7a8e2da98 100644--- a/docs/image-to-3d.md+++ b/docs/image-to-3d.md@@ -20,6 +20,8 @@ Routing is free-first and health-aware, exactly as in Forge. Because the free NV2. **Hunyuan3D (self-host)**, our own high-poly reconstruction worker, strong on people and organic subjects.3. **Hunyuan3D / TRELLIS (free)** on Hugging Face Spaces, with automatic failover across Hunyuan3D 2.1, Hunyuan3D 2, TRELLIS, and TripoSR.+If a self-host worker accepts your job and then fails it, the job moves to the next lane on its own and you keep watching the same progress screen. The last rung is **TripoSG (self-host)**: it only takes over when every textured lane is down, and it returns the shape without textures (the progress screen tells you when that happens), so an outage costs you color rather than the whole model.+Paid and BYOK image engines stay explicitly selectable: **Meshy 6**, **Tripo v3.1**, **Rodin (Hyper3D)**, **Stable Fast 3D** (Stability), the **Replicate** TRELLIS lane, and your own Replicate account. A lane whose upstream is down is disabled in the engine picker with the real reason, and a selected engine that can't accept photos bounces to the standing photo default rather than failing after you commit.The result is a job: the client polls `GET /api/forge?job=<id>` until the GLB lands, and an interrupted generation resumes from the same browser for 30 minutes. Every result reports the path, tier, and backend that produced it.diff --git a/public/changelog-recent.json b/public/changelog-recent.jsonindex 8d0af9960..3331dffeb 100644--- a/public/changelog-recent.json+++ b/public/changelog-recent.json@@ -1,11 +1,11 @@{- "generated_at": "2026-09-30T01:34:01.307Z",+ "generated_at": "2026-09-30T05:14:02.749Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},- "total": 3781,+ "total": 3782,"complete": false,"full_feed": "/changelog.json","entries": [@@ -20,6 +20,17 @@"fix"]},+ {+ "date": "2026-09-30",+ "type": "update",+ "title": "Photo to 3D keeps going when its main engines go down",+ "summary": "When a photo-to-3D job fails partway through, it already moves to the next engine on its own. Until now that only worked while another textured engine was up, so when the two main engines failed together last week, photo generations stopped completely. There is now one more rung: our own TripoSG engine takes over the job and delivers the shape of your model without textures, and the progress screen tells you when that happens. You get a model you can work with instead of an error, and whenever a textured engine is up, it is still used first.",+ "link": "/image-to-3d",+ "tags": [+ "fix",+ "improvement"+ ]+ },{"date": "2026-09-29","type": "launch",@@ -1579,17 +1590,6 @@"tags": ["feature"]- },- {- "date": "2026-09-09",- "type": "update",- "title": "Rankings survives a stalled leaderboard and stops reading the whole board aloud",- "summary": "If the rankings service went quiet, /rankings sat on a shimmering skeleton forever with no way out: a request that never answered looked exactly like one still loading. The board now gives up after 15 seconds and shows the same error card it already had, with a Retry button and the reason, so a stall is always recoverable. Switching metrics still cancels the previous request silently, so a fast tap never surfaces a false error. For screen readers, the results list itself was marked live, so every metric switch and every Show more re-announced up to a hundred rows; the board now announces one short line instead, such as \"Creations: showing 50 of 169 ranked creators\". Page copy also lost its stray dashes.",- "link": "/rankings",- "tags": [- "fix",- "improvement"- ]}]}diff --git a/public/changelog.json b/public/changelog.jsonindex 627636dd5..31760486a 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-09-30T01:34:01.288Z",+ "generated_at": "2026-09-30T05:14:02.725Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -17,6 +17,17 @@"fix"]},+ {+ "date": "2026-09-30",+ "type": "update",+ "title": "Photo to 3D keeps going when its main engines go down",+ "summary": "When a photo-to-3D job fails partway through, it already moves to the next engine on its own. Until now that only worked while another textured engine was up, so when the two main engines failed together last week, photo generations stopped completely. There is now one more rung: our own TripoSG engine takes over the job and delivers the shape of your model without textures, and the progress screen tells you when that happens. You get a model you can work with instead of an error, and whenever a textured engine is up, it is still used first.",+ "link": "/image-to-3d",+ "tags": [+ "fix",+ "improvement"+ ]+ },{"date": "2026-09-29","type": "launch",diff --git a/public/changelog.xml b/public/changelog.xmlindex d3d2e7532..d1bbb6332 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -14,6 +14,14 @@<category>improvement</category><description>Pick any of the 85 languages in the language menu and 59 more pages now follow it, including the Airdrop Checker, Portfolio, Drops, Crews, Launch, the Agent Monitor and the rig and embed doctors. Titles, buttons, form labels, hints, error messages and the text shown when a page is shared all translate. Live numbers and statuses on those pages (counters, balances, scan results, play and pause buttons) keep updating in every language: the translation step now recognises a value the page has already filled in and leaves it alone, instead of putting a placeholder like "Loading" back over it.</description></item>+ <item>+ <title>Photo to 3D keeps going when its main engines go down</title>+ <link>https://three.ws/image-to-3d</link>+ <guid isPermaLink="false">2026-09-30:Photo to 3D keeps going when its main engines go down</guid>+ <pubDate>Wed, 30 Sep 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>When a photo-to-3D job fails partway through, it already moves to the next engine on its own. Until now that only worked while another textured engine was up, so when the two main engines failed together last week, photo generations stopped completely. There is now one more rung: our own TripoSG engine takes over the job and delivers the shape of your model without textures, and the progress screen tells you when that happens. You get a model you can work with instead of an error, and whenever a textured engine is up, it is still used first.</description>+ </item><item><title>Connect three.ws to Claude, ChatGPT, Cursor & VS Code</title><link>https://three.ws/connect</link>diff --git a/src/forge.js b/src/forge.jsindex 9f8469527..9f3345276 100644--- a/src/forge.js+++ b/src/forge.js@@ -1929,8 +1929,12 @@ async function pollUntilDone(jobId) {// keeps it running under the same id. Surface the switch so the user// sees which engine is now serving, rather than a silent swap.if (data.failover_from && data.backend && data.backend !== data.failover_from) {+ // TripoSG is the last-resort photo lane and returns shape only, so+ // say so now rather than let an untextured result read as a bug.+ const shapeOnly =+ data.backend === 'triposg' ? ' It returns the shape without textures.' : '';setLaneNote(- `${engineLabel(data.failover_from)} hit a snag. Continuing on ${engineLabel(data.backend)}, no action needed.`,+ `${engineLabel(data.failover_from)} hit a snag. Continuing on ${engineLabel(data.backend)}, no action needed.${shapeOnly}`,);}}diff --git a/tests/api/forge-sketch.test.js b/tests/api/forge-sketch.test.jsindex 30d4f0056..dc8995a23 100644--- a/tests/api/forge-sketch.test.js+++ b/tests/api/forge-sketch.test.js@@ -179,3 +179,59 @@ describe('gcp provider — sketch mode routing', () => {expect(status.error).toBe('inference failed');});});++describe('gcp provider: triposg photo mode (the last-resort failover rung)', () => {+ async function freshProvider() {+ const mod = await import('../../api/_providers/gcp.js?t=' + Math.random());+ return mod.createRegenProvider();+ }++ it('posts the photo to the same worker in image mode, with no prompt', async () => {+ const calls = [];+ globalThis.fetch = vi.fn(async (url, opts) => {+ calls.push({ url: String(url), body: JSON.parse(opts.body) });+ return new Response(JSON.stringify({ task_id: 'task-photo', status: 'queued' }), { status: 202 });+ });++ const provider = await freshProvider();+ expect(provider.supportsMode('triposg')).toBe(true);+ await provider.submit({+ mode: 'triposg',+ sourceUrl: 'https://cdn.example.com/chair.png',+ params: { target_polycount: 30_000 },+ });++ expect(calls).toHaveLength(1);+ expect(calls[0].url).toBe(`${WORKER_URL}/infer`);+ expect(calls[0].body).toEqual({+ images: ['https://cdn.example.com/chair.png'],+ mode: 'image',+ target_polycount: 30_000,+ });+ });++ it('polls the TripoSG worker for the result', async () => {+ globalThis.fetch = vi.fn(async () =>+ new Response(JSON.stringify({ task_id: 'task-photo', status: 'queued' }), { status: 202 }),+ );+ const provider = await freshProvider();+ const job = await provider.submit({ mode: 'triposg', sourceUrl: 'https://cdn.example.com/chair.png' });++ const glb = 'https://storage.googleapis.com/bucket/raw-meshes/triposg/task-photo.glb';+ globalThis.fetch = vi.fn(async (url) => {+ expect(String(url)).toBe(`${WORKER_URL}/tasks/task-photo`);+ return new Response(JSON.stringify({ task_id: 'task-photo', status: 'done', result_gcs_url: glb }), {+ status: 200,+ });+ });+ const status = await provider.status(job.extJobId);+ expect(status.status).toBe('done');+ expect(status.resultGlbUrl).toBe(glb);+ });++ it('is unsupported when the TripoSG worker is not configured', async () => {+ delete process.env.GCP_TRIPOSG_URL;+ const provider = await freshProvider();+ expect(provider.supportsMode('triposg')).toBe(false);+ });+});diff --git a/tests/forge-failover.test.js b/tests/forge-failover.test.jsindex 2648ed2c2..c0610fff1 100644--- a/tests/forge-failover.test.js+++ b/tests/forge-failover.test.js@@ -60,6 +60,7 @@ const LANE_ENV = ['REPLICATE_API_TOKEN','MODEL_TRELLIS_URL','GCP_HUNYUAN3D_URL',+ 'GCP_TRIPOSG_URL','GCP_RECONSTRUCTION_KEY',];const saved = {};@@ -202,6 +203,39 @@ describe('pickRedispatchLane', () => {expect(await pickRedispatchLane({ attempted: [] })).toBeNull();});+ it('falls through to the geometry-only TripoSG lane once every textured lane is down', async () => {+ // The 2026-09-18..28 outage: Hunyuan3D and TRELLIS self-host both down,+ // Replicate unconfigured, TripoSG healthy. Every photo job dead-ended.+ process.env.MODEL_TRELLIS_URL = 'https://model-trellis.example';+ process.env.GCP_HUNYUAN3D_URL = 'https://hunyuan.example';+ process.env.GCP_TRIPOSG_URL = 'https://triposg.example';+ process.env.GCP_RECONSTRUCTION_KEY = 'k';+ laneHealth.mockResolvedValue({+ byId: { trellis_selfhost: { status: 'down' }, hunyuan3d: { status: 'down' } },+ });+ expect(await pickRedispatchLane({ attempted: [] })).toBe('triposg');+ expect(await pickRedispatchLane({ attempted: ['hunyuan3d', 'trellis_selfhost'] })).toBe('triposg');+ });++ it('never prefers the untextured TripoSG lane over a live textured one', async () => {+ process.env.GCP_HUNYUAN3D_URL = 'https://hunyuan.example';+ process.env.GCP_TRIPOSG_URL = 'https://triposg.example';+ process.env.REPLICATE_API_TOKEN = 'r8_test';+ process.env.GCP_RECONSTRUCTION_KEY = 'k';+ expect(await pickRedispatchLane({ attempted: [] })).toBe('hunyuan3d');+ // Paid textured TRELLIS still outranks it when configured.+ expect(await pickRedispatchLane({ attempted: ['hunyuan3d'] })).toBe('trellis');+ expect(await pickRedispatchLane({ attempted: ['hunyuan3d', 'trellis'] })).toBe('triposg');+ expect(await pickRedispatchLane({ attempted: ['hunyuan3d', 'trellis', 'triposg'] })).toBeNull();+ });++ it('keeps TripoSG out of the fresh-retry suggestions (its public lane is sketch-only)', () => {+ process.env.GCP_TRIPOSG_URL = 'https://triposg.example';+ process.env.GCP_RECONSTRUCTION_KEY = 'k';+ expect(retryBackendSuggestions({ hasImage: true })).not.toContain('triposg');+ expect(retryBackendSuggestions({ hasImage: false })).not.toContain('triposg');+ });+it('falls back to the first configured candidate when the health snapshot throws', async () => {// No telemetry must never mean no failover: a bad pick just fails over// again, but a null pick strands the job on a dead lane.@@ -282,6 +316,20 @@ describe('submitFailoverJob handle shapes', () => {expect(gcpSubmit.mock.calls[0][0].params.target_polycount).toBe(resolveTier(undefined).polycount);});+ it('triposg returns a gcp job token and submits the photo pipeline, not scribble', async () => {+ gcpSubmit.mockResolvedValue({ extJobId: 'tsg-task-3' });+ const out = await submitFailoverJob({ backend: 'triposg', imageUrl: IMG, prompt: 'a knight', tierId: 'high' });++ expect(out.extJobId).toBe('tsg-task-3');+ expect(decodeJobToken(out.handle)).toEqual({ provider: 'gcp', kind: null, taskId: 'tsg-task-3' });+ expect(gcpSubmit).toHaveBeenCalledWith({+ mode: 'triposg',+ sourceUrl: IMG,+ params: { target_polycount: resolveTier('high').polycount },+ });+ expect(replicateSubmit).not.toHaveBeenCalled();+ });+it('trellis (Replicate) returns the bare prediction id, never an f1 token', async () => {replicateSubmit.mockResolvedValue({ extJobId: 'r8-pred-abc123' });const out = await submitFailoverJob({ backend: 'trellis', imageUrl: IMG, prompt: 'a knight' });