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 a06b951
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ios): refuse every runner read over a not-running session app
The refusal now keys on the runner's own read trait, not on a host-stamped per-request mark:
isReadOnlyCommand covers findText, readText, snapshot, gestureViewport, and alert get, so a
mutation's leading read -- the viewport read a gesture starts with, the capture that resolves a
selector click/fill -- refuses with APP_NOT_RUNNING exactly like a user-level read. A bare
activate over a launch SpringBoard holds behind its "Open in ...?" confirmation is a launch
without the URL, whatever command asked for the read.
The daemon-side request-app-intent plumbing and the observationOnly wire field are removed:
the runner's command trait table is the single source of the rule. The refusal stays retriable
for a wait poll while the transport reads it as a definite answer; open, activate, and
interactions that mutate without a leading read keep the foreground repair.
This adopts the rule picked in the #2852 review (option 1) and says so in the CHANGELOG, the
foreground-repairs docs section, and the physical-device help topic's lifecycle facts.
hint:"Reads do not launch the app. Relaunch it with open; if a system prompt such as a deep-link confirmation holds its launch, answer it with alert accept."
'If runner build products look stale or corrupted, run `pnpm clean:xcuitest` in a local checkout, or remove ~/.agent-device/apple-runner/derived, then retry.';
Runner and daemon lifecycle (applies to simulators too):
701
701
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.
702
+
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.
702
703
close keeps a healthy iOS simulator XCTest runner warm by default so the next open on that device skips the runner build, unless --shutdown was requested, the session was recording, the session held a device lease, or the device used a scoped (non-default) simulator set. 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.
703
704
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.
704
705
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).
0 commit comments