Repository navigation
Conversation
…ot decode A card served as Latin-1 raised UnicodeDecodeError and a deeply nested card raised RecursionError from get_agent_card, because only json.JSONDecodeError was caught. Catch all three around response.json(), so an error raised by the caller's signature_verifier is not relabelled. Fixes a2aproject#1478 Signed-off-by: Christopher Krah <48338417+chrikrah@users.noreply.github.com>
On Python 3.14 the C recursion guard is bounded by stack size, so a body nested 100,000 deep decodes on CI runners and the deep-nesting case never reached the RecursionError branch. Raise it from response.json() instead, and keep the Latin-1 case on a real body. Signed-off-by: Christopher Krah <48338417+chrikrah@users.noreply.github.com>
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/server/cluster/database_event_stream.py | 96.36% | 93.64% | 🔴 -2.73% |
| Total | 94.19% | 94.17% | 🔴 -0.03% |
Generated by coverage-comment.yml
Iwaniukooo11
requested changes
Nov 27, 2026
Iwaniukooo11
left a comment
Member
There was a problem hiding this comment.
Overall LGTM - Update PR body as you removed 100k- nesting test
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.
Description
get_agent_card()now raisesAgentCardResolutionErrorfor a card body thatresponse.json()rejects withUnicodeDecodeError(not UTF-8) orRecursionError(deep nesting), with the same message as aJSONDecodeError.The deep-nesting test uses 100,000 levels: on Python 3.14, 10,000 levels decode without error, which fits the 3.14 failure that removed the
RecursionErrortest from #1523.@rohityan this follows your note on #1478: the three exceptions are caught around
response.json()only, so aJSONDecodeErrorfrom asignature_verifiernow propagates where it used to read "Failed to parse JSON for agent card". Once the workflows run I will watch the 3.14 job, since that is where #1523's recursion test broke.CONTRIBUTINGGuide.bash scripts/format.shfrom the repository root to format)Fixes #1478