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.

feat(forge): probe every post-generation editing lane in the health report

nirholas1bd4fb4df9b4
diff --git a/api/_lib/forge-health.js b/api/_lib/forge-health.js
index ecafbe557..23a1131f1 100644
--- a/api/_lib/forge-health.js
+++ b/api/_lib/forge-health.js
@@ -208,9 +208,9 @@ async function probeHuggingFace() {
// otherwise 2xx/3xx → ok
// A 4xx means the worker is routable but exposes no health contract; that is
// still reachable, so it stays ok with the readiness caveat in the message.
-function gcpWorkerProbe(id, urlEnv) {
+function gcpWorkerProbe(id, urlEnv, labelOverride = null) {
return async function probeGcpWorker() {
- const label = BACKENDS[id]?.label || id;
+ const label = labelOverride || BACKENDS[id]?.label || id;
const url = readEnv(urlEnv);
const key = readEnv('GCP_RECONSTRUCTION_KEY');
if (!url || !key) {
@@ -270,6 +270,35 @@ const PROBES = {
trellis_selfhost: gcpWorkerProbe('trellis_selfhost', 'MODEL_TRELLIS_URL'),
};
+// The editing lanes: everything the result panel offers AFTER a mesh exists
+// (remesh/retopo, stylize, segment, background removal, text-to-motion, auto-rig
+// and region retexture). None of them were in this report, which is precisely
+// how the retexture lane sat dead: `GCP_TEXTURE_URL` was never set on the
+// service, /api/studio/retexture-region answered 501 to every caller, and the
+// health endpoint said the forge was fine because it only ever looked at the
+// generation backends. A tool the UI shows a button for is a lane a user can
+// hit, so it is probed like any other upstream.
+//
+// They all speak the same worker contract the generation workers do (GET
+// /health behind GCP_RECONSTRUCTION_KEY), so the shared probe reads them
+// unchanged, including the load_error and readiness branches.
+const EDITING_WORKERS = [
+ { id: 'remesh', env: 'GCP_REMESH_URL', label: 'Remesh / retopology' },
+ { id: 'stylize', env: 'GCP_STYLIZE_URL', label: 'Stylize' },
+ { id: 'segment', env: 'GCP_SEGMENT_URL', label: 'Segment' },
+ { id: 'rembg', env: 'GCP_REMBG_URL', label: 'Background removal' },
+ { id: 'text2motion', env: 'GCP_TEXT2MOTION_URL', label: 'Text to motion' },
+ { id: 'rig', env: 'GCP_UNIRIG_URL', label: 'Auto-rig' },
+ { id: 'texture', env: 'GCP_TEXTURE_URL', label: 'Retexture' },
+];
+
+async function probeEditingLanes() {
+ const entries = await Promise.all(
+ EDITING_WORKERS.map((w) => gcpWorkerProbe(w.id, w.env, w.label)()),
+ );
+ return Object.fromEntries(entries.map((e) => [e.id, e]));
+}
+
// The distributed rate-limiter store gates every paid lane: when Redis is
// unreachable (or the Upstash account is over quota) the cost-protecting
// limiters fail closed and ALL standard/high/image generations 429 — while
@@ -363,7 +392,7 @@ export async function probeForgeHealth({ force = false } = {}) {
return { ...cache.payload, cached: true };
}
- const [entries, limiter, llm, world, redis, metrics] = await Promise.all([
+ const [entries, editing, limiter, llm, world, redis, metrics] = await Promise.all([
Promise.all(
Object.values(BACKENDS).map(async (b) => {
if (b.byok) return byokResult(b.id);
@@ -378,6 +407,8 @@ export async function probeForgeHealth({ force = false } = {}) {
return probe();
}),
),
+ // Every post-generation tool lane, probed live rather than assumed.
+ probeEditingLanes(),
probeLimiterStore(),
// LLM providers gate every AI-driven generation surface (prompt rewriting,
// agent responses). A dead provider chain degrades the product the same way
@@ -413,6 +444,7 @@ export async function probeForgeHealth({ force = false } = {}) {
const statuses = entries
.map((e) => e.status)
+ .concat(Object.values(editing).map((e) => e.status))
.concat(
limiter.status,
llm.overall,
@@ -426,6 +458,7 @@ export async function probeForgeHealth({ force = false } = {}) {
status: overall,
generated_at: new Date().toISOString(),
backends,
+ editing,
limiter,
llm,
world,
diff --git a/tests/api/forge-health.test.js b/tests/api/forge-health.test.js
index 91a3c4d4e..79328c44b 100644
--- a/tests/api/forge-health.test.js
+++ b/tests/api/forge-health.test.js
@@ -17,6 +17,13 @@ const ENV_VARS = [
'GCP_TRIPOSG_URL',
'GCP_RECONSTRUCTION_URL',
'GCP_RECONSTRUCTION_KEY',
+ 'GCP_REMESH_URL',
+ 'GCP_STYLIZE_URL',
+ 'GCP_SEGMENT_URL',
+ 'GCP_REMBG_URL',
+ 'GCP_TEXT2MOTION_URL',
+ 'GCP_UNIRIG_URL',
+ 'GCP_TEXTURE_URL',
'UPSTASH_REDIS_REST_URL',
'UPSTASH_REDIS_REST_TOKEN',
'three_KV_REST_API_URL',
@@ -392,3 +399,42 @@ describe('forge-health — caching', () => {
expect(global.fetch.mock.calls.length).toBeGreaterThan(calls);
});
});
+
+describe('forge-health: editing lanes', () => {
+ // Every tool the result panel offers after a mesh exists. They were absent
+ // from this report entirely, which is how the retexture lane ran dead in
+ // production (GCP_TEXTURE_URL unset, 501 to every caller) while health said
+ // the forge was fine. Coverage is derived from the payload so a newly added
+ // tool worker cannot be silently missing.
+ const LANES = ['remesh', 'stylize', 'segment', 'rembg', 'text2motion', 'rig', 'texture'];
+
+ it('reports every editing lane, unconfigured when its URL is unset', async () => {
+ mockUpstreams([]);
+ const health = await probeForgeHealth();
+ expect(Object.keys(health.editing).sort()).toEqual([...LANES].sort());
+ for (const id of LANES) expect(health.editing[id].status).toBe('unconfigured');
+ // An unconfigured lane is reported but does not by itself declare an
+ // outage, matching how an unconfigured backend is treated.
+ expect(backendProbes()).toEqual([]);
+ });
+
+ it('probes a configured lane live and passes it on a healthy worker', async () => {
+ process.env.GCP_RECONSTRUCTION_KEY = 'secret';
+ process.env.GCP_REMESH_URL = 'https://remesh-service.example.run.app';
+ mockUpstreams([['remesh-service.example.run.app', 200]]);
+ const health = await probeForgeHealth();
+ expect(health.editing.remesh.status).toBe('ok');
+ expect(health.editing.remesh.latency_ms).toBeGreaterThanOrEqual(0);
+ // It really went to the worker rather than reading the env var.
+ expect(backendProbes().some((u) => u.includes('remesh-service.example.run.app/health'))).toBe(true);
+ });
+
+ it('a 5xx from a tool worker degrades the overall verdict', async () => {
+ process.env.GCP_RECONSTRUCTION_KEY = 'secret';
+ process.env.GCP_SEGMENT_URL = 'https://segment-service.example.run.app';
+ mockUpstreams([['segment-service.example.run.app', 503]]);
+ const health = await probeForgeHealth();
+ expect(health.editing.segment.status).toBe('down');
+ expect(health.status).toBe('degraded');
+ });
+});