[cherry-pick] test: clean up Windows agent-host descendants after shutdown - #337138
Merged
Merged
Conversation
Christof Marti (chrmarti)
approved these changes
Sep 21, 2026
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
promisify(getProcessList) rejects successful Windows snapshots, preventing descendant cleanup.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds Windows-specific cleanup for orphaned Agent Host test descendants.
Changes:
- Captures and terminates descendants during server shutdown.
- Adds shutdown regression tests.
- Documents the cleanup boundary.
| File | Description |
|---|---|
serverIntegrationTestHelpers.ts |
Implements descendant cleanup. |
serverIntegrationTestHelpers.test.ts |
Adds cleanup regressions. |
e2e/README.md |
Documents Windows teardown behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Christof Marti (chrmarti)
enabled auto-merge (squash)
September 21, 2026 20:22
Sandeep Somavarapu (sandy081)
approved these changes
Sep 21, 2026
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.

Cherry-pick of #337080 from
main.Summary
Minimal, test-harness-only follow-up to the Windows Codex E2E teardown failure on #337043 (failed job). Replaces my overly broad adaptation in #337070; Dmitri's provider-lifecycle work remains in #335992 and is not taken over here.
stopServerwaits for the agent-host parent to exit. On Windows, descendants can remain alive after that clean exit and retain resources under the test home;taskkill /Tcannot discover them through a parent that has already exited.killTreehelper.No production code, shared process utilities, Codex provider behavior, shutdown budgets, SDK versions, replay fixtures, or retry policies change. The changes remain confined to test-server cleanup, its regression tests, and documentation.
This targets the test-server cleanup boundary, not every possible provider shutdown race. The archived CI error does not identify its exact locking process, so the synthetic reproduction establishes the orphan-cleanup gap rather than conclusively identifying the handle owner in that run.
Validation
npm run gulp compile-client: 0 errors.Local validation is Windows-only. The previous head passed three-platform Azure build 475551. The review follow-up in
62e8628b8fepasses local compile, lint, hygiene, 6 unit tests, and 3 focused Codex replay tests; removing its snapshot bound makes the new regression fail. Fresh PR CI and Azure build 475625 are running on the updated head with publishing and release disabled; results remain pending.