Repository navigation
Python: allow empty A2A attachment payloads - #9056
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit intoOct 12, 2026
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
Conversation
fhgffy
marked this pull request as ready for review
October 5, 2026 13:13
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The narrowly scoped parser change preserves existing validation and has targeted regression coverage for both affected conversion paths.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes #9054 by allowing zero-byte attachments through Python’s A2A integration without changing other URI validation rules.
Changes:
- Allow empty base64 payloads in the URI parser.
- Add regression coverage for parsing, both client streaming modes, and executor binary output.
| File | Description |
|---|---|
python/packages/a2a/tests/test_utils.py |
Tests empty payloads with and without media-type parameters. |
python/packages/a2a/tests/test_a2a_executor.py |
Checks empty and nonempty raw binary output. |
python/packages/a2a/tests/test_a2a_agent.py |
Tests empty attachments in both streaming modes. |
python/packages/a2a/agent_framework_a2a/_utils.py |
Allows zero payload characters in data URIs. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Eduard van Valkenburg (eavanvalkenburg)
approved these changes
Oct 12, 2026
This branch was previously 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.
Motivation & Context
Sending or returning a zero-byte attachment through A2A raises
ValueError.Content.from_data()accepts empty bytes, but the A2A URI parser rejects the resulting empty base64 payload.Description & Review Guide
A2AAgent.run()in both streaming modes; extend the executor test to check empty and nonempty binary parts.Related Issue
Fixes #9054
Automated triage reproduced the issue; maintainer agreement to implement it has not been recorded.
AI Assistance
AI assistance details: AI assisted the issue analysis, implementation, regression tests, and PR description. The reported checks were run against the checkout.
Contribution Checklist