Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Python: raw-data content mappings lose annotations and attachment metadata

Open Beginner friendly
#8,632 2 comments 0 reactions 0 assignees View on GitHub

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
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

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

python triage
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/agent-framework

All issues in microsoft/agent-framework

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.