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(embed): keep the OG thumbnail on the API route that actually exists

nirholasf8f3233dcf97
diff --git a/api/_lib/embed.js b/api/_lib/embed.js
index dea187b22..e85320f48 100644
--- a/api/_lib/embed.js
+++ b/api/_lib/embed.js
@@ -55,7 +55,10 @@ export function agentEmbedTarget(origin, id) {
return {
embedUrl: `${origin}/agents/${id}/embed`,
shareUrl: `${origin}/agents/${id}`,
- thumbnailUrl: `${origin}/api/agents/${id}/og`,
+ // The OG card route is /api/agent/:id/og (singular) in vercel.json. The
+ // page-link rename to /agents/:id does not apply to it: there is no plural
+ // API route, so a renamed thumbnail URL 404s on every embed snippet.
+ thumbnailUrl: `${origin}/api/agent/${id}/og`,
};
}
diff --git a/tests/api/agent-registration-metadata.test.js b/tests/api/agent-registration-metadata.test.js
index 75d27c925..cf4622351 100644
--- a/tests/api/agent-registration-metadata.test.js
+++ b/tests/api/agent-registration-metadata.test.js
@@ -65,7 +65,7 @@ describe('buildAgentRegistrationMetadata', () => {
it('falls back to a generated description and home url when none supplied', () => {
const m = buildAgentRegistrationMetadata({ agentId: 7, name: 'Solo' });
expect(m.description).toContain('Solo');
- expect(m.services.find((s) => s.name === 'web').endpoint).toMatch(/\/agent\/7$/);
+ expect(m.services.find((s) => s.name === 'web').endpoint).toMatch(/\/agents\/7$/);
});
});
diff --git a/tests/share-panel.test.js b/tests/share-panel.test.js
index a6f310d39..425d4a7e2 100644
--- a/tests/share-panel.test.js
+++ b/tests/share-panel.test.js
@@ -224,7 +224,9 @@ describe('agent-embed.html — consolidated embed page', () => {
});
it('resolves agentId from both the path and the ?id= query (so the legacy share snippet still works)', () => {
- expect(html).toContain("parts.indexOf('agent')");
+ // Both path shapes resolve: /agents/:id/embed (canonical) and the legacy
+ // /agent/:id/embed a share snippet copied before the rename still carries.
+ expect(html).toContain("parts.findIndex((p) => p === 'agents' || p === 'agent')");
expect(html).toContain("params.get('id')");
});