ClientCitation deserialization fails when Copilot Studio citation contains @id: "ClientCitation" object has no field "at_id"
Chưa có ai nhận issue này.
Đá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
- 70/100
Hướng nghiên cứu
Vấn đề nằm ở trình xác thực _SchemaMixin trong microsoft_agents.activity.entity._schema_mixin. Hãy xem xét hàm validate_schema_model nơi nó xử lý thuộc tính @id. Lớp ClientCitation trong microsoft_agents.activity.entity.ai_entity thiếu trường at_id. Kiểm tra xem trường này có nên được thêm vào mô hình hay trình xác thực nên bỏ qua việc đặt at_id khi trường không được định nghĩa. Chạy các tập lệnh tái tạo từ kho lưu trữ được liên kết để xác minh bản sửa lỗi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
When using the Microsoft Agents SDK with a signed-in Microsoft user to invoke a Copilot Studio agent, some Copilot Studio responses contain citations with an @id property.
Those responses fail during Activity deserialization with:
entities.citation.0
Value error, "ClientCitation" object has no field "at_id"
The Copilot Studio request itself succeeds and a response is returned. The exception occurs while the Python SDK is deserializing the returned Activity.
The issue can also be reproduced locally without a Microsoft tenant, authentication, Copilot Studio, or any network request.
Environment
Originally observed with:
microsoft-agents-copilotstudio-client==1.5.0
microsoft-agents-activity==1.5.0
pydantic==2.13.4
Python 3.14
I also tested after upgrading to:
microsoft-agents-copilotstudio-client==1.7.0
and the same ClientCitation / at_id exception is still reproduced.
Reproduction repository
A standalone reproduction is available here:
https://github.com/abdurrafay0610/microsoft-agents-activity-sdk-issue-recreation
The repository contains the minimal reproduction, Activity-level reproduction, requirements, and additional diagnostic information.
To reproduce:
git clone https://github.com/abdurrafay0610/microsoft-agents-activity-sdk-issue-recreation.git
cd microsoft-agents-activity-sdk-issue-recreation
pip install -r requirements.txt
python reproduce.py
python reproduce_activity.py
No Microsoft credentials, tenant, or Copilot Studio agent are required for the standalone reproduction.
Input that triggers the failure
The relevant portion of the citation returned by Copilot Studio has this shape:
{
"@type": "Claim",
"@id": "turn16search0",
"position": 1,
"appearance": {
"@type": "DigitalDocument",
"name": "Example citation"
}
}
The important property is:
"@id": "turn16search0"
SDK deserialization path
microsoft-agents-copilotstudio-client receives the Copilot Studio SSE Activity response in:
microsoft_agents.copilotstudio.client.copilot_client.CopilotClient.post_request()
The Activity JSON is then passed to:
Activity.model_validate_json(activity_data)
During Activity validation, the citation is deserialized as:
microsoft_agents.activity.entity.ai_entity.ClientCitation
ClientCitation uses _SchemaMixin.
The relevant validation helper is:
microsoft_agents.activity.entity._schema_mixin.validate_schema_model
When @id is present in the input, the helper attempts:
setattr(model, "at_id", data["@id"])
However, ClientCitation defines:
at_type
position
appearance
and does not define an at_id field.
The assignment therefore results in:
Value error, "ClientCitation" object has no field "at_id"
Documentation / implementation mismatch
The _SchemaMixin validator describes its behavior as handling @type, @context, and @id when those properties are defined in the destination type.
However, for @id, the implementation attempts to assign at_id when the property is present in the input, without first establishing that the destination model defines at_id.
For ClientCitation, the destination model does not define that field.
Expected behavior
A Copilot Studio Activity containing a citation with the returned @id property should be deserialized without the SDK raising an exception.
Actual behavior
Activity deserialization fails with:
entities.citation.0
Value error, "ClientCitation" object has no field "at_id"
This prevents the application from consuming an otherwise successfully returned Copilot Studio response.
Additional details
The full failure path and standalone examples are documented in the reproduction repository:
https://github.com/abdurrafay0610/microsoft-agents-activity-sdk-issue-recreation
One thing I would definitely fix before submitting is the `repro.py` → `reproduce.py` filename mismatch, because otherwise the first thing a Microsoft maintainer sees when following the instructions is an unrelated `No such file` error.
- Ngôn ngữ chính
- Python
- Star
- 211
- Fork
- 90
- Merge trung bình
- 2 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 16
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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/Agents-for-python
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
microsoft/Agents-for-python#602 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
microsoft/Agents-for-python#601 ·
-
microsoft/Agents-for-python#587 · 1 người được giao ·
-
microsoft/Agents-for-python#559 · 1 người được giao ·
-
microsoft/Agents-for-python#550 · 1 người được giao ·
Tất cả issue của microsoft/Agents-for-python
Issue tương tự
-
bug priority:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
CyberAgent/psd2svg#436 ·
-
area/install-update comp/cli comp/desktop P3 sweeper:risk-compatibility type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
NousResearch/hermes-agent#122386 · 1 bình luận ·
-
ai-generated
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
vllm-project/production-stack#1105 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100