Repository navigation
Fix request hangs when cancelling suspended headless launches - #457
Merged
Merged
Conversation
A suspended simulator launch can keep its native producer alive when only the Foundation Operation is cancelled. Deliver cancellation to the matching Xcode trackers on the MainActor and drain those owned cancellation tasks before workspace reuse, including trackers registered after cancellation.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
zunda-pixel
commented
Oct 30, 2026
This was referenced Oct 30, 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.
Cancelling a headless
RunProjectwhile its simulator app is suspended can leave the request waiting for the native producer to finish. The request currently cancels the recorded Foundation Operation, which does not cancel Xcode's child execution trackers.Fixes #454
The execution tracker now receives native cancellation on the MainActor. The request scope owns those cancellation Tasks, handles trackers registered after cancellation, and waits for cancellation delivery before draining the native stream. Completed trackers do not receive late native cancellation, so an app handed to the workspace keeps running.
Validation:
NativeExecutionOperationsTestscover native work termination, late tracker registration, completed trackers, cancellation errors, and the existing request lifetime behavior../scripts/check.shand./scripts/verify-proxy-target-boundaries.shpassed.-32800, and successfully built and ran again in the same workspace, both without a debugger and with LLDB attached.StopProjectand workspace close also completed.Remaining limitation: the cancelled launch can still leave its simulator app suspended after the request returns. This is tracked in #456. This change fixes cancellation delivery and request/workspace progress; terminating an early launch requires additional lifecycle ownership because the observed tracker can have no launch session at cancellation time. Returning early while the native producer is pending remains unsupported.