Skip to content

Fix request hangs when cancelling suspended headless launches - #457

Merged
zunda-pixel merged 1 commit into
mainfrom
fix/cancel-suspended-launch
Oct 30, 2026
Merged

zunda-pixel merged 1 commit into
mainfrom
fix/cancel-suspended-launch

Conversation

@zunda-pixel

Copy link
Copy Markdown
Collaborator

Cancelling a headless RunProject while 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:

  • NativeExecutionOperationsTests cover native work termination, late tracker registration, completed trackers, cancellation errors, and the existing request lifetime behavior.
  • ./scripts/check.sh and ./scripts/verify-proxy-target-boundaries.sh passed.
  • Direct STDIO verification observed the suspended app, sent cancellation, received -32800, and successfully built and ran again in the same workspace, both without a debugger and with LLDB attached. StopProject and workspace close also completed.
  • Live verification uses the repository's fixture on macOS 27.0.1, Xcode 27.2 (27B48), and a dedicated iOS 27.2 simulator.

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.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T09:56:39.085091Z a4d0bfa PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

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
zunda-pixel merged commit 4317e3a into main Oct 30, 2026
7 checks passed
@zunda-pixel
zunda-pixel deleted the fix/cancel-suspended-launch branch October 30, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cancelling a headless RunProject while the simulator app is suspended can leave the request waiting

1 participant