Skip to content

fix(a2a): proxy /a2a + /.well-known to server in vite dev#59

Open
Mingholy wants to merge 1 commit into
mainfrom
fix/a2a-vite-dev-proxy
Open

fix(a2a): proxy /a2a + /.well-known to server in vite dev#59
Mingholy wants to merge 1 commit into
mainfrom
fix/a2a-vite-dev-proxy

Conversation

@Mingholy

Copy link
Copy Markdown
Owner

Problem

A2A endpoints (agent card + JSON-RPC) are mounted at root paths (/a2a/<user>/...), not under /api. The vite dev server only proxies /api and /ws to the bun server, so in vite-dev-served setups A2A requests fall through to the SPA fallback:

  • GET /a2a/<user>/agent-card.json → returns the SPA's HTML instead of JSON
  • POST /a2a/<user> (JSON-RPC) → 404

Bun-served production is unaffected — the bun server fronts everything on one port there.

Fix

Add /a2a and /.well-known to the vite dev proxy, pointing at the same bun server target as /api.

Note for review: strictly only /a2a is required by current routes (the well-known card lives at /a2a/:user/.well-known/agent-card.json, under the /a2a prefix). The /.well-known entry is kept as a forward-looking reservation for the A2A spec convention of a domain-root /.well-known/agent-card.json; drop it if you prefer the minimal change.

Provenance

Cherry-picked from the internal fork (original commit ec3d5f7), author mapped to their open-source identity. The diff is 4 lines in web/vite.config.ts with no internal-only content.

🤖 Generated with Claude Code

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/<user> 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 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants