ios: a shutdown under 1 s after close lets the open's runner prewarm boot the simulator again
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- ios, typescript
Research direction
Start in packages/platform-apple/src/runner/runner-lifecycle.ts, following the stack from prewarmRunnerSession through ensureRunnerSession to startRunnerSessionWithLease, and compare with fenceRunnerStartAdmissionsForTeardown used on non-retained close. The owner decision (retaining close fencing the prewarm loop, or the loop refusing a device with no live session) comes first. Done means a unit test at that seam shows a prewarm attempt after a retaining close starts no runner, plus three live runs ending Shutdown.
Written by the indexing model from the issue text.
Description
Purpose
Track a path to the symptom in #3321 that #3357 does not cover: a simulator shut down with xcrun simctl shutdown right after close is booted again, this time by a runner the daemon starts, not by the retained runner. #3357 stops the retained runner; this is a different mechanism, so do not reopen #3357 for it.
Evidence
Measured on an iPhone 17 (iOS 27.0, Xcode 27.1 beta), Settings app, agent-device built from the #3357 branch, isolated --state-dir:
agent-device open com.apple.Preferences --relaunch --platform ios --udid "$A"
agent-device snapshot -i
sleep 2
agent-device close
xcrun simctl shutdown "$A" # less than 1 s after close
- 3 of 3 runs: the device shows
Bootedwithin 2 s, the originalxcodebuildis gone, and about 15 s later the daemon (the parent of the newxcodebuild) has started a replacement runner. The device endsBootedwith a runner alive and nothing reported. - Control: with 6 to 14 s between
closeandshutdown, 5 of 5 runs endShutdownonce #3357 is in. A longer gap is unaffected. - Origin of the replacement runner, from a stack trace on
launchRunnerProcess:prewarmRunnerSession→prepareLocalIosRunner→runPrepareAttempt→ensureRunnerSession→startRunnerSessionWithLease. That is the open's background runner prewarm (packages/platform-apple/src/runner/runner-lifecycle.ts), whose attempt loop re-entersensureRunnerSessionwhen its runner is gone. - Not measured: a baseline on
mainwithout #3357, and whether the prewarm is still in its attempt loop whencloseruns or is re-entered by something else. Both decide the owner below.
Required behavior
- A runner start that a prewarm loop makes after the session's
closehas retained the runner must not boot a device that was shut down in between. - Decide the owner. The #3357 watch cannot cover this: it only guards a retained runner, and here the runner that boots the device is a new session started by the prewarm loop. Candidates: a retaining
closeretires the prewarm loop's start admission for the device (non-retained close already fences admissions throughfenceRunnerStartAdmissionsForTeardown), or the prewarm loop refuses to start a runner for a device with no live session. - Key the decision on session and admission state, never on a timing window or message text.
Completion
- The sequence above, with
shutdownunder 1 s afterclose, ends with the deviceShutdownand no daemon-spawnedxcodebuildfor it, in 3 of 3 live runs. - A test at the owning seam shows a prewarm attempt after a retaining
closestarts no runner. - Related: #3321, #3357.
- Dominant language
- TypeScript
- Stars
- 4.9k
- Forks
- 328
- Avg merge
- 12h 16m
- Merged PRs (30d)
- 538
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstack/agent-device
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
callstack/agent-device#3353 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
callstack/agent-device#1869 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 Half a day Newbie friendliness 42/100
callstack/agent-device#3360 ·
Maintainers usually reply within 1 day
-
Limrun Android: `fill` inserts at the cursor instead of replacing the field's textPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 62/100
callstack/agent-device#3358 ·
Maintainers usually reply within 1 day
-
iOS selector click taps a point resolved from a pre-tap capture, so a layout shift between capture and tap retargets it silentlyPossibly taken @thymikee claimed this 1 day ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
callstack/agent-device#3354 ·
Maintainers usually reply within 1 day
All issues in callstack/agent-device
Similar issues
-
awaiting-response bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
wildcard/caro#1562 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
supadata-ai/mcp#27 ·
-
content
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cosimochellini/one-piece-zero-spoiler#516 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
capricorn86/happy-dom#2485 ·
Maintainers usually reply within 2 days
-
lane: fast
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
unicef/adt-studio#946 ·
Maintainers usually reply within 2 days