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 job polling 400s on provider envelope ids across six endpoints

nirholas8c64938e77e9
diff --git a/api/forge-motion.js b/api/forge-motion.js
index cd7434c17..6e9a2d71c 100644
--- a/api/forge-motion.js
+++ b/api/forge-motion.js
@@ -25,7 +25,9 @@ import { cors, json, method, readJson, wrap, rateLimited } from './_lib/http.js'
import { limits, clientIp } from './_lib/rate-limit.js';
import { createRegenProvider } from './_providers/gcp.js';
-const JOB_ID_RE = /^[A-Za-z0-9_-]{20,64}$/;
+// Provider job ids are base64url JSON envelopes (packJobId in _providers/gcp.js)
+// and run several hundred chars — a 64-char cap 400s every poll.
+const JOB_ID_RE = /^[A-Za-z0-9_-]{20,600}$/;
const MAX_DURATION = 10;
const MIN_DURATION = 1;
diff --git a/api/forge-rembg.js b/api/forge-rembg.js
index 9aad8b509..4fdb054a9 100644
--- a/api/forge-rembg.js
+++ b/api/forge-rembg.js
@@ -18,7 +18,9 @@ import { limits, clientIp } from './_lib/rate-limit.js';
import { assertPublicHttpsUrl, SsrfError } from './_lib/ssrf.js';
import { createRegenProvider } from './_providers/gcp.js';
-const JOB_ID_RE = /^[A-Za-z0-9_-]{20,64}$/;
+// Provider job ids are base64url JSON envelopes (packJobId in _providers/gcp.js)
+// and run several hundred chars — a 64-char cap 400s every poll.
+const JOB_ID_RE = /^[A-Za-z0-9_-]{20,600}$/;
const VALID_MODELS = new Set(['rmbg2', 'u2net', 'isnet', 'u2net_human_seg', 'silueta']);
function unconfigured(res) {
diff --git a/api/forge-remesh.js b/api/forge-remesh.js
index 371ede837..a32c24292 100644
--- a/api/forge-remesh.js
+++ b/api/forge-remesh.js
@@ -21,7 +21,9 @@ import { limits, clientIp } from './_lib/rate-limit.js';
import { assertPublicHttpsUrl, SsrfError } from './_lib/ssrf.js';
import { createRegenProvider } from './_providers/gcp.js';
-const JOB_ID_RE = /^[A-Za-z0-9_-]{20,64}$/;
+// Provider job ids are base64url JSON envelopes (packJobId in _providers/gcp.js)
+// and run several hundred chars — a 64-char cap 400s every poll.
+const JOB_ID_RE = /^[A-Za-z0-9_-]{20,600}$/;
const VALID_OPERATIONS = new Set(['full', 'simplify', 'repair', 'convert']);
const VALID_FORMATS = new Set(['glb', 'obj', 'stl', 'ply', 'usdz', '3mf', 'fbx']);
const VALID_MODES = new Set(['triangle', 'quad', 'lowpoly']);
diff --git a/api/forge-segment.js b/api/forge-segment.js
index 4c3a744ce..8e9b0339c 100644
--- a/api/forge-segment.js
+++ b/api/forge-segment.js
@@ -22,7 +22,9 @@ import { limits, clientIp } from './_lib/rate-limit.js';
import { assertPublicHttpsUrl, SsrfError } from './_lib/ssrf.js';
import { createRegenProvider } from './_providers/gcp.js';
-const JOB_ID_RE = /^[A-Za-z0-9_-]{20,64}$/;
+// Provider job ids are base64url JSON envelopes (packJobId in _providers/gcp.js)
+// and run several hundred chars — a 64-char cap 400s every poll.
+const JOB_ID_RE = /^[A-Za-z0-9_-]{20,600}$/;
const VALID_METHODS = new Set(['auto', 'connected', 'crease']);
const PART_REF_RE = /^[A-Za-z0-9_-]{1,64}$/;
diff --git a/api/forge-stylize.js b/api/forge-stylize.js
index 927a164ca..8630fed1b 100644
--- a/api/forge-stylize.js
+++ b/api/forge-stylize.js
@@ -21,7 +21,9 @@ import { limits, clientIp } from './_lib/rate-limit.js';
import { assertPublicHttpsUrl, SsrfError } from './_lib/ssrf.js';
import { createRegenProvider } from './_providers/gcp.js';
-const JOB_ID_RE = /^[A-Za-z0-9_-]{20,64}$/;
+// Provider job ids are base64url JSON envelopes (packJobId in _providers/gcp.js)
+// and run several hundred chars — a 64-char cap 400s every poll.
+const JOB_ID_RE = /^[A-Za-z0-9_-]{20,600}$/;
const VALID_FORMATS = new Set(['glb', 'obj', 'stl', 'ply']);
// Density bounds per filter — kept in lockstep with workers/stylize STYLE_CATALOG
diff --git a/api/motion-swap.js b/api/motion-swap.js
index 51c4605a3..909644dc5 100644
--- a/api/motion-swap.js
+++ b/api/motion-swap.js
@@ -28,7 +28,9 @@ import { limits, clientIp } from './_lib/rate-limit.js';
import { presignUpload, publicUrl } from './_lib/r2.js';
import { createRegenProvider } from './_providers/gcp.js';
-const JOB_ID_RE = /^[A-Za-z0-9_-]{20,64}$/;
+// Provider job ids are base64url JSON envelopes (mode + task id + worker base
+// URL — see packJobId in _providers/gcp.js), so they run several hundred chars.
+const JOB_ID_RE = /^[A-Za-z0-9_-]{20,600}$/;
const MAX_VIDEO_BYTES = 256 * 1024 * 1024;
const MAX_SECONDS = 90;