Skip to content

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.

i18n(symphony): annotate the page so it localizes like its neighbours

nirholas045901fb1d6c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f7bbaa1c6..10eef5374 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,12 +17,15 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Ethereum name lookups work again** — Looking up an .eth name through the public name resolver had stopped working: every request sat there for about ten seconds and then came back as an error, while .sol names resolved fine. Two things were wrong. The Ethereum node we asked first had started refusing our requests outright, and because it was first in line every lookup wasted a full round trip on it before trying anywhere else. On top of that, the lookup itself was asking the network four or five separate questions in sequence when one would do. Nodes known to refuse us are now tried last instead of first, and a name lookup is a single question. An .eth name now resolves in about a quarter of a second, and a name that genuinely does not exist comes back as a clean not-found instead of a timeout. (`/crypto-api`) `[fix]`
- **Every x402 payment now settles against its own Solana transaction** — An audit of our payment facilitator found that about one in five recorded settlements shared an on-chain transaction with another settlement. Solana signatures are deterministic, so two payments of the same amount, from the same wallet, to the same endpoint, built in the same short window could compile to a byte-for-byte identical transaction. Only one of them could ever land on chain, and the facilitator was crediting the others against it. Settlement is now claimed atomically: one transaction settles at most one payment, a genuine retry is recognised and answered without double-charging, and anything else is refused rather than credited. The payment builder also draws from a signature space about four thousand times larger, at no extra fee, so identical transactions are no longer built in the first place. A new hourly audit watches the invariant and raises an alert if it is ever violated again. `[fix, infra, security]`
- **Fact checks that used to time out now come back with their sources** — Some fact checks were taking so long that the request was cut off before anything came back, and the caller got an error instead of an answer. Two things caused it. The checker asks a language model to write search queries and then to judge each source it finds; if none of the model providers could answer, that step threw the whole check away, even though the checker had already gathered real sources and knew how to carry on without the model. And nothing kept an eye on the clock, so a slow run could outlast the time limit the request had to begin with. Both are fixed. A check now works to a time budget and hands each step whatever is left, so it always finishes with something to show. If a step genuinely cannot reach a model, the check falls back instead of failing: it searches the claim itself, returns the sources it found with their excerpts, and marks the verdict as insufficient rather than guessing. The response now says plainly which step fell back, and a result produced that way is deliberately not cached, so asking again re-runs the full check rather than replaying a bad day. (`/fact-check`) `[fix, improvement]`
+- **Notification mute switches actually work now** — The per-category switches in settings let you turn the bell off for a kind of notification, but the bell ignored them and filled up anyway. They work now. One deliberate exception: account and security notices (withdrawals, payment problems, security alerts) always stay in your bell, because that is your record of what happened to your account and losing it silently would be worse than a little noise. You can still turn off their push, email and Telegram. Those always-on switches now show as locked in settings instead of pretending to be adjustable. (`/dashboard/settings`) `[fix, improvement]`
- **Ordinary new coins are no longer mistaken for honeypots** — Before any automated buy, the platform simulates a full buy-then-sell round trip on-chain to prove the coin can actually be sold again, and blocks anything that cannot be exited. That simulation runs from the buying agent's own wallet, so when the wallet was too small to fund the simulated purchase, the failure was being read as evidence that the coin was a trap. One underfunded agent produced 336 consecutive false honeypot verdicts in a single afternoon on perfectly normal launches. The safety probe now scales down to a size the wallet can actually simulate, since a real honeypot traps a seller at any size, and an out-of-funds failure is now reported as exactly that. Coins that genuinely cannot be sold are still blocked, and a wallet too empty to prove anything is still refused rather than waved through. `[fix, security]`
- **Payments that had already gone through no longer come back as failures** — When an agent pays three.ws for an API call, the payment is sent to Solana and then confirmed. If the node that answered replied in a shape our software could not read, the platform gave up and called the payment failed, even though in many cases it had already settled on-chain. The caller got an error for something they had genuinely paid for. The platform now asks the chain directly before declaring any payment failed, and skips that check only in the one case that proves the payment never reached the network at all. Separately, the most common payment failure used to reach our logs carrying no reason whatsoever, which made it impossible to diagnose or fix; the underlying cause is now recorded alongside it. `[fix]`
- **Platform payment wallets now refill straight from the treasury when they run dry** — The two wallets that pay for the platform's automated work could only refill themselves by trading one of their own assets for the other. A wallet that was low on both had no way out, so it would sit and fail payments while the treasury held plenty of funds one step away. The treasury now tops those wallets up directly, with a per-transfer cap, a daily cap, and a reserve it never spends below. Payments that used to stall for hours waiting on a human now recover on their own within a minute. `[fix, infra]`
- **Production now watches every paid Solana connection, not just one** — three.ws reaches the Solana blockchain through several providers so that if one runs out of capacity the others carry the load. Until now the status page only watched one of them, which meant the platform could report a healthy connection while every paid provider was actually out of quota and all traffic had quietly fallen back to slower free servers. That state is hard to spot from the outside: it shows up as occasional slow pages and failed on-chain actions rather than a clean outage. The status page now reports the health of the whole set, and says plainly when everything paid has run out so it can be topped up before anyone notices. (`/status`) `[infra, improvement]`
+- **Restyled models read properly in the feed** — When someone restyled a model, the activity feed just said they "shared something" with a generic icon. Restyles now say so, with their own icon, and a colorway variant is labelled as one instead of being lumped in with a hand-directed restyle. (`/feed`) `[fix]`
- **Solana RPC failover fixed: the paid reserve is no longer the primary lane** — The platform routes every Solana call through a chain of RPC providers so no single one becomes a bottleneck, with a paid endpoint held back as an emergency reserve. A configuration mistake had that reserve listed as the primary as well, and because the chain keeps the first entry for a repeated address, it quietly served all traffic and burned through its daily request cap while the free providers sat idle. The reserve is now held back as intended and the premium provider leads. Two safeguards prevent a repeat: the slowest public endpoint can no longer outrank a paid provider by being used as a default, and when one server discovers a provider is out of quota, the rest of the fleet now inherits that verdict immediately instead of each wasting another request against a cap that is already full. `[infra, fix]`
- **Stopped two automated systems from passing the same SOL back and forth** — One background job tops up each trading agent wallet to a working balance. Another reclaims idle SOL from platform wallets back to the treasury so the agent economy can pay its network fees. Their thresholds disagreed, so they took turns moving the same funds in opposite directions: in one fifteen-minute window 0.24 SOL made that round trip six times, paying a network fee each leg, and the agents never held a balance long enough to trade. Both jobs now read a single shared policy with one rule, that a reclaim can never take a wallet below the level the top-up will immediately restore. The reclaim also now leaves every active trader enough to cover a complete trade, including the safety check that runs before it. `[fix, infra]`
+- **The fact checker stops timing out, and reads its sources properly** — Paid fact checks had started failing outright with a server error instead of returning a verdict. The cause was in how we try our AI providers: when the first provider accepted a request and then went quiet, we kept waiting on it (and on two more sign-ins to the same provider) until the whole time budget for the check was gone, so the providers that were healthy and ready to answer were never reached. We now stop re-trying a provider that has already gone quiet, and no single provider can eat more than a third of the remaining time while others are still waiting. Checks that used to die at 46 seconds now come back with a real, sourced answer. Alongside that, the checker reads evidence far better: its free Wikipedia source now returns the article's actual opening text instead of a 150-character fragment around a keyword, all three search angles are represented in the sources we examine rather than just the first, and a verdict is now decided by the sources that genuinely address the claim, so evidence that never mentions the claim returns an honest "not enough evidence" instead of a misleading "mixed". The published accuracy figure on the fact-check page has been cleared until a clean measurement can be taken, because the last one was recorded during the outage above and measured that outage rather than the product. (`/fact-check`) `[fix, improvement]`
- **The live pump.fun trade feed now drops data providers that cannot serve it** — The live trade feed connects to a chain of Solana data providers and falls back through them. Some of those providers answer normal requests fine but reject the live-streaming connection outright, and the underlying library retried them forever, flooding the logs and wasting a slot in the fallback chain. The feed now tests each provider once, permanently sets aside the ones that structurally cannot stream, and briefly benches ones that are merely busy, so it lands on a working provider immediately instead of retrying a dead one. `[fix, improvement]`
- **three.ws can search the live web now, with sources you can check** — Until now the platform could not look anything up on the open web. Searching three.ws found things made on three.ws (avatars, agents, models, worlds, coins), and the news surfaces read from a fixed list of crypto publishers, but there was no way to ask a question about the wider web and get a current answer. A new public endpoint does exactly that: ask a question, get an answer written from live search results, plus the list of sources it was built from and the exact searches that were run, so you can check the work rather than take it on faith. The fact checker uses the same lookup, which means it now reads real current pages instead of falling back to Wikipedia summaries, and it correctly treats a government or reference source as more authoritative than an anonymous blog. (`/docs/api-reference`) `[feature, infra]`
- **Trading agents that looked healthy but could never place a trade now say why** — Several arms of the autonomous trading fleet were switched on, funded, and reading every new launch, yet had never bought anything. Nothing looked broken, because an entry that gets skipped leaves no record at all. Four separate causes were found and fixed. An arm whose configured trade size had drifted above its own daily spending cap could never satisfy both at once, so it sat out every opportunity. A wallet trimmed too thin could not pay for the safety simulation the platform runs before every buy. Some arms asked for coins above a market-cap floor that a brand-new launch cannot reach at the moment they look at it. And arms pinned to a specific AI model refused to trade because that model had quietly stopped answering, with a stand-in replying in its place. Every armed strategy on the experiments board now carries a plain-language reason when it is not trading, and the ops channel is paged when a pinned model goes dark. (`/sniper/experiments`) `[fix, improvement]`
diff --git a/data/changelog.json b/data/changelog.json
index 665fdc50c..67695b5cf 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,35 @@
{
"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-07-29",
+ "title": "Notification mute switches actually work now",
+ "summary": "The per-category switches in settings let you turn the bell off for a kind of notification, but the bell ignored them and filled up anyway. They work now. One deliberate exception: account and security notices (withdrawals, payment problems, security alerts) always stay in your bell, because that is your record of what happened to your account and losing it silently would be worse than a little noise. You can still turn off their push, email and Telegram. Those always-on switches now show as locked in settings instead of pretending to be adjustable.",
+ "tags": [
+ "fix",
+ "improvement"
+ ],
+ "link": "/dashboard/settings"
+ },
+ {
+ "date": "2026-07-29",
+ "title": "Restyled models read properly in the feed",
+ "summary": "When someone restyled a model, the activity feed just said they \"shared something\" with a generic icon. Restyles now say so, with their own icon, and a colorway variant is labelled as one instead of being lumped in with a hand-directed restyle.",
+ "tags": [
+ "fix"
+ ],
+ "link": "/feed"
+ },
+ {
+ "date": "2026-07-29",
+ "title": "The fact checker stops timing out, and reads its sources properly",
+ "summary": "Paid fact checks had started failing outright with a server error instead of returning a verdict. The cause was in how we try our AI providers: when the first provider accepted a request and then went quiet, we kept waiting on it (and on two more sign-ins to the same provider) until the whole time budget for the check was gone, so the providers that were healthy and ready to answer were never reached. We now stop re-trying a provider that has already gone quiet, and no single provider can eat more than a third of the remaining time while others are still waiting. Checks that used to die at 46 seconds now come back with a real, sourced answer. Alongside that, the checker reads evidence far better: its free Wikipedia source now returns the article's actual opening text instead of a 150-character fragment around a keyword, all three search angles are represented in the sources we examine rather than just the first, and a verdict is now decided by the sources that genuinely address the claim, so evidence that never mentions the claim returns an honest \"not enough evidence\" instead of a misleading \"mixed\". The published accuracy figure on the fact-check page has been cleared until a clean measurement can be taken, because the last one was recorded during the outage above and measured that outage rather than the product.",
+ "tags": [
+ "fix",
+ "improvement"
+ ],
+ "link": "/fact-check"
+ },
{
"date": "2026-07-29",
"title": "A calmer first visit: the site now starts simple and opens up when you ask",
diff --git a/public/changelog.json b/public/changelog.json
index 54cb22361..ff408a70c 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-29T05:37:48.122Z",
+ "generated_at": "2026-07-29T05:41:19.675Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -125,6 +125,17 @@
"improvement"
]
},
+ {
+ "date": "2026-07-29",
+ "type": "update",
+ "title": "Notification mute switches actually work now",
+ "summary": "The per-category switches in settings let you turn the bell off for a kind of notification, but the bell ignored them and filled up anyway. They work now. One deliberate exception: account and security notices (withdrawals, payment problems, security alerts) always stay in your bell, because that is your record of what happened to your account and losing it silently would be worse than a little noise. You can still turn off their push, email and Telegram. Those always-on switches now show as locked in settings instead of pretending to be adjustable.",
+ "link": "/dashboard/settings",
+ "tags": [
+ "fix",
+ "improvement"
+ ]
+ },
{
"date": "2026-07-29",
"type": "update",
@@ -168,6 +179,16 @@
"improvement"
]
},
+ {
+ "date": "2026-07-29",
+ "type": "update",
+ "title": "Restyled models read properly in the feed",
+ "summary": "When someone restyled a model, the activity feed just said they \"shared something\" with a generic icon. Restyles now say so, with their own icon, and a colorway variant is labelled as one instead of being lumped in with a hand-directed restyle.",
+ "link": "/feed",
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-07-29",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index f1d499106..7d947c999 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -94,6 +94,14 @@
<category>fix</category>
<description>Some fact checks were taking so long that the request was cut off before anything came back, and the caller got an error instead of an answer. Two things caused it. The checker asks a language model to write search queries and then to judge each source it finds; if none of the model providers could answer, that step threw the whole check away, even though the checker had already gathered real sources and knew how to carry on without the model. And nothing kept an eye on the clock, so a slow run could outlast the time limit the request had to begin with. Both are fixed. A check now works to a time budget and hands each step whatever is left, so it always finishes with something to show. If a step genuinely cannot reach a model, the check falls back instead of failing: it searches the claim itself, returns the sources it found with their excerpts, and marks the verdict as insufficient rather than guessing. The response now says plainly which step fell back, and a result produced that way is deliberately not cached, so asking again re-runs the full check rather than replaying a bad day.</description>
</item>
+ <item>
+ <title>Notification mute switches actually work now</title>
+ <link>https://three.ws/dashboard/settings</link>
+ <guid isPermaLink="false">2026-07-29:Notification mute switches actually work now</guid>
+ <pubDate>Wed, 29 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The per-category switches in settings let you turn the bell off for a kind of notification, but the bell ignored them and filled up anyway. They work now. One deliberate exception: account and security notices (withdrawals, payment problems, security alerts) always stay in your bell, because that is your record of what happened to your account and losing it silently would be worse than a little noise. You can still turn off their push, email and Telegram. Those always-on switches now show as locked in settings instead of pretending to be adjustable.</description>
+ </item>
<item>
<title>Ordinary new coins are no longer mistaken for honeypots</title>
<link>https://three.ws/changelog</link>
@@ -126,6 +134,14 @@
<category>infra</category>
<description>three.ws reaches the Solana blockchain through several providers so that if one runs out of capacity the others carry the load. Until now the status page only watched one of them, which meant the platform could report a healthy connection while every paid provider was actually out of quota and all traffic had quietly fallen back to slower free servers. That state is hard to spot from the outside: it shows up as occasional slow pages and failed on-chain actions rather than a clean outage. The status page now reports the health of the whole set, and says plainly when everything paid has run out so it can be topped up before anyone notices.</description>
</item>
+ <item>
+ <title>Restyled models read properly in the feed</title>
+ <link>https://three.ws/feed</link>
+ <guid isPermaLink="false">2026-07-29:Restyled models read properly in the feed</guid>
+ <pubDate>Wed, 29 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>When someone restyled a model, the activity feed just said they &quot;shared something&quot; with a generic icon. Restyles now say so, with their own icon, and a colorway variant is labelled as one instead of being lumped in with a hand-directed restyle.</description>
+ </item>
<item>
<title>Solana RPC failover fixed: the paid reserve is no longer the primary lane</title>
<link>https://three.ws/changelog</link>
@@ -142,6 +158,14 @@
<category>fix</category>
<description>One background job tops up each trading agent wallet to a working balance. Another reclaims idle SOL from platform wallets back to the treasury so the agent economy can pay its network fees. Their thresholds disagreed, so they took turns moving the same funds in opposite directions: in one fifteen-minute window 0.24 SOL made that round trip six times, paying a network fee each leg, and the agents never held a balance long enough to trade. Both jobs now read a single shared policy with one rule, that a reclaim can never take a wallet below the level the top-up will immediately restore. The reclaim also now leaves every active trader enough to cover a complete trade, including the safety check that runs before it.</description>
</item>
+ <item>
+ <title>The fact checker stops timing out, and reads its sources properly</title>
+ <link>https://three.ws/fact-check</link>
+ <guid isPermaLink="false">2026-07-29:The fact checker stops timing out, and reads its sources properly</guid>
+ <pubDate>Wed, 29 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>Paid fact checks had started failing outright with a server error instead of returning a verdict. The cause was in how we try our AI providers: when the first provider accepted a request and then went quiet, we kept waiting on it (and on two more sign-ins to the same provider) until the whole time budget for the check was gone, so the providers that were healthy and ready to answer were never reached. We now stop re-trying a provider that has already gone quiet, and no single provider can eat more than a third of the remaining time while others are still waiting. Checks that used to die at 46 seconds now come back with a real, sourced answer. Alongside that, the checker reads evidence far better: its free Wikipedia source now returns the article's actual opening text instead of a 150-character fragment around a keyword, all three search angles are represented in the sources we examine rather than just the first, and a verdict is now decided by the sources that genuinely address the claim, so evidence that never mentions the claim returns an honest &quot;not enough evidence&quot; instead of a misleading &quot;mixed&quot;. The published accuracy figure on the fact-check page has been cleared until a clean measurement can be taken, because the last one was recorded during the outage above and measured that outage rather than the product.</description>
+ </item>
<item>
<title>The live pump.fun trade feed now drops data providers that cannot serve it</title>
<link>https://three.ws/changelog</link>
diff --git a/tests/api/forge-poll-failover.test.js b/tests/api/forge-poll-failover.test.js
index ce88eaed5..f36491312 100644
--- a/tests/api/forge-poll-failover.test.js
+++ b/tests/api/forge-poll-failover.test.js
@@ -24,11 +24,13 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';
Object.assign(process.env, {
APP_ORIGIN: 'https://three.ws',
JWT_SECRET: 'test-jwt-secret-at-least-32-characters-long',
- // Two redispatchable platform lanes configured, so a failed job has
- // somewhere to go and the hop chain has room to accumulate.
+ // Three redispatchable lanes configured (two self-hosted GCP workers plus
+ // the paid Replicate lane), so the chain has room to hop more than once and
+ // the hop cap, not a lane shortage, is what ends it.
MODEL_TRELLIS_URL: 'https://model-trellis.example.run.app',
GCP_HUNYUAN3D_URL: 'https://hunyuan3d.example.run.app',
GCP_RECONSTRUCTION_KEY: 'test-gcp-key',
+ REPLICATE_API_TOKEN: 'test-replicate-token',
});
// The lane that owns the job reports a hard failure on every poll. Each submit
@@ -43,30 +45,39 @@ vi.mock('../../api/_providers/gcp.js', () => ({
}));
vi.mock('../../api/_providers/replicate.js', () => ({
createRegenProvider: () => ({
- submit: vi.fn(async () => ({ extJobId: 'r8-pred' })),
+ submit: vi.fn(async () => ({ extJobId: `r8-pred-${++submitSeq}` })),
status: vi.fn(async () => ({ status: 'failed', error: 'prediction failed' })),
}),
}));
-// Store: the creation row carries the inputs a redispatch reconstructs from.
-const createCreation = vi.fn(async () => 'creation-2');
+// Store: creation rows keyed by upstream job id, the way the real table is.
+// This is what makes hop accumulation observable: each redispatch writes a row
+// for its successor naming the NEW lane, so the next poll reads that lane as
+// the one that just failed. A fixture that always reported the original lane
+// would hide a failover chain re-picking a dead lane forever.
+const ORIGINAL_TASK = 'gcp-original-task';
+const BASE_ROW = {
+ tier: 'standard',
+ path: 'image',
+ prompt: 'a knight',
+ preview_image_url: 'https://cdn.example/ref.png',
+ views_requested: 1,
+ views_used: 1,
+ multiview: false,
+};
+const rows = new Map();
+const createCreation = vi.fn(async (args) => {
+ rows.set(args.replicateJobId, { ...BASE_ROW, backend: args.backend });
+ return `creation-${rows.size}`;
+});
const markFailed = vi.fn(async () => {});
vi.mock('../../api/_lib/forge-store.js', () => ({
hashClient: (v) => `client:${v || 'anon'}`,
hashIp: (v) => `ip:${v}`,
createCreation: (...a) => createCreation(...a),
- materializeCreation: vi.fn(async ({ glbUrl }) => ({ id: 'creation-2', glbUrl })),
+ materializeCreation: vi.fn(async ({ glbUrl }) => ({ id: 'creation-x', glbUrl })),
markFailed: (...a) => markFailed(...a),
- findByJob: vi.fn(async () => ({
- backend: 'trellis_selfhost',
- tier: 'standard',
- path: 'image',
- prompt: 'a knight',
- preview_image_url: 'https://cdn.example/ref.png',
- views_requested: 1,
- views_used: 1,
- multiview: false,
- })),
+ findByJob: vi.fn(async ({ replicateJobId }) => rows.get(replicateJobId) ?? null),
}));
// Lane health is up for everything: lane SELECTION is not what this file tests.
@@ -136,11 +147,15 @@ async function poll(jobId) {
return res;
}
-const JOB = encodeJobToken({ provider: 'gcp', taskId: 'gcp-original-task' });
+const JOB = encodeJobToken({ provider: 'gcp', taskId: ORIGINAL_TASK });
beforeEach(() => {
chain.clear();
bindOrder.length = 0;
+ rows.clear();
+ // The original job's own row: submitted on the self-hosted TRELLIS lane.
+ rows.set(ORIGINAL_TASK, { ...BASE_ROW, backend: 'trellis_selfhost' });
+ submitSeq = 0;
createCreation.mockClear();
markFailed.mockClear();
});
diff --git a/workers/garment-forge/Dockerfile b/workers/garment-forge/Dockerfile
index e0f55253b..6f84141e3 100644
--- a/workers/garment-forge/Dockerfile
+++ b/workers/garment-forge/Dockerfile
@@ -19,6 +19,7 @@ COPY job_queue.py /app/job_queue.py
COPY main.py /app/main.py
COPY test_garment_glb.py /app/test_garment_glb.py
COPY test_job_queue.py /app/test_job_queue.py
+COPY test_reference_image.py /app/test_reference_image.py
# The canonical reference body (public/avatars/parametric-base.glb), staged
# into assets/ by cloudbuild.yaml so the repo does not carry a second copy.
@@ -33,5 +34,10 @@ RUN python /app/test_garment_glb.py
# regression here silently drops submitted work.
RUN python /app/test_job_queue.py
+# Build-time guard: the reference-image stage must re-roll a model response that
+# returned 200 with no image rather than failing the job outright. Losing that
+# re-roll throws away queued work on a single stochastic refusal.
+RUN python /app/test_reference_image.py
+
EXPOSE 8080
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080", "--workers", "1"]
diff --git a/workers/garment-forge/README.md b/workers/garment-forge/README.md
index f938fc3f6..fc7c9f858 100644
--- a/workers/garment-forge/README.md
+++ b/workers/garment-forge/README.md
@@ -48,6 +48,15 @@ pure glTF work in between:
landscape). The photo is posed to match the reference body: worn shape,
A-pose, front view, plain background. Reference quality drives mesh
quality; the resolution is held at 2K.
+
+ The model sometimes answers `200` carrying no image at all (a safety or
+ recitation filter, or an empty candidate under load). That is not a
+ transport failure, so the HTTP retry has nothing to retry, and a single such
+ response used to kill a job that was already queued. Generation is
+ stochastic, so the stage now re-rolls the same prompt up to
+ `VERTEX_IMAGE_ATTEMPTS` times (default 3) and only fails once the budget is
+ spent, reporting the last `finishReason`. Pinned by
+ `test_reference_image.py`, which runs as a Docker build gate.
2. **Mesh** (`pipeline.generate_mesh`): the image goes through the deployed
image→3D failover chain, first healthy rung wins:
`model-hunyuan3d-21-rtx` (warm primary, full PBR: albedo +
@@ -233,6 +242,7 @@ suite runs inside `docker build`, so a regression cannot ship.
| `VERTEX_IMAGEN_MODEL` | `gemini-2.5-flash-image` | Vertex image model |
| `VERTEX_IMAGEN_LOCATION` | `global` | Vertex location for the image model |
| `VERTEX_IMAGE_SIZE` | `2K` | reference image resolution |
+| `VERTEX_IMAGE_ATTEMPTS` | `3` | re-rolls when the image model answers 200 with no image |
| `GARMENT_YAW_DEG` | `0` | yaw applied to generator output before placement |
| `MESH_TIMEOUT_S` / `RIG_TIMEOUT_S` | `1200` / `600` | per-stage poll ceilings |
| `MAX_CONCURRENT` | `2` | parallel jobs per instance |
diff --git a/workers/garment-forge/pipeline.py b/workers/garment-forge/pipeline.py
index 3a6cfb975..4b0b18bef 100644
--- a/workers/garment-forge/pipeline.py
+++ b/workers/garment-forge/pipeline.py
@@ -155,6 +155,8 @@ def generate_reference_image(prompt: str, slot: str) -> tuple[bytes, str]:
if attempt:
log.info("reference image took %d attempt(s) (prior: %s)", attempt + 1, last_reason)
return image, f"vertex-ai/{VERTEX_MODEL}"
+ if attempt + 1 >= _IMAGE_ATTEMPTS:
+ break # budget spent; fall through to the raise below
log.warning("Vertex returned no image data (finishReason: %s); re-rolling "
"attempt %d/%d", last_reason, attempt + 2, _IMAGE_ATTEMPTS)
time.sleep(1.5 * (attempt + 1))
diff --git a/workers/garment-forge/test_reference_image.py b/workers/garment-forge/test_reference_image.py
index 9e78256f0..812fab367 100644
--- a/workers/garment-forge/test_reference_image.py
+++ b/workers/garment-forge/test_reference_image.py
@@ -13,6 +13,7 @@ and without the re-roll a single such response permanently loses a queued job.
from __future__ import annotations
import base64
+import os
import sys
import types