Repository navigation
Description
Observed Behavior
When a remote A2A agent returns a raw file part without media_type (it's optional in A2A), A2AAgent turns it into data content with the URI data:;base64,.... Passing that content on to another A2A agent then fails with ValueError: Invalid data URI format, because get_uri_data needs a media type. Serving it through A2AExecutor fails the same way.
Expected Behavior
The file can be passed on. A raw part with no media type could default to application/octet-stream, like the AG-UI message adapter already does.
Steps to Reproduce
- Have a remote A2A agent return a raw file part without
media_type - Run
A2AAgentagainst it - Send the returned content to another
A2AAgent
Minimal Reproduction
import asyncio
from a2a.types import Artifact, Part, StreamResponse, Task, TaskState, TaskStatus
from agent_framework import Message
from agent_framework_a2a import A2AAgent
class FakeClient:
"""Remote A2A agent that returns a file part without media_type (it's optional in A2A)."""
async def send_message(self, request):
yield StreamResponse(
task=Task(
id="task-1",
context_id="ctx",
status=TaskStatus(state=TaskState.TASK_STATE_COMPLETED),
artifacts=[Artifact(artifact_id="a1", parts=[Part(raw=b"%PDF-1.7 ...", filename="report.pdf")])],
)
)
async def main():
response = await A2AAgent(name="remote", client=FakeClient()).run("make me a report")
file = response.messages[0].contents[0]
print("received:", file.uri)
# Pass the file on to another A2A agent.
await A2AAgent(name="other", client=FakeClient()).run(Message(role="user", contents=[file]))
print("forwarded ok")
asyncio.run(main())Error Messages and Stack Traces
received: data:;base64,JVBERi0xLjcgLi4u
Traceback (most recent call last):
...
File ".../agent_framework_a2a/_agent.py", line 1269, in _prepare_message_for_a2a
File ".../agent_framework_a2a/_utils.py", line 26, in get_uri_data
raise ValueError(f"Invalid data URI format: {uri}")
ValueError: Invalid data URI format: data:;base64,JVBERi0xLjcgLi4u
Package Versions
agent-framework-core 1.25.0, agent-framework-a2a 1.0.0b261106 (main at fe87fdd), a2a-sdk 1.2.3
Python Version
Python 3.12
Operating System
macOS
Regression
No
Additional Context
The raw case in _parse_contents_from_a2a uses media_type=part.media_type or "". I have a fix with a test and will open a PR.
AI assistance: I used an AI assistant to help find the cause and write this up. I ran the repro myself.
Acknowledgements
- I searched existing issues and did not find a duplicate.
- I personally verified this behavior and the reproduction details are authentic.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
github-actions commentedon Nov 10, 2026
Reproduced on main (fe87fdd) with an independently written fake-client test: a raw A2A part without
media_typebecomes(redacted) and forwarding it to anotherA2AAgentraisesValueError: Invalid data URI format(agent.pymediatype=part.media_type or ""→utils.geturi_data). Routed to theagent-framework-a2a` owner. Support boundary: unclear — no maintained spec/doc checked here establishes it; a maintainer should decide. Fix PR #10251 is open and not yet merged or released. Run: https://github.com/microsoft/agent-framework/actions/runs/42881732010