You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9c71e66
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ios): give an unverifiable simulator state its own typed reason and cause text (#3321)
runner_unreachable meant both 'the runner stopped answering' and 'our own state
probe could not be read'. The probe verdict is now runner_destination_unverified,
and the open warning's cause text is a total map over the reasons.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Runner and daemon lifecycle (applies to simulators too):
531
531
open without --relaunch is idempotent-foreground for an already-running app (it brings the process forward; it does not restart it). open --relaunch restarts the app; on iOS simulators this collapses to one simctl launch --terminate-running-process call instead of a separate terminate-then-launch.
532
532
No runner read launches a session app that is not running: snapshot, wait, is, get, a reading find, and an interaction's leading reads (a gesture's viewport read, the capture that resolves a selector click/fill) answer the retriable APP_NOT_RUNNING instead of bare-launching over a launch SpringBoard still holds behind its deep-link confirmation. Only open, activate, and a command that mutates without a leading read bring a stopped app up.
533
-
close keeps a healthy iOS simulator XCTest runner warm by default so the next open on that simulator (same udid in the same simulator set) skips the runner build, unless --shutdown was requested, the session was recording, or the session held a device lease. A retained runner auto-stops after an idle window (default 5 minutes); set AGENT_DEVICE_IOS_RUNNER_IDLE_STOP_MS to override, or 0 to disable idle stop and retain until daemon exit. A simulator shut down externally while its runner is retained is detected and the retained runner is stopped, because the retained Xcode destination would otherwise reboot the simulator and leave it powered on; the next open reports reason=runner_destination_lost (or reason=runner_unreachable when the runner stopped answering) in its warnings.
533
+
close keeps a healthy iOS simulator XCTest runner warm by default so the next open on that simulator (same udid in the same simulator set) skips the runner build, unless --shutdown was requested, the session was recording, or the session held a device lease. A retained runner auto-stops after an idle window (default 5 minutes); set AGENT_DEVICE_IOS_RUNNER_IDLE_STOP_MS to override, or 0 to disable idle stop and retain until daemon exit. A simulator shut down externally while its runner is retained is detected and the retained runner is stopped, because the retained Xcode destination would otherwise reboot the simulator and leave it powered on; the next open reports reason=runner_destination_lost in its warnings, or reason=runner_unreachable when the runner stopped answering, or reason=runner_destination_unverified when the runner's connection closed and the simulator's state could not be read.
534
534
Each AGENT_DEVICE_STATE_DIR runs its own daemon. It self-exits after an idle window (default 5 minutes, matching the runner idle-stop default) once it has no open sessions, no in-flight requests, and no active recording; set AGENT_DEVICE_DAEMON_IDLE_TIMEOUT_MS to override, or 0 to disable idle reap.
535
535
On a machine shared by several agents, set AGENT_DEVICE_SESSION_IDLE_TIMEOUT_MS to also expire an individual session that has taken a host-global device claim and then received no commands for that long; the claim is released and the next command on that session answers SESSION_NOT_FOUND with details.reason SESSION_IDLE_EXPIRED naming the window and the device. Off by default, because on a shared host "idle" and "thinking" are indistinguishable: only set it where an abandoned claim blocking every other agent is the worse failure. Sessions holding a remote lease or any active capture (recording, logs, audio, performance, or trace) are never expired this way.
536
536
A stale iOS runner lease — its owner process dead, or its AGENT_DEVICE_STATE_DIR deleted — is reclaimed automatically instead of failing with "is already owned by another agent-device daemon". A live owner's runner is also reclaimed when the requesting daemon holds the host-global device claim for that device: claims are exclusive, so holding one proves the runner's owner released the device and merely kept the runner warm. The error remains only for owners outside claim arbitration (a pre-claims build, or daemons pointed at different claim stores).
Copy file name to clipboardExpand all lines: website/docs/docs/sessions.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,7 +117,7 @@ agent-device close --shutdown
117
117
Without `--shutdown`, `close` keeps the iOS runner warm for the next `open`. If you shut that simulator
118
118
down yourself (`xcrun simctl shutdown`) while the runner is waiting, agent-device stops the runner so it
119
119
doesn't boot the simulator again, and the next `open` returns a warning that ends in
120
-
`reason=runner_destination_lost`, or `reason=runner_unreachable` when the runner stopped answering.
120
+
`reason=runner_destination_lost`. It ends in `reason=runner_unreachable` when the runner stopped answering, or `reason=runner_destination_unverified` when its connection closed and the simulator's state could not be read.
0 commit comments