From c80b3ff0eba5c59be96d4bd5bf45150c89f134e0 Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Mon, 27 Apr 2026 09:33:23 -0700 Subject: [PATCH] fix: pass rpc_url='/' to create_jsonrpc_routes (a2a-sdk 1.x requirement) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7th a2a-sdk migration find from the v0 → v1 transition. create_jsonrpc_routes() now requires rpc_url as a positional arg (was implicit at root in 0.x). Pass '/' to match a2a.utils.constants.DEFAULT_RPC_URL — that's also what workspace-server's a2a_proxy.go forwards to (POSTs to workspace URL without appending a path). Symptom before fix: every workspace startup crashed with TypeError: create_jsonrpc_routes() missing 1 required positional argument: 'rpc_url' Caught by harness 9 phase 4 (claude-code + langgraph both on 0.1.24). The user's "use langgraph for fast iteration" call cut the diagnose cycle from 15min to ~30s — without that, this would have taken another hermes round-trip to surface. Updated reference_a2a_sdk_v0_to_v1_migration.md memory with this entry alongside the previous 6 finds. Co-Authored-By: Claude Opus 4.7 (1M context) --- workspace/main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/workspace/main.py b/workspace/main.py index c90dd4ce..23b278ef 100644 --- a/workspace/main.py +++ b/workspace/main.py @@ -242,10 +242,16 @@ async def main(): # pragma: no cover agent_card=agent_card, ) - # v1: replace A2AStarletteApplication with Starlette route factory + # v1: replace A2AStarletteApplication with Starlette route factory. + # rpc_url is required in a2a-sdk 1.x (was implicit at root in 0.x). + # Use '/' to match a2a.utils.constants.DEFAULT_RPC_URL — that's also + # what the platform's a2a_proxy.go POSTs to (it forwards to the + # workspace's URL without appending a path). Card endpoint stays at + # the well-known path /.well-known/agent-card.json (handled by + # create_agent_card_routes default). routes = [] routes.extend(create_agent_card_routes(agent_card)) - routes.extend(create_jsonrpc_routes(request_handler=handler)) + routes.extend(create_jsonrpc_routes(request_handler=handler, rpc_url="/")) app = Starlette(routes=routes) # 8. Register with platform