Repository navigation
Keep generated compaction summaries out of chat history - #1185
Quim Muntal (qmuntal) merged 1 commit into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation is focused, preserves cloning and source IDs, and includes targeted regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Updates compaction summary attribution so generated summaries remain in model requests but are excluded from persisted chat history.
Changes:
- Marks generated summaries as history-provider messages.
- Adds regression coverage for model-request inclusion and history exclusion.
- Updates attribution assertions and documentation.
| File | Description |
|---|---|
agent/compaction/provider.go |
Corrects generated-summary source attribution. |
agent/compaction/compaction_test.go |
Verifies summary attribution and storage behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
API consistency review
Changed Go contract
Upstream evidence reviewed
AssessmentThe Go change makes Warning Firewall blocked 4 domainsThe following domains were blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "github.com"
- "proxy.golang.org"
- "storage.googleapis.com"
- "sum.golang.org"See Network Configuration for more information.
|
Compaction-generated summaries are currently attributed as context-provider messages. The default history store filter treats them as new input, so it saves each summary alongside the original messages it summarizes.
Mark generated summaries as history instead, matching .NET's CompactionProvider. Summaries remain in the model request, while the default history provider excludes them from storage. Provider IDs and message cloning are preserved; custom filters observe the corrected source type.
The public-API regression starts with
u1, a1in history and compacts it beforeu2. It verifies that the request contains the summary andu2, while stored history after the response is exactlyu1, a1, u2, a2. Before the fix, stored history also contains the generated summary. The existing source-attribution assertion and constructor documentation are updated accordingly.Validation:
go test -race -shuffle=on ./...golangci-lint run --timeout=5m(0 issues)git diff --check