Repository navigation
fix(android): serialize Android-only teardown under the session lock - #325
Merged
Merged
Conversation
withSessionVncLock, SessionVncLockOptions and SESSION_VNC_LOCK_TIMEOUT_MS now live in lab-core so Android teardown can share them. The lock file path and behavior are unchanged, and lab-desktop-linux re-exports them. Refs #321
A reaper teardown and a user destroy of one Android session could stop the emulator and retain logs at the same time. Android-only teardown now runs the stop, log retention and finalize inside the session lock and re-reads the record there. The desktop+android leg already runs inside the desktop lock, so it does not take the lock again. Reapers and MCP destroy pass their abort signal to the lock wait. Closes #321
This was referenced Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #321
Android-only teardown now runs its emulator stop, log retention and finalize under the per-session lock, as desktop and browser teardown already do. To make the lock reachable from Android,
withSessionVncLockmoved from desktop-linux into@pickforge/lab-core(session-lock.ts) and is exported there. Desktop-linux re-exports it, so its public API is unchanged. The lock file name and path are unchanged, so all teardown paths share one lock per session. The desktop+android path does not take the lock again, because it runs inside the desktop lock and the lock is not reentrant.API changes, approved by the owner: core now exports
withSessionVncLock,SessionVncLockOptionsandSESSION_VNC_LOCK_TIMEOUT_MS.teardownAndroidSessionanddestroyAndroidSessiontake an optional lastoptionsargument that passes an abort signal to the lock wait.stopped.jsonremains, no lock files remainpackages/android/test/reaper.test.tspackages/core/test/session-lock.test.ts, desktop-linux testspackages/android/test/reaper.test.ts, Fable recheckPICKFORGE_REQUIRE_BROWSER=1coverage: 3080 passed, 6 skipped at e40d917; at 7045cd3 three load timeouts in unrelated desktop and CLI files passed 83 of 83 on rerunworker-report-321.md--base origin/main --fail-on new,worsened,unmatched: 63 functions, 0 violationsworker-report-321.mdEvidence is in
~/Artifacts/pickforge-batch6-2026-10-09/on the build host.No device pass: this changes internal teardown locking with nothing to drive, and the tests cover it.
Follow-up: #326 (session lock errors mention VNC for Android teardown).