.NET: Fix CompactionMessageIndex.IsSummaryMessage#7042
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes summary-message detection in the .NET compaction pipeline so assistant messages tagged with _is_summary can be recognized as CompactionGroupKind.Summary even when ChatMessage.AdditionalProperties values come back as JsonElement after deserialization.
Changes:
- Update
CompactionMessageIndex.IsSummaryMessageto treat_is_summaryvalues stored asJsonElementas summary flags. - Add a new theory in
CompactionMessageIndexTeststo validate summary grouping across several_is_summaryvalue shapes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI/Compaction/CompactionMessageIndex.cs | Adjusts summary-message detection logic to account for deserialized JsonElement values. |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/Compaction/CompactionMessageIndexTests.cs | Adds parameterized coverage for summary-flag handling when _is_summary is present in AdditionalProperties. |
Contributor
Author
|
cc @westey-m |
westey-m
approved these changes
Jul 10, 2026
westey-m
enabled auto-merge
July 10, 2026 11:15
peibekwe
approved these changes
Jul 10, 2026
Contributor
|
Thanks for the contribution @pwoosam! |
This was referenced Jul 21, 2026
This was referenced Jul 24, 2026
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.
Motivation & Context
Deserialized chat messages do not group summary chat messages appropriately because IsSummaryMessage will always return false when the additional property type is JsonElement.
Description & Review Guide
Related Issue
Fixes #7003
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.