Python: raw-data content mappings lose annotations and attachment metadata
Maintainer thường phản hồi trong vòng 1 ngày
@moonbox3 đang làm issue này rồi.
Từ ngày 29/9/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Bắt đầu với nhánh raw-data trong Content.from_dict và so sánh việc ủy quyền của nó cho Content.from_data, sau đó theo dõi cách Message xây dựng contents từ mappings. Thêm kiểm thử hồi quy cho việc phân tích trực tiếp và các đầu vào của Message, xác minh rằng annotations, additional_properties và raw_representation được giữ nguyên trong khi payload nhị phân vẫn được mã hóa chính xác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 14.2k
- Fork
- 2.5k
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 384
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/agent-framework
-
Python: [Bug]: A non-positive MCP request timeout silently disables the timeoutCó thể đã có người làm @jpalvarezl đã nhận 6 ngày trước. Đang mởpython
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
microsoft/agent-framework#9313 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
.NET: Proposal: add an llms.txtĐang mở.NET python triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
microsoft/agent-framework#9092 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Python: Clarify when to use platformCó thể đã có người làm @eavanvalkenburg đã nhận 19 ngày trước. Đang mởpython triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoft/agent-framework#8599 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
.NET compaction documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
microsoft/agent-framework#4629 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Dependency bounds test failedĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
microsoft/agent-framework#9519 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/agent-framework
Issue tương tự
-
Issue Triage-Needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
pulp/pulp_container#2581 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
521xueweihan/HelloGitHub#4040 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
ClanGenOfficial/clangen#6313 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(trainer): CustomTrainer func_args with non literal values fail inside the TrainJobCó thể đã có người làm @avanishkasar đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
kubeflow/sdk#879 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày