From fa1c28201635555036654a32c065b24b15210245 Mon Sep 17 00:00:00 2001 From: pangpangDaddy Date: Tue, 2 Jun 2026 16:36:07 +0800 Subject: [PATCH] fix(a2a): proxy /a2a + /.well-known to server in vite dev A2A endpoints (agent card + JSON-RPC) are mounted at root paths, not under /api. In vite-dev-served setups only /api and /ws are proxied to the bun server, so A2A requests were swallowed by the SPA fallback (agent-card.json returned HTML, POST /a2a/ returned 404). Add /a2a and /.well-known to the dev proxy. Bun-served production was unaffected since the bun server fronts everything there. Co-Authored-By: Claude Opus 4.8 Co-Authored-By: Claude Fable 5 --- web/vite.config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/vite.config.ts b/web/vite.config.ts index f487466a..ec7d541e 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -33,6 +33,10 @@ export default defineConfig({ allowedHosts: [".ngrok-free.app"], proxy: { "/api": { target: `http://${process.env.HOST ?? "localhost"}:${process.env.PORT ?? 10001}` }, + // A2A endpoints live at root paths (not under /api): proxy them to the + // bun server so the agent card + JSON-RPC work in vite-dev-served envs. + "/a2a": { target: `http://${process.env.HOST ?? "localhost"}:${process.env.PORT ?? 10001}` }, + "/.well-known": { target: `http://${process.env.HOST ?? "localhost"}:${process.env.PORT ?? 10001}` }, "/ws": { target: `ws://${process.env.HOST ?? "localhost"}:${process.env.PORT ?? 10001}`, ws: true,