fix(daemon): close the session app when close omits the app
Summary
close without an app ended the session but left the app running on iOS simulators and Android emulators, although help close says it closes the active session app. The daemon now closes the session's appBundleId the same way close <app> does, Android close fences included.
- A session that never opened an app still closes without a platform close.
- Web sessions are unchanged.
- The positional-only gate predates #826, which added only the web exception. I found no decision to skip the session app.
9 files: 1 source file (+13/-4), the rest tests and integration fakes.
Fixes #4684
Validation
Head 09181458e on base aa600e980.
- The new unit test fails on base and passes on head. Provider integration: 79/79 files pass.
check:quickpassed. check:affected --run --head 09181458e: all stages pass exceptunit. 21 of its 22 failures pass when re-run alone. The remaining one,android-sdk-setup-action.test.ts, fails the same way onaa600e980on this host, where a local Android SDK path leaks into the expected path.- iOS 27.2 simulator: after
openโclose, MultiTodo stays inlaunchctlon base and is gone on head. - Android emulator:
pidof4746 โ 4746 on base, 3382 โ empty on head. - Sessions that opened no app close with exit 0 on both.
Impact to review: a plain close now also stops the app on macOS, on physical Apple devices, on cloud providers, at the end of .ad scripts, and in replay test suite teardown (closeReplayTestSession). Teardown adds Android close-fence time per flow. None of these were run live.
๐ค Generated with Claude Code
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith ยท Need help on this PR? Tag @codesmith-bot with what you need.