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(app): restore original boot order for /app?agent=:id

nirholas3fa5b589c256
diff --git a/src/app.js b/src/app.js
index 3a5bfd3d2..718b19f11 100644
--- a/src/app.js
+++ b/src/app.js
@@ -235,22 +235,22 @@ class App {
}
// Editing an existing agent: ?agent=<uuid> (authenticated editing surface)
- // _loadAgentForEdit owns its own _initAgentSystem call — early-return to
- // avoid mounting AgentHome twice into the same container.
if (options.agentEdit) {
this._loadAgentForEdit(options.agentEdit);
- this._initWidgetBridge();
- return;
+ } else {
+ // Resume a stashed editor session (post-login round-trip), else
+ // load the model named in the URL or fall back to the CZ avatar.
+ this._maybeResumeOrLoad(options);
}
- this._maybeResumeOrLoad(options);
-
// After sign-in redirect, check for a pending_save stash.
if (options.pending) {
this._maybePendingSave();
}
- // Boot the agent system once identity is ready
+ // Boot the agent system once identity is ready. _loadAgentForEdit also
+ // triggers _initAgentSystem at its tail; the AgentHome render is
+ // idempotent so the second pass tears down and re-mounts cleanly.
this._initAgentSystem();
// Studio preview iframes use postMessage to live-update brand config.