From 10f9126355b90408e4bec294e851cf5572955829 Mon Sep 17 00:00:00 2001 From: Brian Love Date: Thu, 11 Jun 2026 20:34:17 -0700 Subject: [PATCH] fix(cockpit): ag-ui examples resolve the agent URL against base href MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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// and the Vercel proxy only routes /ag-ui//agent. Resolve via new URL('agent', document.baseURI).pathname — '/agent' locally, '/ag-ui//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) --- cockpit/ag-ui/a2ui/angular/src/app/app.config.ts | 2 +- cockpit/ag-ui/client-tools/angular/src/app/app.config.ts | 2 +- cockpit/ag-ui/interrupts/angular/src/app/app.config.ts | 2 +- cockpit/ag-ui/json-render/angular/src/app/app.config.ts | 2 +- cockpit/ag-ui/streaming/angular/src/app/app.config.ts | 2 +- cockpit/ag-ui/tool-views/angular/src/app/app.config.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cockpit/ag-ui/a2ui/angular/src/app/app.config.ts b/cockpit/ag-ui/a2ui/angular/src/app/app.config.ts index d4e7555ef..d22e769b1 100644 --- a/cockpit/ag-ui/a2ui/angular/src/app/app.config.ts +++ b/cockpit/ag-ui/a2ui/angular/src/app/app.config.ts @@ -4,5 +4,5 @@ import { provideAgent } from '@threadplane/ag-ui'; import { provideChat } from '@threadplane/chat'; export const appConfig: ApplicationConfig = { - providers: [provideAgent({ url: '/agent' }), provideChat({})], + providers: [provideAgent({ url: new URL('agent', document.baseURI).pathname }), provideChat({})], }; diff --git a/cockpit/ag-ui/client-tools/angular/src/app/app.config.ts b/cockpit/ag-ui/client-tools/angular/src/app/app.config.ts index 72f424e24..e90a93eaa 100644 --- a/cockpit/ag-ui/client-tools/angular/src/app/app.config.ts +++ b/cockpit/ag-ui/client-tools/angular/src/app/app.config.ts @@ -5,7 +5,7 @@ import { provideChat } from '@threadplane/chat'; export const appConfig: ApplicationConfig = { providers: [ - provideAgent({ url: '/agent' }), + provideAgent({ url: new URL('agent', document.baseURI).pathname }), provideChat({}), ], }; diff --git a/cockpit/ag-ui/interrupts/angular/src/app/app.config.ts b/cockpit/ag-ui/interrupts/angular/src/app/app.config.ts index 72f424e24..e90a93eaa 100644 --- a/cockpit/ag-ui/interrupts/angular/src/app/app.config.ts +++ b/cockpit/ag-ui/interrupts/angular/src/app/app.config.ts @@ -5,7 +5,7 @@ import { provideChat } from '@threadplane/chat'; export const appConfig: ApplicationConfig = { providers: [ - provideAgent({ url: '/agent' }), + provideAgent({ url: new URL('agent', document.baseURI).pathname }), provideChat({}), ], }; diff --git a/cockpit/ag-ui/json-render/angular/src/app/app.config.ts b/cockpit/ag-ui/json-render/angular/src/app/app.config.ts index d4e7555ef..d22e769b1 100644 --- a/cockpit/ag-ui/json-render/angular/src/app/app.config.ts +++ b/cockpit/ag-ui/json-render/angular/src/app/app.config.ts @@ -4,5 +4,5 @@ import { provideAgent } from '@threadplane/ag-ui'; import { provideChat } from '@threadplane/chat'; export const appConfig: ApplicationConfig = { - providers: [provideAgent({ url: '/agent' }), provideChat({})], + providers: [provideAgent({ url: new URL('agent', document.baseURI).pathname }), provideChat({})], }; diff --git a/cockpit/ag-ui/streaming/angular/src/app/app.config.ts b/cockpit/ag-ui/streaming/angular/src/app/app.config.ts index 72f424e24..e90a93eaa 100644 --- a/cockpit/ag-ui/streaming/angular/src/app/app.config.ts +++ b/cockpit/ag-ui/streaming/angular/src/app/app.config.ts @@ -5,7 +5,7 @@ import { provideChat } from '@threadplane/chat'; export const appConfig: ApplicationConfig = { providers: [ - provideAgent({ url: '/agent' }), + provideAgent({ url: new URL('agent', document.baseURI).pathname }), provideChat({}), ], }; diff --git a/cockpit/ag-ui/tool-views/angular/src/app/app.config.ts b/cockpit/ag-ui/tool-views/angular/src/app/app.config.ts index 72f424e24..e90a93eaa 100644 --- a/cockpit/ag-ui/tool-views/angular/src/app/app.config.ts +++ b/cockpit/ag-ui/tool-views/angular/src/app/app.config.ts @@ -5,7 +5,7 @@ import { provideChat } from '@threadplane/chat'; export const appConfig: ApplicationConfig = { providers: [ - provideAgent({ url: '/agent' }), + provideAgent({ url: new URL('agent', document.baseURI).pathname }), provideChat({}), ], };