Skip to content

dotnet: Deflake warm pending-tool cleanup - #2746

Open
devm33 wants to merge 1 commit into
mainfrom
devm33/deflake-dotnet-warm-resume-cleanup
Open

devm33 wants to merge 1 commit into
mainfrom
devm33/deflake-dotnet-warm-resume-cleanup

Conversation

@devm33

@devm33 devm33 commented Sep 22, 2026

Copy link
Copy Markdown
Member

Problem

The .NET SDK Tests validation run 35724488486 hung for ten minutes in Should_Keep_Pending_External_Tool_Handleable_On_Warm_Resume_When_ContinuePendingWork_Is_False.

The test intentionally leaves the original external-tool callback blocked while a second client resumes the active session and completes that pending request. After verifying that the external completion succeeded, it disposed the resumed session before releasing the original callback. Cleanup could therefore wait indefinitely for the callback whose release lived in the later finally block.

The test is worthwhile because it verifies that an active session resumed with ContinuePendingWork = false still exposes its pending external tool request for explicit completion.

Changes

Release the original blocked callback immediately after the resumed client successfully handles the pending tool call and verifies the single invocation. The existing finally remains as failure-path cleanup.

Product impact

No product behavior changes. This only fixes test cleanup ordering after the behavior under test has been verified.

Validation

  • git diff --check
  • Ten exact-head .NET SDK Tests workflow runs pending

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c2ef3b8a-d96c-4821-b346-694f49854981
Copilot AI balanced review requested due to automatic review settings September 22, 2026 12:24
@devm33
devm33 requested a review from a team as a code owner September 22, 2026 12:24
@devm33 devm33 added post-to-slack Post PR to reviewers Slack channel deep-review Requested detailed code review skip-changelog No user-facing changelog entry required labels Sep 22, 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.

Copilot review overview

🟢 Approval recommended

The focused cleanup-order change resolves the documented hang without altering product behavior.

Review effort: Balanced
Findings: None

What changed in this PR

Deflakes .NET E2E cleanup by releasing the blocked original tool callback before disposing the resumed session.

Changes:

  • Releases the callback after successful pending-tool verification.
  • Retains finally cleanup for failure paths.
File Description
dotnet/​test/​E2E/​PendingWorkResumeE2ETests.cs Prevents resumed-session disposal from waiting indefinitely.

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deep-review Requested detailed code review post-to-slack Post PR to reviewers Slack channel skip-changelog No user-facing changelog entry required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants