[Bug]: v0.3 JSON-RPC compat adapter returns -32603 for all A2A errors (e.g. TaskNotFound should be -32001)
Maintainer thường phản hồi trong vòng 2 ngày
@shwetangsinha0509 đang làm issue này rồi.
Từ ngày 22/10/2026.
- #1369 của @shwetangsinha0509 — đang mở
Đánh giá
Issue này chưa được đánh giá.
Mô tả
What happened?
With create_jsonrpc_routes(..., enable_v0_3_compat=True), A2A errors raised while handling v0.3 JSON-RPC requests are returned as -32603 Internal error instead of their A2A error codes. The v1.0 dispatcher maps them correctly.
| Request | Expected | Actual |
|---|---|---|
v1.0 GetTask, unknown id |
-32001 |
-32001 |
v0.3 tasks/get, unknown id |
-32001 |
-32603 |
v0.3 tasks/cancel, unknown id |
-32001 |
-32603 |
v0.3 message/send with unknown taskId |
-32001 |
-32603 |
v0.3 tasks/resubscribe, streaming not supported |
-32004 |
-32603 |
A v0.3 client therefore cannot distinguish "task not found" from a server failure; the SDK's own v0.3 JsonRpcTransport maps the code back to InternalError instead of TaskNotFoundError.
Cause: in src/a2a/compat/v0_3/jsonrpc_adapter.py, A2AErrors from the request handler fall through to the generic except Exception in handle_request (and in the streaming event_generator), which wraps them in InternalError. JsonRpcDispatcher handles A2AError explicitly, and the v0.3 gRPC handler maps them via _ERROR_CODE_MAP.
Reproduction (main @ 261c074, also 1.2.2):
from starlette.applications import Starlette
from starlette.testclient import TestClient
from a2a.server.agent_execution import AgentExecutor
from a2a.server.request_handlers import DefaultRequestHandler
from a2a.server.routes import create_jsonrpc_routes
from a2a.server.tasks import InMemoryTaskStore
from a2a.types import AgentCapabilities, AgentCard
class NoopExecutor(AgentExecutor):
async def execute(self, context, event_queue): ...
async def cancel(self, context, event_queue): ...
card = AgentCard(name='t', description='t', version='1', capabilities=AgentCapabilities())
handler = DefaultRequestHandler(agent_executor=NoopExecutor(), task_store=InMemoryTaskStore(), agent_card=card)
app = Starlette(routes=create_jsonrpc_routes(request_handler=handler, rpc_url='/', enable_v0_3_compat=True))
client = TestClient(app)
def call(method, params, version):
body = {'jsonrpc': '2.0', 'id': '1', 'method': method, 'params': params}
return client.post('/', json=body, headers={'A2A-Version': version}).json()['error']['code']
print(call('GetTask', {'id': 'missing'}, '1.0')) # -32001
print(call('tasks/get', {'id': 'missing'}, '0.3')) # -32603, expected -32001
Expected: A2A errors keep their JSON-RPC codes on the v0.3 path. Errors that only exist in v1.0 (e.g. -32009 VersionNotSupported) should stay -32603, since v0.3 clients don't know those codes.
I have a fix with tests ready and will open a PR referencing this issue.
Relevant log output
-32001
-32603
Code of Conduct
- I agree to follow this project's Code of Conduct
- Ngôn ngữ chính
- Python
- Star
- 2.2k
- Fork
- 518
- Merge trung bình
- 3 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 38
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của a2aproject/a2a-python
-
[Bug]: `A2A-Version` validation ignores minor versions and the query parameterCó thể đã có người làm @rohityan đã nhận 61 ngày trước. Đang mởcomponent: server status:awaiting response
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
a2aproject/a2a-python#1204 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: REST task/request id sanitizationCó thể đã có người làm @Linux2010 đã nhận 120 ngày trước. Đang mởmaintainers-only
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
a2aproject/a2a-python#805 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
v0.3 REST GetTask returns 500 for a non-integer historyLengthCó thể đã có người làm @rohityan đã nhận hôm nay. Đang mở
a2aproject/a2a-python#1381 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
v0.3 pushNotificationConfig/get by task id fails with Validation failedCó thể đã có người làm @rohityan đã nhận hôm nay. Đang mở
a2aproject/a2a-python#1379 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug]: REST tenant routes are mounted before `path_prefix`, so tenant requests from the SDK client get 404Có thể đã có người làm @rohityan đã nhận hôm nay. Đang mở
a2aproject/a2a-python#1376 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của a2aproject/a2a-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
NVIDIA/flare-local-inference#90 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/streaming comp/gateway P2 platform/telegram type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NousResearch/hermes-agent#144897 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
request-theme
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 66/100
LizardByte/ThemerrDB#9575 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Author Page: noshin-nawalĐang mởauthor-page correction
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
acl-org/acl-anthology#10599 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
zilliztech/memsearch#818 ·
Maintainer thường phản hồi trong vòng 1 ngày