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
A shut-down device still counts against the RAM budget #779
A shut-down virtual device still counts against the RAM budget, so the resource capacity strategy can refuse a boot or a creation for ram-budget while nothing is running.
Where
src/core/capacity/limits.ts:70-72activeDevices is every device not deleted, shut down included.
src/core/capacity/strategies/resource/index.ts:100-105 sums #bytesPerDevice over activeDevices.
src/core/capacity/AGENTS.md, "Strategies": "Used = sum over every device not deleted (shut down included)".
What a user sees
With the default idle.deleteAfterMs of 60 minutes, a worker that leased many kinds in an hour holds them shut down on disk, and a new request can be refused for RAM (simlock status shows atRamBudget) although the machine has the memory free. The warm pool reports a target short: ram-budget in the same state. Shutting an idle device down frees its running slot but not its RAM share; only the delete does.
Whether this is the intended meaning of the budget (a disk-and-RAM ceiling) or a defect is for triage; the docs describe the behaviour, so it may be a gap in the budget's design rather than in the code.
Found
Exploring the warm pool for #771 on 2026-10-20, at commit 97bc8ea.
Confirmed; proposed change: shutdown devices should consume no RAM budget. This expectation changes the documented policy.
Test and reproduction-only commit, branch bug/779-repro. Title: “releases shutdown devices' RAM for status, provisioning and slim boots”.
pnpm exec vitest run --project unit src/core/capacity/shutdown-ram.test.ts
1 failed test; five named assertion failures:
RAM used: expected 0; received 8589934592
atRamBudget: expected false; received true (iOS and Android)
provision and slim boot: expected ok:true; received ram-budget
Three shutdown devices fill the nominal 8 GiB budget while running slots are zero. Empty-machine control requests succeed. Existing coordinator/resource tests: 32 passed. No hardware lane ran.
Root cause
Gap: the code implements its documented allocation policy. resource/index.ts:100 sums activeDevices, whose limits.ts:70 excludes only deleted devices. canBoot at line 62 assumes the device's current mode already holds RAM and charges only full-minus-current: a full shutdown boot adds zero. Status and admission consistently share this accounting; the symptom is not stale status.
Simplest fix
In one PR, exclude shutdown devices from RAM usage, retaining their device-limit charge. Charge shutdown boots their entire full size; retain the mode delta for running rewarms. Make boot reservations count as RAM-active at full size until released; changing mode alone currently leaves their state shutdown. Keep provisioning reservations charged. Update affected tests, the capacity manual and configuration docs. No fix is included here.
Alternatives rejected
Exclude shutdown devices from activeDevices: also breaks device limits.
Filter RAM totals alone: loses boot-reservation protection and permits full boots without RAM checks.
Delete idle devices sooner: discards reusable devices and masks the accounting policy.
Risk
Check simultaneous full/slim boots, reservations and release paths cannot overcommit.
Preserve running/device limits and rewarm accounting.
Confirm status and warm-pool admission still agree.
Activity
V3RON commentedon Oct 21, 2026
Reproduction
Confirmed; proposed change: shutdown devices should consume no RAM budget. This expectation changes the documented policy.
Test and reproduction-only commit, branch
bug/779-repro. Title: “releases shutdown devices' RAM for status, provisioning and slim boots”.Three shutdown devices fill the nominal 8 GiB budget while running slots are zero. Empty-machine control requests succeed. Existing coordinator/resource tests: 32 passed. No hardware lane ran.
Root cause
Gap: the code implements its documented allocation policy.
resource/index.ts:100sumsactiveDevices, whoselimits.ts:70excludes only deleted devices.canBootat line 62 assumes the device's current mode already holds RAM and charges only full-minus-current: a full shutdown boot adds zero. Status and admission consistently share this accounting; the symptom is not stale status.Simplest fix
In one PR, exclude shutdown devices from RAM usage, retaining their device-limit charge. Charge shutdown boots their entire full size; retain the mode delta for running rewarms. Make boot reservations count as RAM-active at full size until released; changing mode alone currently leaves their state shutdown. Keep provisioning reservations charged. Update affected tests, the capacity manual and configuration docs. No fix is included here.
Alternatives rejected
activeDevices: also breaks device limits.Risk
Written by an agent.
docs: RAM budget excludes shut-down devices in CLI, HTTP API and sche…
docs: RAM wording and test comments match shut-down devices holding n…
V3RON commentedon Oct 24, 2026
Delivery run
Merged: #979 (#779)
Written by an agent.