Skip to content

fix(cockpit): ag-ui examples 404 on /agent in production (base-href-aware URL)#661

Open
blove wants to merge 1 commit into
mainfrom
claude/fix-ag-ui-prod-agent-url
Open

fix(cockpit): ag-ui examples 404 on /agent in production (base-href-aware URL)#661
blove wants to merge 1 commit into
mainfrom
claude/fix-ag-ui-prod-agent-url

Conversation

@blove

@blove blove commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Found by production smoke of examples.threadplane.ai: every ag-ui example's frontend loads, but sending any message dies with a Vercel HTTP 404 NOT_FOUND — all six apps hardcode provideAgent({ url: '/agent' }), an absolute path that only exists behind the local dev-server proxy. In production the apps serve under /ag-ui/<topic>/ (base href rewritten by assemble-examples) and the proxy route only matches /ag-ui/<topic>/agent.

Fix: provideAgent({ url: new URL('agent', document.baseURI).pathname }) in all six apps — resolves to /agent in dev (base /) and /ag-ui/<topic>/agent in production.

Verified: cockpit-ag-ui-client-tools-angular build green + e2e 3/3 (dev behavior identical). Production verification requires the examples Vercel project to rebuild after merge — I'll re-run the prod smoke then.

🤖 Generated with Claude Code

All six ag-ui example apps hardcoded provideAgent({ url: '/agent' }), which
works in local dev (root base + dev-server proxy) but 404s on
examples.threadplane.ai where each app serves under /ag-ui/<topic>/ and the
Vercel proxy only routes /ag-ui/<topic>/agent. Resolve via
new URL('agent', document.baseURI).pathname — '/agent' locally,
'/ag-ui/<topic>/agent' in production. Found by the production smoke
(every ag-ui example's runs were 404ing in prod since first deploy).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@blove blove enabled auto-merge (squash) June 12, 2026 03:34
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment Jun 12, 2026 3:37am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant