Repository navigation
Description
Purpose
Follow up on PR #4539, r4572557061. Plain close should not stop a new emulator boot that another actor started after the session’s original boot. This is separate from the Android cold-open acceptance runs still required by #4162.
Current evidence
At 0e19c8dfaf2a549bd6cfd49d3b1c50d56ee83dcd, the source permits this sequence:
- A session opens a stopped local Android emulator and records
bootedByOpen: true. - Another actor stops and starts the emulator, retaining its serial and the daemon’s claim file.
- The session reopens its app. Claim renewal verifies token/process identity and stamps
updatedAtMs; it does not observe the device’s current boot. Android session refresh returns the stored device.updateOpenDeviceretains boot ownership for the same device identity. - Plain close can renew that claim and request shutdown of the current emulator boot.
See reopen, renewal, stored Android device, retained boot ownership, and implicit shutdown.
This is a source trace, not a runtime reproduction. No live external-reboot case has run. The earlier Darwin iOS stale-snapshot rejection does not settle this scenario. The existing boot-observation service already distinguishes device boots for claim acquisition; claim currency and ownership of a particular boot answer different questions.
Required behavior and completion
- First reproduce the sequence through the routed open/close lifecycle with real claim handling. Record whether the second open actually boots anything and whether close asks for shutdown.
- If reproduced, tie implicit-stop authority to the boot this session caused at the owning lifecycle/claim boundary. Reuse existing boot observation where appropriate. Specify behavior when boot observation is unavailable before implementation.
- Preserve actual cold-reopen ownership, same-boot reopens, explicit
close --shutdown, policy-denied warnings, provider/physical exclusions, and claim takeover behavior. A blanketselection.source === 'local'condition would drop legitimate cold reopens. - Add a regression that fails on the observed wrong shutdown and passes after the fix. Verify both a same-boot reopen and an external restart. Cover close without an intervening reopen if the reproduction exposes the same gap.
- Run the affected exact-head checks and supported live-device verification before claiming the device behavior fixed.
No speculative guard, new flag, release workaround, or change to #4162’s pending acceptance evidence is included in this follow-up.
Activity
apex-sentinel-staging commentedon Nov 16, 2026
Apex Sentinel · Issue review
Suggested label:
bugThe issue identifies a concrete existing behavior that is wrong: after an external emulator restart, a session's plain close can still request shutdown of the current boot, and it points to source locations plus required reproduction and tests.
Required sections