Repository navigation
Python: fix: write enum value in annotation XML type attribute - #14593
Open
CRYPTONIKAV wants to merge 1 commit into
Open
CRYPTONIKAV wants to merge 1 commit into
CRYPTONIKAV wants to merge 1 commit into
Conversation
CRYPTONIKAV
temporarily deployed
to
github-app-auth
October 13, 2026 23:09 — with
GitHub Actions
Inactive
CRYPTONIKAV
temporarily deployed
to
github-app-auth
October 13, 2026 23:09 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix correctly addresses the reported serialization failure with regression coverage for both affected classes.
0 open findings
What changed in this PR
Fixes XML serialization of citation types so annotation content can round-trip through rendered prompts.
Changes:
- Serializes
CitationType.valuein XML attributes. - Adds serialized-XML round-trip tests for both annotation classes.
| File | Description |
|---|---|
python/semantic_kernel/contents/annotation_content.py |
Writes valid citation type values to XML. |
python/semantic_kernel/contents/streaming_annotation_content.py |
Applies the same fix to streaming annotations. |
python/tests/unit/contents/test_annotation_content.py |
Tests serialized XML round-tripping. |
python/tests/unit/contents/test_streaming_annotation_content.py |
Tests streaming annotation round-tripping. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Author
|
@microsoft-github-policy-service agree |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #14590
What I changed
python/semantic_kernel/contents/annotation_content.py+streaming_annotation_content.py:to_element()now writesself.citation_type.valueinstead of the enum object (which serialized asCitationType.FILE_CITATIONand brokefrom_elementround trips through rendered prompts).tostring→fromstring→from_element) for both classes. The existing in-memory round trips never caught this because the enum survived without serialization.Verification
main, pass with the fix (RED→GREEN); contents suite green,ruff checkclean