Python: raw-data content mappings lose annotations and attachment metadata
Maintainers usually reply within 1 day
@moonbox3 is already working on this.
Since Sep 29, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start with the raw-data branch in Content.from_dict and compare its delegation to Content.from_data, then trace how Message builds contents from mappings. Add regression coverage for direct parsing and Message inputs, verifying annotations, additional_properties, and raw_representation are preserved while the binary payload remains correctly encoded.
Written by the indexing model from the issue text.
Description
Description
Passing a raw-data content mapping to Content.from_dict or Message silently drops annotations, additional_properties, and raw_representation. The equivalent Content.from_data call preserves all three.
This loses useful file metadata such as additional_properties["filename"], which file adapters and Content Understanding use to identify attachments.
Code Sample
from agent_framework import Content, Message
raw = object()
data = {
"type": "data",
"data": b"test data",
"media_type": "text/plain",
"annotations": [{"type": "citation", "title": "Source document", "file_id": "file-123"}],
"additional_properties": {"filename": "document.txt"},
"raw_representation": raw,
}
for content in (Content.from_dict(data), Message("user", [data]).contents[0]):
print(content.annotations, content.additional_properties, content.raw_representation is raw)
Expected: the supplied annotations, {"filename": "document.txt"}, and True.
Actual: None {} False for both parsing paths. The binary payload itself is correctly encoded.
Error Messages / Stack Traces
No exception is raised; the metadata is silently discarded.
Package Versions
agent-framework-core 1.19.0, reproduced from main at 98a982a.
Python Version
Python 3.12.13, macOS arm64.
Additional Context
The raw-data branch in Content.from_dict delegates to cls.from_data without forwarding the three metadata fields it has already extracted. I am preparing a small fix with regression coverage for both direct parsing and Message inputs. Passing a Content.from_data(...) instance directly is a workaround.
- Dominant language
- Python
- Stars
- 13.6k
- Forks
- 2.3k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 455
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/agent-framework
-
Python: declarative Search() treats a falsy value (0, 0.0, False) as Blank and returns every rowOpenpython triage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
microsoft/agent-framework#8973 ·
Maintainers usually reply within 1 day
-
Python: Clarify when to use platformPossibly taken @eavanvalkenburg claimed this 3 days ago. Openpython triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/agent-framework#8599 · 1 comment ·
Maintainers usually reply within 1 day
-
.NET compaction documentation
Difficulty 1/5 Under an hour Newbie friendliness 82/100
microsoft/agent-framework#4629 · 1 comment ·
Maintainers usually reply within 1 day
-
Python: [Bug]: AG-UI mixed middleware warning test depends on test orderPossibly taken @eavanvalkenburg claimed this today. Openag-ui python reproduced
microsoft/agent-framework#9000 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Python: [Bug]: Terminal A2A Task snapshots omit status messagesPossibly taken @eavanvalkenburg claimed this today. Opena2a python reproduced
microsoft/agent-framework#8998 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
All issues in microsoft/agent-framework
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-plugin-claude-subscription-directsdk#94 ·
Maintainers usually reply within 1 day
-
namespace operations
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
EclipseFdn/open-vsx.org#13702 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
modelscope/ms-swift#10287 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
modelscope/FunASR#3757 ·
Maintainers usually reply within 1 day