Skip to content

fix(errors): align error mappings with A2A spec #1055

Merged
sokoliva merged 2 commits intoa2aproject:mainfrom
sokoliva:grpc-error-fix
May 6, 2026
Merged

fix(errors): align error mappings with A2A spec #1055
sokoliva merged 2 commits intoa2aproject:mainfrom
sokoliva:grpc-error-fix

Conversation

@sokoliva
Copy link
Copy Markdown
Member

@sokoliva sokoliva commented May 6, 2026

Description

Aligns A2A error mappings with the canonical mapping in A2A spec.

Changes

  • grpc_handler.py _ERROR_CODE_MAP: PushNotificationNotSupportedError, UnsupportedOperationError, VersionNotSupportedError → FAILED_PRECONDITION (was UNIMPLEMENTED).
  • errors.py A2A_REST_ERROR_MAPPING: same three errors' gRPC status updated to FAILED_PRECONDITION; TaskNotCancelableError HTTP 409 → 400; InvalidAgentResponseError HTTP 502 → 500.
  • test_grpc_handler.py: updated parametrized expectations for the two affected gRPC test cases.

Issue #1027 🦕

sokoliva added 2 commits May 6, 2026 09:51
@sokoliva sokoliva requested a review from a team as a code owner May 6, 2026 10:01
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the error mapping for several exception types across gRPC and REST handlers, primarily shifting statuses from UNIMPLEMENTED to FAILED_PRECONDITION and adjusting various HTTP status codes. Feedback indicates that VersionNotSupportedError is missing from the test suite and that exception classes in tests should be referenced without instantiation to comply with project style guidelines.

Comment thread tests/server/request_handlers/test_grpc_handler.py
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/server/events/event_queue_v2.py 91.19% 91.71% 🟢 +0.52%
src/a2a/utils/telemetry.py 90.63% 91.41% 🟢 +0.78%
Total 93.01% 93.03% 🟢 +0.02%

Generated by coverage-comment.yml

@sokoliva sokoliva merged commit 4e01a91 into a2aproject:main May 6, 2026
34 checks passed
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