[dotnet-port-fixes] Align compaction summary marker handling - #539
Conversation
Support raw JSON _is_summary values in compaction message grouping and add parity tests for bool and raw-token cases. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Aligns the Go compaction message grouping logic with the upstream .NET fix by recognizing _is_summary markers not only as native bool values but also when represented as raw JSON boolean tokens, and adds parity tests to validate the intended grouping behavior.
Changes:
- Extend summary detection to accept
bool,json.RawMessage,*json.RawMessage, and[]byterepresentations. - Add table-driven tests to ensure missing/false/null/string values stay as assistant text while
truebecomes a summary group.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| agent/compaction/index.go | Expands _is_summary detection to support raw JSON boolean token representations in message metadata. |
| agent/compaction/compaction_test.go | Adds parity tests covering expected summary vs assistant-text grouping for various _is_summary value forms. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment has been minimized.
This comment has been minimized.
|
@copilot respond to PR comments |
…opertyValueParsing Co-authored-by: michelle-clayton-work <262183035+michelle-clayton-work@users.noreply.github.com>
Done — addressed both points in commit
All 14 subtests pass. |
Cross-Repo Parity Review — No IssuesThis PR is a direct port of upstream .NET fix microsoft/agent-framework#7042 and is already aligned with the upstream change. Scope check: Only Parity verdict: ✅ Aligned. The Go fix mirrors the upstream .NET behavior fix semantically. No Python equivalent was found for this specific
|
Summary
Align Go compaction summary detection with the upstream .NET fix for
_is_summarymetadata by accepting both nativeboolvalues and raw JSON boolean tokens when grouping assistant messages. Added parity tests that keep missing, false, null, and string token values as assistant text while recognizingtruein both native and raw-token forms.Upstream reference:
microsoft/agent-framework@e677ccc
Ported .NET PRs
CompactionMessageIndex.IsSummaryMessagefor deserialized JSON token valuesBreaking Changes
No.
Tests and Examples
go test ./agent/compactionTestMessageIndex_SummaryPropertyKeyIsRespectedNotes
Skipped broader recent upstream compaction/workflow changes because they were either already tracked in Go porting work or were larger than the narrow nightly PR target. This change is internal-only and does not modify exported Go symbols.
Closes #487