fix(a2a): align A2A endpoint with JSON-RPC 2.0 wire format changes
- Fix asgi_app.py: use a2a_request.method instead of a2a_request.operation (A2aRequest model was updated in master to use JSON-RPC 2.0 field names) - Fix server_lifecycle_steps.py: send JSON-RPC 2.0 wire format with "method" field; check result.status instead of top-level status - Fix server_lifecycle.feature: update step name to match new step definition (A2A response result status) - Fix helper_server_lifecycle.py: use "method" field in JSON-RPC 2.0 payload; check result.status in response
This commit is contained in:
@@ -60,11 +60,18 @@ def _test_a2a_dispatch() -> None:
|
||||
|
||||
app = create_asgi_app()
|
||||
client = TestClient(app)
|
||||
payload = {"jsonrpc": "2.0", "method": "_cleveragents/health/check", "params": {}}
|
||||
# JSON-RPC 2.0 wire format: use "method" field
|
||||
payload = {
|
||||
"jsonrpc": "2.0",
|
||||
"method": "_cleveragents/health/check",
|
||||
"params": {},
|
||||
}
|
||||
resp = client.post("/a2a", json=payload)
|
||||
assert resp.status_code == 200
|
||||
data = resp.json()
|
||||
assert data["result"]["status"] == "healthy"
|
||||
# JSON-RPC 2.0 response: result is nested under "result"
|
||||
result = data.get("result") or {}
|
||||
assert result.get("status") == "healthy", f"Unexpected response: {data}"
|
||||
print("a2a-dispatch-ok")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user