Skip to content

[dotnet-code] Cover service-managed compaction skip - #1257

Merged
Quim Muntal (qmuntal) merged 1 commit into
mainfrom
dotnet-code-compaction-service-managed-skip-18df0aed7d4876b5
Oct 5, 2026
Merged

Quim Muntal (qmuntal) merged 1 commit into
mainfrom
dotnet-code-compaction-service-managed-skip-18df0aed7d4876b5

Conversation

@microsoft-agent-framework-for-go

Copy link
Copy Markdown
Contributor

Summary

Adds a focused test for the existing compaction.NewContextProvider contract 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

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

  • Added 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/compaction passed.
  • git diff --check passed.

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.org
  • storage.googleapis.com
  • sum.golang.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "proxy.golang.org"
    - "storage.googleapis.com"
    - "sum.golang.org"

See Network Configuration for more information.

Generated by .NET-to-Go Weekly Portability Audit · copilot · gpt55 · 131.8 AIC · ⌖ 14.6 AIC · ⊞ 23.6K · ◷

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>
@github-actions github-actions Bot added area:agent Changes files in the agent area size:small At most 30 changed lines across at most 2 files labels Oct 5, 2026
@qmuntal
Quim Muntal (qmuntal) marked this pull request as ready for review October 5, 2026 10:10
@qmuntal
Quim Muntal (qmuntal) requested a review from a team as a code owner October 5, 2026 10:10
Copilot AI balanced review requested due to automatic review settings October 5, 2026 10:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Merged via the queue into main with commit 564a517 Oct 5, 2026
24 of 26 checks passed
@qmuntal
Quim Muntal (qmuntal) deleted the dotnet-code-compaction-service-managed-skip-18df0aed7d4876b5 branch October 5, 2026 10:15
@github-actions github-actions Bot added the kind:tests Changes tests, fixtures, or test infrastructure label Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Changes files in the agent area kind:tests Changes tests, fixtures, or test infrastructure size:small At most 30 changed lines across at most 2 files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants