Skip to content

[agent-cli]: manage worktree device lifecycle - #138

Closed
vonovak wants to merge 5 commits into
vonovak/android-device-instancefrom
codex/device-lifecycle
Closed

vonovak wants to merge 5 commits into
vonovak/android-device-instancefrom
codex/device-lifecycle

Conversation

@vonovak

@vonovak vonovak commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by the focused local-device lifecycle PRs #146 (A: lease renewal), #147 (B: release), #148 (C: smoke cleanup), and #149 (D: reaping), stacked after #134 and #137 including its review fixes.

The active merge group ends at #149. Explicit device selection (E), binding status/output (F), and EAS session binding (R / #139) are deferred to a later follow-up stack, documented in #149. This combined PR is closed; its branch is retained for the existing EAS follow-up history.


Worktree devices currently remain running after a smoke run or after their worktree disappears, and Metro does not renew their leases. This adds the lifecycle handling in plan 0033: lease renewal while commands run, stale-device reaping, dev:stop --release, explicit local device selection with dev --device, and binding details in status output.

Release checks this worktree's server state and validates the binding again under the registry lock so replacement bindings survive stale cleanup. Smoke releases its own platform, and explicit devices are never shut down or deleted.

Stacked on #137. EAS session bindings remain in plan 0034.

Validation: 4,927 unit tests passed; 9 focused integration tests passed, including the two-worktree lifecycle cases. Typecheck, build, formatting and lint passed (33 existing lint warnings).

Stack created with GitHub Stacks CLI • Give Feedback 💬

@vonovak
vonovak added this pull request to stack #140 October 8, 2026 19:58
@vonovak
vonovak force-pushed the vonovak/android-device-instance branch from 27e3ec2 to 606529a Compare October 9, 2026 07:51
@vonovak
vonovak force-pushed the codex/device-lifecycle branch from 64ec384 to 887e22c Compare October 9, 2026 07:51
@vonovak
vonovak force-pushed the vonovak/android-device-instance branch from 606529a to c036d29 Compare October 9, 2026 08:12
@vonovak
vonovak force-pushed the codex/device-lifecycle branch from 887e22c to c6cdaf7 Compare October 9, 2026 08:12
@vonovak
vonovak force-pushed the vonovak/android-device-instance branch from c036d29 to c591768 Compare October 9, 2026 08:18
@vonovak
vonovak force-pushed the codex/device-lifecycle branch from c6cdaf7 to 4be2d71 Compare October 9, 2026 08:19
@vonovak
vonovak removed this pull request from stack #140 October 9, 2026 15:27
@vonovak
vonovak added this pull request to stack #142 October 9, 2026 15:27
@vonovak
vonovak marked this pull request as ready for review October 9, 2026 15:34
@vonovak vonovak changed the title feat(agent-cli): manage worktree device lifecycle [agent-cli]: manage worktree device lifecycle Oct 9, 2026
@vonovak
vonovak requested review from Kudo and davidmokos October 9, 2026 18:06

@Kudo Kudo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey claude! the stack pr for each is too long and hard for human review. i don't exactly know why we need these change. could you try to reorganize the stack prs that easier for human review

name: sim.name,
origin: 'explicit',
}))
: (await readAndroidInventoryAsync(tools)).runningSerials.map((serial) => ({

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[🏗️ design] Explicit Android selection still requires the emulator package even for a ready physical USB device. With adb devices -l listing the requested serial and no emulator binary, this preview and acquireAndroidAsync both fail with EMULATOR_NOT_RUNNABLE; read only the ADB device list for explicit selection instead of the AVD inventory.

@vonovak
vonovak force-pushed the vonovak/android-device-instance branch from c591768 to f3c2d6d Compare October 12, 2026 19:54
@vonovak
vonovak force-pushed the codex/device-lifecycle branch from 4be2d71 to 338a429 Compare October 12, 2026 19:54
@vonovak
vonovak force-pushed the vonovak/android-device-instance branch from f3c2d6d to 689ce0f Compare October 12, 2026 20:06
@vonovak
vonovak force-pushed the codex/device-lifecycle branch from 338a429 to a41841d Compare October 12, 2026 20:06
@vonovak
vonovak force-pushed the codex/device-lifecycle branch from a41841d to ee69412 Compare October 12, 2026 20:20
@vonovak
vonovak removed this pull request from stack #142 October 13, 2026 08:50
@vonovak vonovak closed this Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants