You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
nuke --delete-devices skips a device stalled in provisioning, so it holds a capacity slot forever #1487
bug:readyAn agent may fix it.fast-trackBug set ready by the fast-track check, not the maintainer (rule 17).platform:androidAndroid emulators or devices
An Android device stayed in provisioning for 6 days on a gateway worker. No emulator process ran for it, and its AVD files were not on disk. It took one of the worker's Android maxDevices slots (Capacity android: managed 1/2).
simlock nuke --delete-devices --yes returned {"deletedDevices":[],"releasedLeaseIds":[]}
a worker daemon restart
What you expected
nuke --delete-devices (or startup recovery) deletes a stalled provisioning device, or doctor names a command that does.
Cause (from reading the source)
NukeService.#resetDevice (src/core/nuke-service.ts, about line 176 on main) destroys a device only through #currentShutdown, which returns a device only in state shutdown. A device in provisioning is skipped. ManagedDeviceLifecycle.destroy already accepts ["provisioning", "shutdown"], so passing a stalled provisioning device to it looks like the fix.
How to reproduce
Run a worker joined to a gateway. Android capacity: fixed, maxRunning 1, maxDevices 2.
Start an Android lease and break it while the device is provisioning. In our case the emulator binary (35.5.10) rejected -crash-report-mode, and the emulator was then updated.
The device stays provisioning. Run simlock nuke --delete-devices --yes: the device is not deleted.
Workaround we used
We stopped the worker, backed up state.db, and set that one row to state='deleted'. Then we started the worker again. After that, doctor reported no findings, and a new Android lease booted in 55 s.
Environment
Simlock 0.5.0 (CLI and daemon), gateway on one Mac with a worker on another
Defect, confirmed as the reporter read it. src/core/nuke.test.ts, "with delete, deletes a device an earlier process left provisioning, reports it, and frees its slot for the next lease" (on bug/1487-repro). It registers an Android device that stays provisioning with no claim, the state a restart leaves, at maxDevices: 1. Then it runs nuke with delete and asks for a lease.
pnpm exec vitest run --project unit src/core/nuke.test.ts
AssertionError: expected 'provisioning' to be 'deleted'
❯ src/core/nuke.test.ts:127:89
Root cause
src/core/nuke-service.ts:195: #currentShutdown returns a device only in state shutdown, and #resetDevice (line 182) destroys only what it returns. A provisioning device that nothing claims is skipped, though ManagedDeviceLifecycle.destroy accepts provisioning (managed-device-lifecycle.ts:196). This breaks the user docs, which say --delete-devices deletes every device Simlock created (worker/cleanup.mdx:116). Every in-flight provision holds a boot claim, and the lifecycle's own claim refuses a claimed device, so a live provision stays safe.
Simplest fix
Let #currentShutdown accept provisioning as well as shutdown, and let #canOperate check that state. Update the Nuke line in src/core/AGENTS.md ("destroy each shutdown or unclaimed provisioning one").
pnpm exec vitest run --project unit src/core/nuke.test.ts src/core/nuke-service.test.ts
Tests 15 passed (15)
Alternatives rejected
Startup deletes unclaimed provisioning devices: it leaves nuke breaking its docs, and doctor --fix already handles stalls.
Quarantine a provisioning device in nuke: the docs say nuke deletes it.
Risk
On Android, destroy of a device whose AVD folder is gone must not throw (drivers/android/index.ts:670), or nuke logs the error and skips it again. The test uses the fake driver.
Until the fix ships, simlock doctor --fix quarantines the stalled device, and the retry deletes it (worker/troubleshooting.mdx:57).
bug:readyAn agent may fix it.fast-trackBug set ready by the fast-track check, not the maintainer (rule 17).platform:androidAndroid emulators or devices
Activity
V3RON commentedon Nov 10, 2026
Reproduction
Defect, confirmed as the reporter read it.
src/core/nuke.test.ts, "with delete, deletes a device an earlier process left provisioning, reports it, and frees its slot for the next lease" (onbug/1487-repro). It registers an Android device that staysprovisioningwith no claim, the state a restart leaves, atmaxDevices: 1. Then it runs nuke with delete and asks for a lease.Root cause
src/core/nuke-service.ts:195:#currentShutdownreturns a device only in stateshutdown, and#resetDevice(line 182) destroys only what it returns. Aprovisioningdevice that nothing claims is skipped, thoughManagedDeviceLifecycle.destroyacceptsprovisioning(managed-device-lifecycle.ts:196). This breaks the user docs, which say--delete-devicesdeletes every device Simlock created (worker/cleanup.mdx:116). Every in-flight provision holds abootclaim, and the lifecycle's own claim refuses a claimed device, so a live provision stays safe.Simplest fix
Let
#currentShutdownacceptprovisioningas well asshutdown, and let#canOperatecheck that state. Update the Nuke line insrc/core/AGENTS.md("destroy eachshutdownor unclaimedprovisioningone").Alternatives rejected
provisioningdevices: it leaves nuke breaking its docs, anddoctor --fixalready handles stalls.provisioningdevice in nuke: the docs say nuke deletes it.Risk
destroyof a device whose AVD folder is gone must not throw (drivers/android/index.ts:670), or nuke logs the error and skips it again. The test uses the fake driver.simlock doctor --fixquarantines the stalled device, and the retry deletes it (worker/troubleshooting.mdx:57).Fast track
Side findings
Written by an agent.
docs(core): drop the nuke step sequence the code already states (#1487)
V3RON commentedon Nov 10, 2026
Delivery run
Merged: #1518 (#1487)
Parked: none
Waiting: none
Decided: none
Written by an agent.
chore(agents): an outsider's bug never merges alone, one switch pause…