Repository navigation
fix(a2a): return JSON 404 for unsupported /a2a/v1 paths - #193128
jerome-queck wants to merge 7 commits into
Conversation
Exact registration left descendants to the root Control UI, which answered GET /a2a/v1/agent-card with HTML 200. Prefix registration keeps the existing plugin JSON 404 for that namespace. Fixes openclaw#193086 Co-authored-by: Jerome <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesThe A2A plugin claims the /a2a/v1 prefix so unsupported descendants return JSON 404 responses instead of Control UI HTML. Example: GET /a2a/v1/agent-card while the configured A2A account is running.
Review scores
ProductKind: Bug fix · Worth it: No · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open. PR close coverage proof kept this PR open against #193102: PR B carries the production repair, but the available evidence does not establish coverage of PR A's useful independent integration regression tests. Linking their evidence does not preserve that test coverage. Priority: P2 Before merge
FindingsNone. Agent review detailsHow this fits togetherGateway HTTP dispatch matches registered plugin routes before the Control UI fallback; the A2A account owns registration, JSON responses, and route removal on shutdown. flowchart TD
A[HTTP request] --> B[Gateway route matching]
B --> C[A2A prefix handler]
B --> D[Control UI fallback]
C --> E[JSON 404 for unsupported paths]
C --> F[Discovery and authenticated RPC]
Technical reviewBest possible solution: Keep this PR open until a linked canonical PR proves it covers this PR's unique work, or a maintainer confirms closure. Do we have a high-confidence way to reproduce the issue? Current-main exact registration excludes descendants from the existing JSON 404 handler, and both contributors supplied running-Gateway evidence; no target code was executed during this review. Is this the best way to solve the issue? Selecting existing prefix matching at the A2A registration owner is the smallest complete production fix, already provided by the replacement PR. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6769a6931910. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +158, Tests +129, Docs 0, Config +3, Other +6. Total +296 across 11 files. Added test files: 1. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 5, 2026, 3:19 AM ET / 08:19 UTC (Revision 2). |
The gateway test imported the bundled A2A plugin, so the core-test-gateway-server tsgo graph included extension sources. The same JSON 404 proof now runs from the plugin, and a 49-line test allocation covers the lines past the remaining ceiling slack. Receipt: oc-555-uplift-t1061 Co-authored-by: Jerome <[email protected]>
Extension tests cannot import the Gateway harness, and core type graphs cannot import the bundled plugin. The same JSON 404 proof now lives under test/. The test-line allocation is 129, matching this branch's delta. Receipt: oc-555-uplift-t1061 Co-authored-by: Jerome <[email protected]>
Root tests cannot import the bundled plugin, and plugin tests cannot import core Gateway files. A private plugin-sdk HTTP fixture keeps the JSON 404 proof next to A2A. The test-line allocation is 125, matching the delta. Receipt: oc-555-uplift-t1061 Co-authored-by: Jerome <[email protected]>
Stop re-exporting the core harness so plugin-sdk declaration emit does not pull server-request-context.test-support. Register the package-boundary alias and match the test-line allocation to this branch's delta. Co-authored-by: Jerome <[email protected]>
Rename the plugin server helper so it does not collide with the gateway test helper, drop the chained response assertions, and copy the new package-boundary alias into the xai map. Co-authored-by: Jerome <[email protected]>
The assertion-safety ratchet requires a SAFETY comment on the new ServerResponse cast. Co-authored-by: Jerome <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Gateway regression suite ported onto HeMiaolin's canonical #193102 via HeMiaolin#1 (against their branch). Leaving this PR open until that lands / a maintainer wants it closed. |
…3102 Port the table-driven Gateway suite and plugin-sdk HTTP helper from openclaw#193128 onto this branch. No production-fix changes.
Fixes #193086
What Problem This Solves
Fixes an issue where a GET to
/a2a/v1/agent-cardreturned HTTP 200 and the Control UI HTML document. Documented discovery and JSON-RPC routes already behaved correctly:GET /a2a/v1is a JSON 404,/.well-known/agent-card.jsonand/.well-known/agent.jsonreturn agent cards, andPOST /a2a/v1is JSON-RPC.Why This Change Was Made
The configured A2A plugin now claims
/a2a/v1through the existing prefix registration contract. Unsupported descendants reach the plugin's existing JSON 404. The well-known discovery routes stay exact matches. The generic Control UI router is unchanged.User Impact
While the A2A account is running, unsupported paths under
/a2a/v1— includingGET /a2a/v1/agent-card— returnapplication/jsonwith HTTP 404 and{ "error": "Not found" }, for missing and wildcardAcceptheaders. Neighboring paths such as/a2a/v10and ordinary Control UI routes still serve the SPA. After the account stops, the namespace is released.Evidence
pnpm test src/gateway/server-http.a2a-namespace.test.tsfailed with Control UI enabled and a realindex.html:GET /a2a/v1/agent-card(absentAccept) expected 404 and received 200.*/*Acceptheaders, exactGET /a2a/v1JSON 404, both well-known agent cards,GET /a2a/v1/.well-known/agent-card.jsonJSON 404, unauthenticatedPOST /a2a/v1, SPA responses for/chatand/a2a/v10, and the descendant returning the SPA again after the account stops.pnpm test extensions/a2a/src/gateway.test.ts extensions/a2a/src/http.test.tspassed (45 tests).Live Gateway proof (Linux, isolated)
Built this branch (
OpenClaw 2026.10.10 (ce3e7d9)), ran Gateway on loopback port18991with an isolated state directory,gateway.auth.mode=none, Control UI enabled, and the A2A plugin started (http server listening (1 plugin: a2a;[a2a] [default] starting account (reason: startup)). Synthetic/local only; no provider keys or non-public endpoints.While A2A was running:
GET /a2a/v1/agent-card(noAccept, andAccept: */*)404application/json; charset=utf-8{"error":"Not found"}GET /a2a/v1404GET /a2a/v1/.well-known/agent-card.json404GET /.well-known/agent-card.jsonandGET /.well-known/agent.json200JSON agent cards; interface URL ends in/a2a/v1POST /a2a/v1with no bearer401JSONGET /chatandGET /a2a/v10200text/htmlControl UI (<!doctype html>…)After
channels.stopfora2a/default({"stopped":true}):GET /a2a/v1/agent-card→200text/html(namespace released to Control UI)GET /.well-known/agent-card.json→404text/plainNot FoundGET /chatstayed HTMLAfter
channels.start({"started":true}),GET /a2a/v1/agent-cardwas JSON404again. Gateway stopped afterward.