fix(limrun): stop answering appstate for an unreachable iOS instance
AI
1d ago+523+523+012345678901234567890123456789-89-89-01234567890123456789
Summary
Limrun iOS appstate answered from the session record even after the instance was terminated. Per the maintainer decision on the issue:
- A failed read now fails
appstateinstead of answering from the session. This also changes local iOS: a busy runner now fails. - Limrun iOS answers from the session only after
listAppsconfirms the instance responds. Otherwise it fails withlimrun_instance_unreachable. - Any provider whose session has ended refuses with
owner-capability-missing, andcapabilitiesno longer advertisesappstatethen.
18 files. Closes #3924.
Validation
Tested 03a062138. pnpm check:affected --run --head 03a062138: all runnable checks passed (41 passed, 25 skipped by selection; unit 17016 passed, 1 skipped, 0 failed). A new daemon-level test covers a rejecting listApps, and it fails with the probe removed. Earlier gate failures at 0f0c41801 remain unproven.
Local iOS simulator (iPhone 17, com.apple.Preferences): appstate reported source: session with no runner, and source: runner, state: runningForeground after snapshot started one.
Unresolved:
- No live Limrun run. It is not merge-ready: I have no Limrun credentials, so the terminated-instance path and its elapsed time are not measured on the real SDK.
- Limrun still has no foreground read, so
source: sessionreports the last opened app. - Live WebDriver and Revyl iOS sessions answer without a liveness check, because the decision names only Limrun.
- A silently dead socket can take up to the SDK's 30s timeout.
🤖 Generated with Claude Code