Skip to content

[dotnet-port-fixes] Add tool approval no-session parity test - #904

Merged
Quim Muntal (qmuntal) merged 1 commit into
mainfrom
dotnet-port-fixes-toolapproval-nosession-test-96025d5d57d2401e
Aug 25, 2026
Merged

[dotnet-port-fixes] Add tool approval no-session parity test#904
Quim Muntal (qmuntal) merged 1 commit into
mainfrom
dotnet-port-fixes-toolapproval-nosession-test-96025d5d57d2401e

Conversation

@michelle-clayton-work

Copy link
Copy Markdown
Contributor

Summary

Add a regression test in agent/harness/toolapproval/toolapproval_test.go that ports the intent of the upstream .NET no-session tool-approval fix. The Go middleware already preserves the original user message when an approval request is auto-approved and the inner agent is re-invoked in the same run, so this change locks that behavior in with explicit parity coverage rather than changing the implementation.

Upstream reference: microsoft/agent-framework#7310 and commit 28e02d466997972d51c0a435b133a875f7444976.

Ported .NET PRs

Breaking Changes

No.

Tests and Examples

  • go test ./agent/harness/toolapproval
  • Added TestToolApproval_AutoApprovalWithoutSessionPreservesOriginalMessages
  • No examples changed

Notes

The broader recent dotnet/ inspection did not produce a smaller behavior fix that was both unported and in scope for [dotnet-port-fixes]. This PR keeps the nightly change narrow by adding parity coverage for the remaining applicable tool-approval regression path instead of changing public or internal behavior that is already aligned.

Generated by .NET to Go Fixes and Test Porting Agent · gpt54 · 182.5 AIC · ⌖ 12 AIC · ⊞ 24.2K ·

Closes #874

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 24, 2026 16:45
@github-actions github-actions Bot added area:agent Changes files in the agent area size:medium At most 100 changed lines across at most 5 files labels Aug 24, 2026

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.

Pull request overview

Adds regression coverage for tool-approval auto-approval without an explicit session.

Changes:

  • Adds a no-session parity test.
  • Verifies message preservation, approval response injection, and completion output.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions github-actions Bot added the parity-approved Go API consistency review found no parity issues label Aug 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

API Consistency Review

Scope: internal-only (test-only change)
Changed Go contract: None — only agent/harness/toolapproval/toolapproval_test.go was modified; no exported symbols changed
Upstream evidence reviewed: dotnet/src/Microsoft.Agents.AI/Harness/ToolApproval/ToolApprovalAgent.cs and dotnet/tests/Microsoft.Agents.AI.UnitTests/Harness/ToolApproval/ToolApprovalAgentTests.cs at commit 28e02d466997972d51c0a435b133a875f7444976 (microsoft/agent-framework#7310)
Result: aligned


This PR adds a regression test, TestToolApproval_AutoApprovalWithoutSessionPreservesOriginalMessages, with no implementation changes. The upstream .NET fix resolved the no-session case by adding session ??= await InnerAgent.CreateSessionAsync(...) so conversation history is preserved across auto-approval re-invocations. The Go implementation achieves the same observable outcome differently — it passes the original caller messages through explicitly rather than relying on session state — which is an intentional, idiomatic Go divergence in mechanism with equivalent user-visible behavior. The new test locks in exactly that semantics.

No exported API surface changed; public-api-change label is not warranted. Parity is confirmed. ✅

Generated by Go API Consistency Review Agent for #904 · sonnet46 · 19.5 AIC · ⌖ 5.08 AIC · ⊞ 6.4K ·

@github-actions github-actions Bot added kind:tests Changes tests, fixtures, or test infrastructure risk:low Limited blast radius and straightforward rollback labels Aug 24, 2026
@qmuntal
Quim Muntal (qmuntal) added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit c0daf7c Aug 25, 2026
33 checks passed
@qmuntal
Quim Muntal (qmuntal) deleted the dotnet-port-fixes-toolapproval-nosession-test-96025d5d57d2401e branch August 25, 2026 11:08
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 parity-approved Go API consistency review found no parity issues risk:low Limited blast radius and straightforward rollback size:medium At most 100 changed lines across at most 5 files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dotnet-port-fixes] Add tool approval no-session parity test

3 participants