Repository navigation
fix(client): preserve rich gRPC error metadata - #1503
Open
Harshil-1603 wants to merge 1 commit into
Open
Harshil-1603 wants to merge 1 commit into
Harshil-1603 wants to merge 1 commit into
Conversation
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/client/transports/grpc.py | 92.75% | 93.75% | 🟢 +1.00% |
| Total | 93.81% | 93.82% | 🟢 +0.01% |
Generated by coverage-comment.yml
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The v1 gRPC client maps an A2A
google.rpc.ErrorInforeason to the correct exception, but discards its metadata. For example, a peer returningTaskNotFoundErrorwithmetadata={"taskId": "job-1"}produces an exception withdata=None, losing the supplied context.Change
Preserve metadata from the
a2a-protocol.orgerror domain inA2AError.data. Keep structuredBadRequestfield violations when metadata contains anerrorskey, regardless of detail order. Foreign-domain metadata remains excluded, and empty metadata still producesdata=None.Add 16 regression cases using a local gRPC server and the public client transport, covering unary and streaming calls, detail order, field violations, foreign domains, and empty metadata. Before the fix, 12 cases failed and the four empty-metadata controls passed.
Validation
git diff --checkpassed.The skipped database profiles require external PostgreSQL/MySQL DSNs. Hosted CI and maintainer review are pending.