Repository navigation
[dotnet-code] Cover service-managed compaction skip - #1257
Merged
Quim Muntal (qmuntal) merged 1 commit intoOct 5, 2026
Merged
Quim Muntal (qmuntal) merged 1 commit into
Quim Muntal (qmuntal) merged 1 commit into
Conversation
Add a focused compaction context-provider regression test for service-managed sessions. The test adapts the remote-session branch of the pinned .NET compaction coverage and verifies the existing Go contract without changing production behavior or public API. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Quim Muntal (qmuntal)
marked this pull request as ready for review
October 5, 2026 10:10
Quim Muntal (qmuntal)
approved these changes
Oct 5, 2026
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused test accurately covers the existing remote-session behavior.
Review effort: Balanced
Findings: None
What changed in this PR
Adds regression coverage ensuring compaction is bypassed for service-managed sessions.
Changes:
- Verifies the compaction strategy is not invoked.
- Confirms original messages are returned unchanged.
| File | Description |
|---|---|
agent/compaction/compaction_test.go |
Adds service-managed session skip coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Quim Muntal (qmuntal)
deleted the
dotnet-code-compaction-service-managed-skip-18df0aed7d4876b5
branch
October 5, 2026 10:15
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.
Summary
Adds a focused test for the existing
compaction.NewContextProvidercontract that skips compaction when the session is service-managed. This protects the Go behavior that avoids locally rewriting history owned by the provider service, using the remote-session branch of the pinned .NET compaction coverage as evidence. Leaving this uncovered makes future compaction ports more likely to conflate local/no-session compaction with service-owned history handling..NET Reference
301a43c862be8dbeb1754f60a0c538b1b6dc92cb5343347312795ef589c8d8047326eb1b6ef3aa3c/ .NET: Allow compaction for per-service-call local chat history agent-framework#8845,.NET: Allow compaction for per-service-call local chat historyInvokingAsyncCompactsOnlyLocallyManagedHistoryAsyncverifies remote conversation IDs are not compacted while locally managed/no-ID sessions are eligible.agent/compaction/provider.go(NewContextProvider/contextProvider.Invoking) already skips non-emptySession.ServiceID();agent/history.goandagent/agent.godefine the per-service-call local-history lifecycle.agent/compaction/compaction_test.go,agent/compaction/historyprovider_test.go, and related merged compaction work in [dotnet-port-api] Add compaction-backed history provider #1092 and Keep generated compaction summaries out of chat history #1185.Public API and Behavior
No public Go API changed. No intentional behavior change was made. The production code is unchanged; the new test asserts the existing service-managed-session skip behavior.
Tests
TestNewProvider_SkipsServiceManagedSession, which sets a remote service ID on a session, invokes the compaction context provider, and verifies the strategy is not called and the original messages are returned.go test ./agent/compactionpassed.git diff --checkpassed.Notes
History checked included recent
[dotnet-code],[dotnet-port-fixes], and[dotnet-port-api]PRs, with related compaction work in #1092 and #1185. Skipped candidates included the OpenAI in-memory Responses input-item range change because no existing Go counterpart was found, and HTTP header delimiter validation because any applicable change would be a behavior/security fix for the port-fixes workflow, not this no-behavior-change audit.Warning
Firewall blocked 3 domains
The following domains were blocked by the firewall during workflow execution:
proxy.golang.orgstorage.googleapis.comsum.golang.orgTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.