fix(cockpit): ag-ui examples 404 on /agent in production (base-href-aware URL)#661
Open
blove wants to merge 1 commit into
Open
fix(cockpit): ag-ui examples 404 on /agent in production (base-href-aware URL)#661blove wants to merge 1 commit into
blove wants to merge 1 commit into
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 hardcodeprovideAgent({ 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 byassemble-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/agentin dev (base/) and/ag-ui/<topic>/agentin production.Verified:
cockpit-ag-ui-client-tools-angularbuild 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