Repository navigation
fix(computer): a Windows app whose window closes is stopped only once its helper has left too - #594
Merged
earakely-scale merged 1 commit intoNov 10, 2026
Conversation
… its helper has left too stop asked an app's windows to close and returned once its own processes had left the job, while the helper holding the job, which leaves once the job holds no process but itself, could still be there: alive() counts it, so it read true just after a stop whose window closed. stop now waits for the helper to leave too, then ends the job should it not, as its other paths do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
deleted the
edgararakelyan/windows-stop-waits-for-helper
branch
November 10, 2026 15:56
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.
Part of FD-5437. The branch has no issue id, so merging won't close the issue.
On Windows, stopping an app whose window closes when asked returned as soon as the app's own processes had left its job. It didn't wait for the helper (
_job.py) that holds the job, which leaves by itself once the job holds no process but its own.alive(pid)counts every process in the job, the helper included, so it could still read true just after such a stop.That broke
stop's own docstring: a stop waits "until each process it held has exited and it holds none". It also madewindows_test.py's notes test fail now and then: its session verifier'sobliging stopsaw{"shown": true, "waited out": false, "alive": true, "listed": false}. Stops with no window, or with a window that won't close, already ended the whole job and waited for it.The fix
_session_windows.stopnow waits, once the app's processes have closed, up toENDED_TIMEOUT_Sfor the helper to leave. If anything is still in the job after that, it ends the job, as the other paths do.Tests
packages/agentenv-protocol/tests/test_computer_session_windows.py:FakeWin32gainsleaves, modelling the helper: alone in its job, it leaves after that many looks, or stays forNone.aliveis false right afterstopreturns.stop, both of those fail. With the fix, all 9 pass.ruff checkis clean.Verified on a VM
EC2 c8i.4xlarge with nested KVM, from this branch at 7a09052.
tst/integration/computer/windows_test.py -k notes_appran three times:Each run's session verifier checks the obliging stop. Since the race was intermittent, three passes don't prove the fix alone; the unit test that fails on the old
stopdoes.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge.Summary
Windows
stopnow waits for the helper after the app exits and ends the job if the helper stays.Reviews (1) · Last reviewed commit: "fix(computer): a Windows app whose windo..." · Reviewed by Greptile