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.

fix(forge): land the studio lab, forge page and smart-money follow-ups

nirholase1b3c417ae73
diff --git a/pages/club.html b/pages/club.html
index 27120cc50..30b107f0e 100644
--- a/pages/club.html
+++ b/pages/club.html
@@ -156,7 +156,10 @@
#club-top .tagline,
#club-top .sep,
#club-top .club-pill:not(.club-pill-toggle) { display: none; }
- #club-top .brand { min-width: 0; }
+ #club-top .brand { min-width: 0; gap: 6px; font-size: 13px; }
+ /* The pulsing dot is decorative (aria-hidden) and costs the width
+ that decides whether the page title reads "Pole Club" or "P…". */
+ #club-top .dot { display: none; }
#club-top .club-top-title {
min-width: 0;
overflow: hidden;
diff --git a/pages/forge-nim.html b/pages/forge-nim.html
index 727e5209f..1ff0547dd 100644
--- a/pages/forge-nim.html
+++ b/pages/forge-nim.html
@@ -799,6 +799,7 @@
</p>
<div class="state-actions">
<button type="button" class="btn btn-ghost" id="set-endpoint" data-i18n="forge_nim.set_endpoint">Set the endpoint</button>
+ <button type="button" class="btn btn-ghost" id="retry-health" hidden data-i18n="forge_nim.retry_check">Retry check</button>
</div>
<div class="state-links">
<a href="/forge" data-i18n="forge_nim.link_hosted_forge">Use the hosted forge instead</a>
@@ -875,7 +876,9 @@
stateLoading: $('state-loading'),
stateError: $('state-error'),
stateUnconfigured: $('state-unconfigured'),
+ unconfiguredMsg: $('unconfigured-msg'),
setEndpoint: $('set-endpoint'),
+ retryHealth: $('retry-health'),
advanced: document.querySelector('details.advanced'),
errorTitle: $('error-title'),
errorMsg: $('error-msg'),
@@ -924,16 +927,25 @@
// only the deployment default is unknown, so do not lock the composer.
state.hasEndpoint = Boolean(override);
setStatus('down', 'Status unavailable');
+ setUnconfiguredCopy(
+ 'The status check could not reach this site’s API, so whether a NIM is wired here is unknown. Retry the check, or paste the base URL of your own TRELLIS NIM to run against it directly.',
+ true,
+ );
applyEndpointState();
return;
}
if (seq !== state.healthSeq) return;
// A rejected override answers from the env instead of the box, and says so
- // via `reason` with no masked baseUrl echoed back. Treat it as no endpoint
- // rather than letting the composer promise a POST that can only 400.
+ // via `reason` with no masked baseUrl echoed back.
+ // A rejected override is a typo the user has to fix: the composer would
+ // otherwise POST that same bad URL and can only ever get a 400 back.
const overrideRejected = Boolean(override) && !d.baseUrl;
- state.hasEndpoint = overrideRejected ? Boolean(d.configured) : Boolean(override) || Boolean(d.configured);
+ state.hasEndpoint = overrideRejected ? false : Boolean(override) || Boolean(d.configured);
+ setUnconfiguredCopy(
+ overrideRejected ? `That endpoint was rejected: ${d.reason || 'it must be a public https URL.'}` : null,
+ false,
+ );
if (overrideRejected) {
setStatus('down', 'Endpoint rejected');
@@ -949,6 +961,22 @@
applyEndpointState();
}
+ // The setup card explains the ONE thing that is actually wrong. Its default is
+ // "no NIM is wired here"; a failed status check is a different problem with a
+ // different fix, so that case swaps the copy and offers a retry.
+ const unconfiguredDefaultHtml = els.unconfiguredMsg.innerHTML;
+ function setUnconfiguredCopy(text, offerRetry) {
+ if (text) {
+ els.unconfiguredMsg.textContent = text;
+ els.unconfiguredMsg.dataset.i18nOwned = '1';
+ } else {
+ els.unconfiguredMsg.innerHTML = unconfiguredDefaultHtml;
+ delete els.unconfiguredMsg.dataset.i18nOwned;
+ }
+ els.retryHealth.hidden = !offerRetry;
+ }
+ els.retryHealth.addEventListener('click', () => checkHealth(els.baseUrl.value));
+
function setStatus(s, text) {
els.status.dataset.state = s;
els.statusText.textContent = text;
diff --git a/pages/forge-spark.html b/pages/forge-spark.html
index 2cad6dbae..894570893 100644
--- a/pages/forge-spark.html
+++ b/pages/forge-spark.html
@@ -441,6 +441,8 @@
};
let viewer = null;
let busy = false;
+ let statusTimer = null;
+ let retryTimer = null;
document.getElementById('examples').addEventListener('click', (e) => {
const chip = e.target.closest('.chip');
@@ -456,17 +458,61 @@
const s = el.querySelector('.state');
if (s) s.textContent = label || state;
}
+ // The refine lane is a chain, not one fixed model: when NVIDIA's Nemotron
+ // NIM is busy the request falls through to the next free rung. Rename the
+ // stage to whatever actually answered so the pipeline never claims a model
+ // that did not run.
+ function setStageWho(name, who) {
+ const el = stages[name];
+ const w = el && el.querySelector('.who');
+ if (w) w.textContent = who;
+ }
function resetStages() {
for (const name of Object.keys(stages)) setStage(name, 'idle', 'idle');
+ setStageWho('nemotron', 'Nemotron');
}
+ // A real elapsed counter (never a synthetic progress bar): a cold TRELLIS
+ // lane can hold a request for minutes, and a frozen line reads as a hang.
function showStatus(text) {
+ const started = Date.now();
statusText.textContent = text;
statusEl.hidden = false;
- }
- function hideStatus() { statusEl.hidden = true; }
- function showError(msg) {
+ clearInterval(statusTimer);
+ statusTimer = setInterval(() => {
+ const secs = Math.round((Date.now() - started) / 1000);
+ statusText.textContent = secs >= 5 ? text + ' (' + secs + 's)' : text;
+ }, 1000);
+ }
+ function hideStatus() {
+ clearInterval(statusTimer);
+ statusTimer = null;
+ statusEl.hidden = true;
+ }
+ // `retryAfter` comes from the endpoint's own retry-after hint on a 429, so
+ // the recovery button opens exactly when a retry can succeed.
+ function showError(msg, retryAfter) {
errorText.textContent = msg;
errorEl.hidden = false;
+ clearInterval(retryTimer);
+ retryTimer = null;
+ retry.disabled = false;
+ retry.textContent = 'Try again';
+ let left = Math.min(Math.round(Number(retryAfter) || 0), 120);
+ if (left <= 0) return;
+ const tick = () => {
+ if (left <= 0) {
+ clearInterval(retryTimer);
+ retryTimer = null;
+ retry.disabled = false;
+ retry.textContent = 'Try again';
+ return;
+ }
+ retry.disabled = true;
+ retry.textContent = 'Try again in ' + left + 's';
+ left -= 1;
+ };
+ tick();
+ retryTimer = setInterval(tick, 1000);
}
function clearError() { errorEl.hidden = true; errorText.textContent = ''; }
@@ -505,10 +551,12 @@
const data = await r.json();
const refined = (data.prompt || raw).trim();
const model = data.model || 'Nemotron';
+ const label = prettyModel(model, data.provider);
refinedEl.hidden = false;
refinedEl.innerHTML =
'<b>Refined prompt</b> · ' + escapeHtml(refined) +
- '<span class="by">refined with ' + escapeHtml(prettyModel(model, data.provider)) + '</span>';
+ '<span class="by">refined with ' + escapeHtml(label) + '</span>';
+ setStageWho('nemotron', label);
setStage('nemotron', 'done', 'done');
return refined;
} catch (err) {
@@ -532,7 +580,10 @@
});
const data = await r.json().catch(() => ({}));
if (!r.ok) {
- throw new Error(data.message || data.error || ('forge ' + r.status));
+ throw withRetryHint(
+ new Error(data.message || data.error || ('forge ' + r.status)),
+ data.retry_after || r.headers.get('retry-after'),
+ );
}
if (data.status === 'done' && (data.glb_url || data.model_url)) {
markReconstructDone();
@@ -571,7 +622,7 @@
return data.glb_url || data.model_url;
}
if (status === 'failed' || status === 'error') {
- throw new Error(data.error || 'Reconstruction failed.');
+ throw new Error(data.message || data.error || 'Reconstruction failed.');
}
// running / queued — keep waiting
}
@@ -606,11 +657,12 @@
for (const name of Object.keys(stages)) {
if (stages[name].dataset.state === 'active') setStage(name, 'failed', 'failed');
}
- showError(err.message || 'Something went wrong. Please try again.');
+ showError(err.message || 'Something went wrong. Please try again.', err.retryAfter);
} finally {
busy = false;
generateBtn.disabled = false;
- retry.disabled = false;
+ // A live retry countdown owns the button until it expires.
+ if (!retryTimer) retry.disabled = false;
generateBtn.textContent = 'Generate 3D model';
}
}
@@ -630,6 +682,11 @@
});
function sleep(ms) { return new Promise((r) => setTimeout(r, ms)); }
+ function withRetryHint(err, seconds) {
+ const n = Number(seconds);
+ if (Number.isFinite(n) && n > 0) err.retryAfter = n;
+ return err;
+ }
function escapeHtml(s) {
return String(s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
}
diff --git a/pages/forge-studio.html b/pages/forge-studio.html
index 17f7171b8..be9dd1f55 100644
--- a/pages/forge-studio.html
+++ b/pages/forge-studio.html
@@ -517,6 +517,19 @@
padding-top: var(--space-sm);
border-top: 1px solid var(--stroke);
}
+ .forge-quality-error {
+ margin-top: var(--space-sm);
+ padding-top: var(--space-sm);
+ border-top: 1px solid var(--stroke);
+ }
+ .forge-quality-error .tws-es {
+ padding: var(--space-sm) 0;
+ text-align: left;
+ align-items: flex-start;
+ }
+ .forge-quality-error .tws-es-icon { display: none; }
+ .forge-quality-error .tws-es-title { font-size: var(--text-sm); }
+ .forge-quality-error .tws-es-body { font-size: var(--text-xs); }
.fq-row {
display: flex;
align-items: center;
@@ -3341,6 +3354,7 @@
type="file"
id="view-file-input"
accept="image/png,image/jpeg,image/webp"
+ aria-label="Choose up to 4 photos of the same object"
multiple
hidden
/>
@@ -3379,6 +3393,7 @@
type="file"
id="sketch-file-input"
accept="image/png,image/jpeg,image/webp"
+ aria-label="Choose a sketch image to reconstruct"
hidden
/>
<label for="sketch-prompt" class="is-hidden"
@@ -3400,6 +3415,11 @@
</p>
</div>
+ <!-- Reachable only when /api/forge?catalog=1 fails at the transport or
+ HTTP layer. Holds the state-kit error block from forge.js so the
+ engine picker never just vanishes on a bad network. -->
+ <div class="forge-quality-error is-hidden" id="forge-quality-error"></div>
+
<!-- Quality tier + generation engine + BYOK key -->
<div class="forge-quality" id="forge-quality">
<div class="fq-row">
diff --git a/pages/forge.html b/pages/forge.html
index aeaca6d54..ea401e5d0 100644
--- a/pages/forge.html
+++ b/pages/forge.html
@@ -208,9 +208,13 @@
color: var(--ink);
}
/* Live backend health on the engine buttons: a throttled upstream gets
- an amber dot, a down/unconfigured one is disabled with the reason in
- its tooltip. Dots ride ::after so the label spacing stays put. */
- .aspect button[data-health='degraded']::after {
+ an amber dot, a down/unconfigured one a red dot and the reason in its
+ tooltip. Both states are decoded by the legend below the picker, so
+ each one has to actually render, or the legend explains a swatch that
+ never appears. Dots ride ::after so the label spacing stays put. */
+ .aspect button[data-health='degraded']::after,
+ .aspect button[data-health='down']::after,
+ .aspect button[data-health='unconfigured']::after {
content: '';
display: inline-block;
width: 0.4em;
@@ -220,6 +224,14 @@
background: var(--warning, #e0a93e);
vertical-align: 0.08em;
}
+ /* A disabled button is dimmed to 0.45, which would wash the red dot out
+ to roughly the amber one, keep it full-strength so "unavailable"
+ stays distinguishable from "busy" at a glance. */
+ .aspect button[data-health='down']::after,
+ .aspect button[data-health='unconfigured']::after {
+ background: var(--danger, #e05a5a);
+ opacity: 1;
+ }
.aspect button:disabled {
opacity: 0.45;
cursor: not-allowed;
diff --git a/pages/smart-money.html b/pages/smart-money.html
index e80ba4afd..fc3f75340 100644
--- a/pages/smart-money.html
+++ b/pages/smart-money.html
@@ -94,7 +94,10 @@
border-bottom: 1.6px solid var(--faint); transform: translateY(-65%) rotate(45deg); pointer-events: none; }
/* coin grid */
- .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
+ /* min() keeps the 330px track from forcing a wider-than-viewport column on a
+ 320px phone, where html/body carry overflow-x:clip and would silently shear
+ the right edge (score badge and ☆ watch button) off every card. */
+ .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 14px; }
.sm-coin-wrap { position: relative; }
.sm-watch { position: absolute; top: 10px; right: 10px; z-index: 2; width: 28px; height: 28px;
display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line);
@@ -477,9 +480,27 @@
bar.hidden = true;
}
+ // Every caller needs to tell "the radar answered, and the answer is no data"
+ // apart from "we never reached the radar". Those are different states with
+ // different copy and different affordances (retry vs. explain), so the error
+ // carries the distinction instead of collapsing both into one message.
async function getJSON(url) {
- const r = await fetch(url, { headers: { accept: 'application/json' } });
- if (!r.ok) throw new Error(`${r.status}`);
+ let r;
+ try {
+ r = await fetch(url, { headers: { accept: 'application/json' } });
+ } catch (e) {
+ const err = new Error(e && e.message ? e.message : 'network request failed');
+ err.unreachable = true;
+ throw err;
+ }
+ if (!r.ok) {
+ const err = new Error(`${r.status}`);
+ err.status = r.status;
+ // A 4xx is the server's considered answer ("no such wallet"); a 5xx is
+ // the radar being down and is worth retrying.
+ err.unreachable = r.status >= 500;
+ throw err;
+ }
return r.json();
}
@@ -753,34 +774,45 @@
}
grid.innerHTML = Array.from({ length: Math.min(mints.length, 6) }, () => '<div class="skel"></div>').join('');
const results = await Promise.allSettled(mints.map((m) => getJSON(`${API}?mint=${encodeURIComponent(m)}`)));
+
+ // Every lookup failing means the radar is unreachable, not that the whole
+ // watchlist went unscored. Say so once, with a retry, instead of labelling
+ // each tracked coin "not on the radar" on the strength of a network blip.
+ if (results.every((r) => r.status === 'rejected' && r.reason?.unreachable)) {
+ grid.innerHTML = `<div class="state" style="grid-column:1/-1"><b>Couldn't reach the radar.</b>
+ Your ${mints.length} watched coin${mints.length > 1 ? 's are' : ' is'} still saved on this device. ${esc(results[0].reason.message)}
+ <button class="btn primary" id="watchRetry" type="button">Retry</button></div>`;
+ $('watchRetry').addEventListener('click', renderWatchlist);
+ return;
+ }
+
grid.innerHTML = '';
- let any = false;
results.forEach((r, i) => {
- if (r.status === 'fulfilled' && r.value && r.value.coin) {
- grid.appendChild(coinCard(r.value.coin, { watchOffer: true }));
- any = true;
- } else {
- grid.appendChild(watchUnscored(mints[i]));
- }
+ if (r.status === 'fulfilled' && r.value && r.value.coin) grid.appendChild(coinCard(r.value.coin, { watchOffer: true }));
+ else grid.appendChild(watchUnscored(mints[i], r.status === 'rejected' && r.reason?.unreachable));
});
- if (!any && !results.some((r) => r.status === 'fulfilled')) {
- // all lookups failed — likely a transient error, not "unscored"
- }
}
- function watchUnscored(mint) {
+ function watchUnscored(mint, unreachable = false) {
const wrap = document.createElement('div');
wrap.className = 'sm-coin-wrap';
const card = document.createElement('div');
card.className = 'coin';
card.style.opacity = '.78';
+ const headline = unreachable ? "Couldn't load this one" : 'Not on the radar yet';
+ const detail = unreachable
+ ? "We couldn't reach the radar for this coin. It stays on your watchlist; try again in a moment."
+ : "The radar only scores coins from their first hours of trading. This one isn't in the current window.";
card.innerHTML = `
<div class="coin-top">
- <div class="coin-img">?</div>
- <div class="coin-id"><div class="coin-sym">${esc(mint.slice(0, 6))}…</div><div class="coin-name">Not on the radar yet</div></div>
+ <div class="coin-img">${unreachable ? '!' : '?'}</div>
+ <div class="coin-id"><div class="coin-sym">${esc(mint.slice(0, 6))}…</div><div class="coin-name">${headline}</div></div>
</div>
- <p style="margin:0;color:var(--muted);font-size:12.5px">The radar only scores coins from their first hours of trading. This one isn't in the current window.</p>
+ <p style="margin:0;color:var(--muted);font-size:12.5px">${detail}</p>
+ ${unreachable ? '<button class="btn" type="button" data-watch-retry>Retry</button>' : ''}
<a class="btn" href="https://pump.fun/${esc(mint)}" target="_blank" rel="noopener">Open on pump.fun →</a>`;
+ const retry = card.querySelector('[data-watch-retry]');
+ if (retry) retry.addEventListener('click', renderWatchlist);
const wb = document.createElement('button');
wb.className = 'sm-watch sm-watched';
wb.type = 'button';
@@ -827,6 +859,15 @@
}));
}
+ // Failed drawer load: retryable when the radar was unreachable, explanatory
+ // when it answered and genuinely had nothing on record.
+ function drawerFailure(err, notFoundHtml, retry) {
+ if (!err || !err.unreachable) { $('drBody').innerHTML = notFoundHtml; return; }
+ $('drBody').innerHTML = `<div class="state"><b>Couldn't reach the radar.</b>${esc(err.message)}
+ <button class="btn primary" id="drRetry" type="button">Retry</button></div>`;
+ $('drRetry').addEventListener('click', retry);
+ }
+
async function openCoin(mint, { push = true } = {}) {
if (push) drawerStack.push(() => openCoin(mint, { push: false }));
openDrawer('Loading…', '<div class="skel" style="height:120px"></div>');
@@ -888,7 +929,13 @@
<a href="/oracle/coin/${encodeURIComponent(mint)}" class="sm-oracle-link" target="_blank" rel="noopener">Full coin page →</a>`;
});
} catch (e) {
- $('drBody').innerHTML = `<div class="state"><b>Not scored yet.</b>This coin hasn't been picked up by the radar.</div>`;
+ $('drTitle').textContent = 'Coin';
+ drawerFailure(
+ e,
+ `<div class="state"><b>Not scored yet.</b>This coin hasn't been picked up by the radar. The radar scores coins from their first hours of trading, so older mints fall outside the window.
+ <a class="btn" href="https://pump.fun/${esc(mint)}" target="_blank" rel="noopener">Open on pump.fun →</a></div>`,
+ () => openCoin(mint, { push: false }),
+ );
}
syncBackBtn();
}
@@ -903,7 +950,7 @@
<div class="lw-top"><span class="lw-addr">${esc(c.symbol || c.mint.slice(0, 8))}</span>${c.graduated ? '<span class="nlabel lb-smart_money">graduated</span>' : ''}</div>
<div class="lstat">${fmtSol(c.buy_sol)}◎</div>
<a class="solscan" href="https://pump.fun/${esc(c.mint)}" target="_blank" rel="noopener">pump ↗</a>
- </div>`).join('') || '<p style="color:var(--muted)">No recent coins on record.</p>';
+ </div>`).join('') || `<p style="color:var(--muted)">No recent coins on record. This wallet's judged trades sit outside the window the radar keeps coin-level detail for${last ? `, and it was last active ${last} ago` : ''}. Its reputation above still counts every verdict.</p>`;
const last = ago(w.last_active_at);
$('drBody').innerHTML = `
<div style="margin-bottom:14px;display:flex;align-items:center;gap:10px;flex-wrap:wrap">
@@ -931,7 +978,13 @@
el.addEventListener('keydown', (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); go(); } });
});
} catch (e) {
- $('drBody').innerHTML = `<div class="state"><b>No track record yet.</b>We haven't recorded judged trades for this wallet.</div>`;
+ $('drTitle').textContent = short(wallet);
+ drawerFailure(
+ e,
+ `<div class="state"><b>No track record yet.</b>We haven't recorded judged trades for this wallet. A wallet enters the graph once it buys a pump.fun launch the radar is scoring.
+ <a class="btn" href="https://solscan.io/account/${esc(wallet)}" target="_blank" rel="noopener">Solscan →</a></div>`,
+ () => openWallet(wallet, { push: false }),
+ );
}
syncBackBtn();
}
@@ -1024,8 +1077,17 @@
clearStale();
} catch (e) {
if (!hasData) {
- $('feedGrid').innerHTML = `<div class="state" style="grid-column:1/-1"><b>Couldn't reach the radar.</b>${esc(e.message)}<button class="btn primary" id="retry">Retry</button></div>`;
- const r = $('retry'); if (r) r.addEventListener('click', refresh);
+ // Cold failure: no view has ever rendered, so every tab would be a
+ // blank void. Give the feed the retry and tell the other two tabs
+ // the same story rather than leaving them empty.
+ const why = e.status ? `The radar API answered ${e.status}.` : "We couldn't reach the radar from this browser.";
+ $('feedGrid').innerHTML = `<div class="state" style="grid-column:1/-1"><b>Couldn't reach the radar.</b>${esc(why)} Nothing is cached yet, so there is nothing to show.
+ <button class="btn primary" id="retry" type="button">Retry</button></div>`;
+ $('retry').addEventListener('click', refresh);
+ $('walletList').innerHTML = `<tr><td colspan="${WALLET_COLS.length}"><div class="state"><b>Couldn't reach the radar.</b>${esc(why)}
+ <button class="btn primary" id="walletRetry" type="button">Retry</button></div></td></tr>`;
+ $('walletRetry').addEventListener('click', refresh);
+ $('dist').hidden = true;
} else {
staleFails++;
showStale();
diff --git a/prompts/swarm-100/route-coins.md b/prompts/swarm-100/route-coins.md
deleted file mode 100644
index d3d162170..000000000
--- a/prompts/swarm-100/route-coins.md
+++ /dev/null
@@ -1,119 +0,0 @@
-# Route audit: /coins (Coins: Live Prices & Market Caps)
-
-How to run: paste this file's repo path into a fresh Claude Code chat in this
-repository and say "run this work order". This file is fully self-contained:
-it depends on no other prompt file anywhere. If neighboring files in
-prompts/swarm-100/ are gone, that work is done; if present, ignore them.
-Every claim below rots; step 0 re-measures, and what you measure wins.
-
-## Operating clause (binding)
-
-- Read CLAUDE.md first. Its rules override everything, including this file.
-- Finish 100% in this session. Never end the turn with a question, an option
- list, or an unexecuted plan. A judgment call goes in one line of the final
- report; it never becomes a question that halts work.
-- The only permitted stops are the CLAUDE.md stop-and-ask gates: spending real
- funds or any irreversible on-chain write, git push or a production deploy,
- committing content that references a crypto project other than $THREE, and
- destroying unrecoverable data.
-- No mocks, no fake data, no placeholder stubs, no unfinished-work markers, no
- commented-out code. Real APIs and real integrations only.
-- The em-dash and en-dash characters are banned in everything you write.
-- Concurrent agents share this worktree: stage explicit paths only (never a
- bare add-everything), and commit finished work promptly.
-- Before committing, run: npm run check:rules -- --paths <files you touched>.
- It must exit 0.
-
-## Step 0: re-derive the current state
-
-1. This route's declared entry (path, description, added date):
-
- node -e "const p=require('./data/pages.json');for(const s of p.sections)for(const g of s.pages)if(g.path==='/coins')console.log(JSON.stringify(g,null,2))"
-
-2. Find the serving implementation: grep "/coins" in vercel.json (the live
- route table server/index.mjs boots from), then list matching files in
- pages/ and src/. STRUCTURE.md maps every surface to its directory if the
- grep is ambiguous.
-3. Production right now:
-
- curl -so /dev/null -w '%{http_code}\n' https://three.ws/coins
-
-4. Start (or reuse) the local dev server: npm run dev (vite, port 3000).
-
-## Task: audit this one route end to end, then fix everything found
-
-Route: /coins ("Coins: Live Prices & Market Caps", section "crypto").
-Declared purpose: Live global cryptocurrency market data: total market cap, dominance, Fear & Greed, and the top coins with prices, 24h/7d moves, and 7d sparklines. Every coin links to a rich /coin/:id detail page with an interactive chart, market stats, related news, and official links.
-
-Drive the page in a real headless browser. Playwright is already a dev
-dependency; keep your probe script in the session scratchpad, never in the
-repo.
-
-1. Load http://localhost:3000/coins. Record the HTTP status, every console
- error and warning, and every failed network request.
-2. Exercise it like a first-time user: click the primary actions, run the
- primary flow if one exists, follow the page's internal links. Every button
- must do something real; every link must resolve. If the page renders data,
- prove in the network log that it came from a live endpoint, not a baked-in
- fallback array.
-3. States: verify populated, empty, loading, and error states are designed and
- reachable. Block the page's primary fetch in Playwright and confirm an
- actionable error state appears, not a blank void or a raw exception.
-4. Responsive: render at 320, 768, and 1440 px. No horizontal page scroll, no
- overlapping or clipped controls.
-5. Accessibility basics: one h1; interactive elements are real buttons or
- links with visible focus states; images carry alt text; form fields have
- labels.
-6. Head: a specific title tag and meta description that match the declared
- purpose above.
-7. Fix every defect at its root in the page's real source files and re-run the
- probe until clean. Defects in shared modules are in scope when this route
- exercises them.
-
-## Definition of done
-
-- [ ] Local load of /coins: HTTP 200, zero console errors, zero unhandled
- failed requests (a third-party outage must land in a designed fallback,
- not a broken page).
-- [ ] No dead interactive element on the page: no stub href="#", no button
- without a handler, no link to a missing path.
-- [ ] Empty, loading, error, and populated states verified.
-- [ ] 320 / 768 / 1440 px renders verified clean.
-- [ ] Title and meta description present and specific.
-- [ ] npm test passes; npm run check:rules -- --paths <touched files> exits 0.
-- [ ] Production status from step 0 recorded in the report; if production
- needs a deploy to pick up a fix, the report says so (deploys stay
- owner-gated).
-
-## Never blocked
-
-| Blocker | Resolution (act, do not ask) |
-|---|---|
-| Missing env var or credential | Check .env and .env.local, then the Cloud Run service env, then Secret Manager (the CLAUDE.md self-unblock playbook has the exact commands). If it truly exists nowhere, wire the code fully behind the env var, prove the wiring with a dry run, and name the single missing var in the report. |
-| gcloud not on PATH | Run: export PATH="$HOME/google-cloud-sdk/bin:$PATH" |
-| Dev server port 3000 busy | Another agent may be serving this repo; probe it and reuse if so. Otherwise start your own on a free port: npx vite --port 3101 |
-| Playwright browser missing | npx playwright install chromium |
-| A surface needs a signed-in user | Register a fresh account through the real /register flow against the real API and use it. Never mock the session. |
-| A defect sits in code you did not touch | Fix it if it blocks a Definition of done line (root cause it, never mask it). Otherwise note it in the report and continue. |
-| An unrelated test is red | Same rule. Never pipe npm test through tail; it masks exit codes. |
-
-## Close out (required)
-
-1. Verify every Definition of done line with the actual command output in
- front of you. Never claim a line you did not verify.
-2. Commit with explicit paths and a subject that describes the diff (house
- style: type(scope): what changed and why a reader cares).
-3. Delete this prompt file in that same commit:
-
- git rm prompts/swarm-100/route-coins.md
-
- The shrinking directory is this campaign's only progress ledger; there is
- no progress log to update.
-4. Final report: what step 0 measured, what changed (file list), evidence per
- Definition of done line, and any one-line judgment calls. No trailing
- questions, no unexecuted plans.
-
-If a line genuinely cannot pass inside this session (an external party must
-respond, or an owner-gated action is the final step), finish everything else,
-leave this file in place, and state exactly which line remains and who owns
-it. Never delete this file on a partial.
diff --git a/src/forge-studio/forge.js b/src/forge-studio/forge.js
index 73aee8252..d7f8bbde9 100644
--- a/src/forge-studio/forge.js
+++ b/src/forge-studio/forge.js
@@ -414,23 +414,55 @@ function updateAspectVisibility() {
// Fetch the tier/backend/cost catalog once, then build the engine selector from
// the backends that are live (platform-configured) or BYOK (always selectable).
async function loadCatalog() {
+ const qualityEl = els.engine?.closest('#forge-quality');
+ const errorEl = document.getElementById('forge-quality-error');
+ // A transport failure and a served-but-catalog-less response mean different
+ // things to the user: the first is retryable and worth surfacing, the second
+ // is a deploy that simply has no picker to show.
+ let reachable = false;
try {
const res = await fetch('/api/forge?catalog=1', { headers: CLIENT_HEADERS });
- catalog = await res.json().catch(() => null);
+ reachable = res.ok;
+ catalog = reachable ? await res.json().catch(() => null) : null;
} catch {
catalog = null;
}
if (!catalog || !Array.isArray(catalog.backends)) {
- // No catalog (older deploy) — hide the controls; defaults still work.
- els.engine?.closest('#forge-quality')?.classList.add('is-hidden');
+ qualityEl?.classList.add('is-hidden');
+ // A served response without a backends array is an older deploy with
+ // nothing to pick, so it stays silent as before.
+ if (errorEl && !reachable) showCatalogError(errorEl);
return;
}
+ errorEl?.classList.add('is-hidden');
+ qualityEl?.classList.remove('is-hidden');
buildEngineButtons();
selectTier(selectedTier);
revealSketchMode();
loadHealth();
}
+// Render the retryable notice that replaces the quality/engine controls when the
+// catalog could not be reached. A served response without a backends array is an
+// older deploy with nothing to pick, so it stays silent as before.
+function showCatalogError(errorEl, reachable) {
+ if (reachable) {
+ errorEl.classList.add('is-hidden');
+ errorEl.innerHTML = '';
+ return;
+ }
+ errorEl.innerHTML = errorStateHTML({
+ title: "Couldn't load the engine list",
+ body: 'Quality and engine options are unavailable right now. Generation still works on the default free engine, or retry to get the full picker back.',
+ });
+ errorEl.classList.remove('is-hidden');
+ errorEl.querySelector('[data-sk-retry]')?.addEventListener('click', () => {
+ errorEl.innerHTML = '';
+ errorEl.classList.add('is-hidden');
+ loadCatalog();
+ });
+}
+
// Sketch→3D needs the self-host TripoSG worker — the tab stays hidden unless
// the catalog reports that engine configured, so there is no dead mode on
// deployments without it.
diff --git a/src/forge-studio/lab/lab.js b/src/forge-studio/lab/lab.js
index e01f3e054..0a7a94dda 100644
--- a/src/forge-studio/lab/lab.js
+++ b/src/forge-studio/lab/lab.js
@@ -235,6 +235,11 @@ function resetDownload() {
const dl = $('#lab-download');
dl.classList.add('is-disabled');
dl.removeAttribute('href');
+ // Href-less anchors are invisible to keyboard and screen-reader users, so the
+ // disabled affordance has to be announced explicitly rather than implied by
+ // the dimmed style alone.
+ dl.setAttribute('aria-disabled', 'true');
+ dl.setAttribute('title', 'Generate something first, then download it as a file');
}
function setDownload(url, filename, label) {
@@ -243,6 +248,8 @@ function setDownload(url, filename, label) {
dl.setAttribute('download', filename);
dl.querySelector('.lab-dl-label').textContent = label;
dl.classList.remove('is-disabled');
+ dl.removeAttribute('aria-disabled');
+ dl.setAttribute('title', `Download ${filename}`);
}
// ── Generate ──────────────────────────────────────────────────────────────────
diff --git a/src/forge.js b/src/forge.js
index b1c25cba2..83d585a2b 100644
--- a/src/forge.js
+++ b/src/forge.js
@@ -1482,11 +1482,26 @@ async function startJob({ prompt, imageUrls, skipValidation, payment }) {
body: JSON.stringify(body),
});
const data = await res.json().catch(() => ({}));
- if (res.status === 503 || data.error === 'unconfigured') {
+ // Only a genuine deployment gap earns the unconfigured panel: it names env
+ // vars and offers no retry, which is the right answer for an operator and the
+ // wrong one for a visitor. The other 503s (`generation_unavailable`) are
+ // transient upstream capacity - a worker still warming, or a free lane that
+ // shed the request - so they land in the recoverable countdown state carrying
+ // the server's own message and retry_after.
+ if (data.error === 'unconfigured') {
const e = new Error(data.message || 'unconfigured');
e.kind = 'unconfigured';
throw e;
}
+ if (res.status === 503) {
+ const e = new Error(
+ data.message || 'The generator is temporarily unavailable. Try again shortly.',
+ );
+ e.kind = 'rate_limited';
+ e.retryAfter = Number(data.retry_after) > 0 ? Math.ceil(Number(data.retry_after)) : 20;
+ e.unavailable = true;
+ throw e;
+ }
// Geometry path needs a BYOK key we don't have — a recoverable, designed state.
if (data.error === 'needs_key') {
const e = new Error(data.message || 'An API key is required for this engine.');