Skip to content

Turn the warm pool off by default and deprecate it #2033

Backlog
0 of 2 issues completed
Backlog

Description

@V3RON

Request: none

Problem

The warm pool is on by default and learns what to keep booted. It was built when a lease without it paid a factory first boot of 40 to 60 s. Since every virtual device is a copy of a settled seed, a lease without the pool is much faster, and the pool now costs more than it saves:

  • It boots devices nobody asked for. That confuses people who watch a worker, and it loads the machine.
  • It is about 2,500 source lines and 5,800 test lines in src/core/warm-pool/, with 7 ADRs and 4 e2e files to keep true.

Measured 2026-12-02 at af8054f53 on one Mac (12 cores, 36 GB, busy with other work the whole time). The runs used settled seeds, iPhone 17 on iOS 27.2 and Pixel 9 on Android 37, full mode.

Lease Android iOS
Cold, one at a time, pool off 4.5–11 s, median about 8 s (8 leases) 20–31 s, median about 28 s (7 leases)
Cold, three at once, pool off 11–12.5 s 37–77 s
Warm hit 0.04 s 3.6 s and 7.3 s under load; 0.4–1.1 s on a quiet machine in October
Spare ready again after a grant 71–93 s 106–135 s

What the pool cost in the same runs:

  • With the pool on, 7 leases caused 18 boots. With it off, 7 leases are 7 boots.
  • While only iOS was leased, the pool booted two Android emulators of a learned kind, shut them down for memory pressure, and booted them again. That happened four times in 8 minutes, and the load average rose from about 40 to about 290.
  • A spare is ready 1.5 to 2 minutes after a grant, so leases closer together than that are cold anyway.
  • An idle Android spare held 0.7–2.7 GiB of RAM.

Limits of the run: a busy machine, one kind per platform, full mode only, few samples. Slim iOS was not measured.

The pool also does a second job. When requests wait in a worker's line, leasing plans a device only for the first one, and the pool creates devices for the others at the same time. With the pool off, waiting requests are served one at a time: each waits for the one ahead of it to be granted.

The maintainer decided to turn the pool off by default and deprecate all of it, learned kinds and configured targets, for removal in a later release.

Who it is for

  • People who run a worker and watch it: in the console, in simlock status, in Activity Monitor. Today they see devices booting that no agent asked for.
  • Agents that lease on a busy worker. They need the waiting line served as quickly as it is today.
  • Maintainers, who stop growing a module that is going away.

Outcome

  • A worker with no warmPool config boots a device only for a lease (and for a seed settle). Nothing is booted ahead of demand, and nothing is learned.
  • A worker that sets warmPool.enabled: true keeps today's pool until it is removed.
  • A worker whose config sets warmPool.targets without warmPool.enabled says at start that its targets are now ignored, and how to keep them.
  • With the pool off, requests waiting in a worker's line all start their devices at once, as far as capacity allows, instead of one after another. With the pool turned on, the line is served as today.
  • The website says the pool is off by default and deprecated.

How it works for the user

flowchart TD
  A[Worker starts] --> B{warmPool.enabled in config?}
  B -- true --> P[Pool as today, deprecated]
  B -- false --> O[Pool off]
  B -- not set --> T{warmPool.targets set?}
  T -- yes --> W[Start warning: targets ignored] --> O
  T -- no --> O
  O --> L[Agent leases: a copy is made and booted<br/>about 8 s Android, 28 s iOS]
  L --> R[Lease ends: device deleted, nothing booted back]
  O --> Q[Several requests wait for capacity]
  Q --> S[Each one that fits starts its device at once,<br/>oldest first]
Loading

A worker whose config.json has {"warmPool": {"targets": [{"platform": "ios", "model": "iPhone 17", "count": 1}]}}:

Before, simlock daemon start prints nothing about the pool and boots one iPhone 17 after start.

After, the daemon's log at start holds:

warmPool.targets is ignored: the warm pool is off by default and deprecated, and a later release removes it. Set warmPool.enabled to true to keep these targets until then.

and nothing is booted until a lease asks for one.

simlock status, on a worker with no warmPool config:

Before:  warm pool: enabled, reserve ios 0 android 0
After:   warm pool: disabled, reserve ios 0 android 0

Three agents ask for an iPhone while a worker with ios.maxRunning: 3 runs three leased iPhones, and then two of those leases end. simlock list shows the line:

Before (pool off):  #1 waiting: iOS running limit   #2 waiting: Behind an earlier request   #3 waiting: Behind an earlier request
After:              #1 waiting: iOS running limit   #2 waiting: iOS running limit           #3 waiting: iOS running limit

Then the two leases end. Before (pool off), #1 starts its device and #2 waits about 28 s for #1's grant. After, #1 and #2 start at once, and #3 waits for the next slot.

Examples

What a worker does with each warmPool config, after the change:

warmPool in the config Today After
not set pool on, learns kinds pool off, no warning
{"enabled": true} pool on pool on (deprecated)
{"enabled": false} pool off pool off
{"targets": [one]} pool on, keeps the target pool off, start warning
{"targets": []} pool on pool off, no warning
{"enabled": true, "targets": [one]} pool on, keeps the target pool on, keeps the target
{"enabled": false, "targets": [one]} pool off, target short disabled the same, no warning
{"learn": false} pool on, targets only pool off, no warning
{"quarantine": {"maxRetries": 1}} retries set, pool on retries set, pool off
warmPool.targets in a gateway's config ignored with the gateway's warning the same, no second warning

What a waiting request does with the pool off, after the change. A request waits in the line when capacity refuses it:

Line Today After
two waiting, two slots free at once first starts, second waits for its grant both start at once
iOS first waiting for RAM, Android second fits Android waits behind iOS Android starts, iOS keeps waiting
two waiting, one slot free first starts first starts, second keeps waiting with its own reason
a --no-wait request while one waits refused, behind an earlier request the same
a request arriving to an empty line plans at once the same
a request arriving while others wait waits behind them, behind an earlier request plans at once against what capacity is left; if refused, joins the back with its own reason
any of the above with warmPool.enabled: true as today as today

What could go wrong

  • An operator who relied on spares sees slower leases after the upgrade: about 28 s on iOS instead of 1 to 4 s. Likely for anyone who set targets. The start warning and the website say how to turn the pool back on.
  • A burst of waiting requests starts more boots at once than the pool allowed. The machine is loaded harder for a moment, within its capacity limits. Likely on a small Mac at its limits.
  • A large request waiting for RAM could wait longer while smaller ones behind it keep fitting. The pool does the same today, so this is rare.

Words used

  • warm pool: the worker part that keeps idle devices booted ahead of demand, e.g. a spare iPhone 17 ready for the next lease.
  • learned kind: a device kind the pool keeps ready because it was leased before, e.g. iPhone 17 on iOS 27.2, full mode.
  • target: a device kind the operator lists in warmPool.targets to keep ready.
  • cold lease: a lease served by making a copy of a seed and booting it, with no device waiting.
  • waiting line: the requests a worker holds until capacity frees, oldest first (simlock list shows them).
  • capacity: the worker's limits on devices that exist, devices running and RAM, e.g. ios.maxRunning: 3.
  • deprecated: still works when turned on, documented as going away, removed in a later release.

Non-goals

  • Removing the pool's code, its keys, simlock warm forget, the status block, the event, the doctor finding or the console tab. A follow-up feature does that in the release after this one ships.
  • A deprecation warning for every warmPool.* key, a doctor finding or a console notice. Only a targets-only config warns.
  • Fixing the boot and shutdown loop under memory pressure in the pool. It is a known gap for a worker that turns the pool on.
  • Finding out why booting an iOS copy takes 17–27 s where about 7 s was expected. That gets its own issue.
  • Changing warmPool.quarantine.*, memoryPressure.pauseWarming, the warm and booted lease sources or the gateway's warm-hit rank. None of them belongs to the pool.
  • A limit on how many devices leasing starts at once.

Completion conditions

  • A worker started with no warmPool config learns nothing and boots no device after a lease ends (B6).
  • A worker whose config sets warmPool.targets without warmPool.enabled logs the start warning once (B7).
  • With the pool off, two requests waiting for capacity both start a device when two slots free at once (B1).
  • A --no-wait request is still refused while a request waits (B2).
  • The pool's e2e files pass with the pool turned on in their own config, and the rest of the e2e suite passes at the new default (B8).
  • The website's warm pool pages and its configuration reference say the pool is off by default and deprecated (B9).

Open questions

Decisions

  • ADR 0101 — The warm pool is off by default and deprecated, and leasing serves every waiting request (PR #2034): the default, what is deprecated and what stays, and the line rule.
  • Decided by the maintainer in the session: the removal is a follow-up feature of its own, for the release after this one; the announcement is the website and the release notes, plus one start warning for a targets-only config; a targets-only config leaves the pool off; leasing's waiting line is fixed here; the iOS boot time is a separate issue.
  • Decided in the session: the warm and booted lease sources and the gateway's warm-hit rank stay, because warm is any grant of an already booted device, phones included, and warm-hit is the one rank a phone request goes through.
  • Decided in the session: warmPool.quarantine.* stays and is not deprecated, because it is the retry rule of every quarantined device, physical included.
  • Decided in the session: memoryPressure.pauseWarming stays, because a seed settle also waits at its warming-paused step (src/core/seed-settle/policy.ts:88).
  • Decided in the session: the boot and shutdown loop under memory pressure is not fixed, because the pool is off by default and on its way out.
  • Decided in the session: the warning says "a later release" and names no version, because the release that ships this is not fixed yet and a wrong number is worse than none.
  • Decided in the session: the line serves every waiting request in order, each against the capacity the earlier ones left (one behind may start first), because that is what the pool does for waiting requests today (ADR 0038 §6). Strict order was rejected: an iOS request would wait behind an Android one for capacity it does not need.
  • Decided in the session: a --no-wait request is still refused while any request waits, because otherwise a gateway's dispatch, always --no-wait, would overtake a worker's local line.
  • Decided by the maintainer in the session: with warmPool.enabled: true, leasing keeps today's rule (only the first in line plans, the pool serves the rest), because the pool reserves capacity for a waiting request and its device is registered only once the copy is made (src/core/warm-pool/converger.ts:859, src/core/device-provisioner.ts:143), so a request that also planned would create a second device. The removal feature deletes the branch.
  • Decided in the session: a request that arrives while others wait plans at once against the capacity left, because the waiting ones already planned against the capacity they saw; only a refusal puts it at the back of the line.
  • Decided in the session: the release notes carry the change through Warm pool: off by default and deprecated #2038's PR title, a breaking feat!:, because the notes are GitHub's generated list of PR titles (.github/workflows/release.yml:245).
  • Decided in the session: e2e files that test the pool turn it on in their own config; every other e2e runs at the new default.
  • Decided in the session: when the follow-up feature removes the code, the reaper takes over shutting down idle booted devices from the pool's off branch (src/core/warm-pool/policy.ts:150). Recorded here for that feature; nothing changes now.
  • Decided in the session: Console: warm the pool up and down, and add a device from the catalog, without a restart #1137, Runtime warm-pool targets: warm.set and warm.list, kept in state.db #1143, Warm-pool targets over HTTP and the CLI #1144, Console: edit the warm pool's targets on a worker's Warm pool tab #1145, Console: Add device… from the catalog keeps one more warm #1146, Keep a prepared warm spare shut down #1555 and PR docs(adr): propose 0056, an operator sets warm targets at runtime (#1137) #1139 are closed with a comment pointing here once this design is approved.

Behaviours

Id Behaviour (invoker, action, what it sees) Seam Cases Task
B1 Agents whose requests wait on a worker with the pool off: each waiting request plans its own device in line order, against the capacity the earlier ones left, and starts it at once when it fits; a new request plans at once and joins the back only when refused createHarness({ warmPoolEnabled: false, limits }) (src/leasing/test-create-leasing.ts:122); the line is built by holding leases (as src/leasing/create-leasing-waiting-reasons.test.ts:36), creations held in flight with FakeDriver.hangMakeReady/releaseMakeReady (src/core/fake-driver.ts:772) two waiting, two slots free at once: two creations in flight together; two waiting, one slot free: only the older starts, the other stays queued with its capacity reason; iOS first refused for its running limit, Android second fits: Android is granted, iOS keeps waiting; a shut-down device that serves the second: it is booted for the second while the first creates; a waiting request cancelled while the one ahead creates: the one behind it plans; a new request while one waits and a slot is free: it plans at once; a new request while one waits and no slot is free: it joins the back with its capacity reason #2037
B2 An agent sends a --no-wait request while a virtual request waits: refused NO_CAPACITY, reason behind-earlier-request, as today createHarness (src/leasing/test-create-leasing.ts:122) one waiting and queued; one waiting and starting its device; the line empty: plans as today #2037
B3 An operator lists the line (simlock list, waitingRequests()) on a worker with the pool off: each queued virtual request shows its own reason, never "Behind an earlier request" src/leasing/create-leasing-waiting-reasons.test.ts:36 with warmPoolEnabled: false two at the iOS running limit: both platform-running-limit; a physical request behind an older physical one: behind-earlier-request, as today #2037
B4 A worker with warmPool.enabled: true and requests waiting: leasing keeps today's rule, so only the first in line plans and each waiting request gets one device createHarness({ warmPoolEnabled: true, startPool: true }) (src/leasing/test-create-leasing.ts:142, :151) two waiting, two slots free: the second is listed behind-earlier-request, the pool creates its device and it is granted that one, one creation per request; the existing tests of the pool's queue step pass unchanged #2037
B5 The lease model keeps its invariants with every waiting request planning src/leasing/lease-model.test.ts:12 the default seeds; the allowances unchanged #2037
B6 An operator starts a worker with no warmPool config: warmPool.enabled is false, nothing is learned on a lease, and no device is booted after it ends loadConfig (src/core/config-warm-pool.test.ts:24); createHarness({ startPool: true }) (src/leasing/test-create-leasing.ts:151) with the loaded default for the lease no key: false; enabled: true: true; enabled: false: false; testConfig(): false; a lease granted and released at the default: no learned kind, no boot #2038
B7 An operator starts a worker whose config sets warmPool.targets and no warmPool.enabled: the load warns once with I1, and the pool stays off loadConfig({ warn }) as src/core/config-platform-and-driver-settings.test.ts:40 passes warn one target, no enabled: one warning; targets in the overrides layer only: one warning; targets in the file and enabled: true in the overrides: none; enabled: true: none; enabled: false: none; targets: []: none; gateway role: only the gateway's own "Ignoring" warning (src/core/config-role-checks.ts:129) #2038
B8 A maintainer runs the e2e suite and the release checks: every test that needs the pool turns it on in its own config (or no longer waits for a spare) and passes; the others pass at the new default each file's own config (withConfig, e2e/helpers/env.ts:355, which deep-merges, so refillDelayMs: 0 stays) opt in: e2e/warm-pool-learned.test.ts, e2e/warm-pool-reserve.test.ts, e2e/warm-targets.test.ts, e2e/slow-warm-pool.test.ts, e2e/lease-lifecycle.test.ts:174, e2e/doctor-drift.test.ts:58, e2e/daemon-lifecycle.test.ts:278 and :325, e2e/daemon-restart.test.ts:24, e2e/physical-devices-core.test.ts:289, :317 and :333, e2e/event-history.test.ts:101, e2e/capacity-cleanup-nuke.test.ts:141, e2e/gateway-smoke.test.ts:369, e2e/console/screen.spec.ts:70, e2e/slow-ios-window.test.ts:63, e2e/slow-ios-stream.test.ts:220; e2e/helpers/agent-device-targets.ts:156 and :204 (warmUp, waitForFree wait for spares the pool boots) and their callers e2e/helpers/agent-device-targets.test.ts:113, e2e/slow-agent-device.test.ts:195, e2e/slow-agent-device-gateway.test.ts:154 and :179, e2e/slow-e2e-provider.test.ts:49: the pool on in their config, or the helpers stop waiting for a spare; e2e/slow-ios-slim.test.ts:384 (a warm slim device rebooted); the release checks e2e/release/07-baselines-warm-pool.md:8 and e2e/release/09-memory-pressure.md:7 turn the pool on first; e2e/waiting-requests.test.ts:54 expects the second waiter's own capacity reason instead of "behind an earlier request" (B3); the fast lane at the default; any further file rg -n "warmPool" e2e and rg -ln "spare|learned kind|warm" e2e find #2038
B9 A reader opens the website: the warm pool pages and the configuration reference say the pool is off by default and deprecated, how to turn it on, and that targets need enabled: true pnpm --dir website build concepts/warm-pool.mdx, worker/warm-pool.mdx, reference/configuration.mdx (the warmPool section), and every other page found by rg -il "warm pool|warmPool" website/src/content/docs that says the pool is on by default or that a lease finds a spare #2038

Stored state

none

Interfaces

Id What Shape and bounds Errors and limits Where Task Used by
I1 The start warning for a targets-only config, through loadConfig's warn warmPool.targets is ignored: the warm pool is off by default and deprecated, and a later release removes it. Set warmPool.enabled to true to keep these targets until then. Once per load, worker role only, when the merged warmPool.targets is not empty and no layer sets warmPool.enabled none; the load goes on src/core/config.ts, the worker branch (:217) #2038 —
I3 LeasingConfig gains the pool switch Pick<Config, "health" | "lease"> & { readonly warmPool: Pick<Config["warmPool"], "enabled"> }; the daemon already passes the whole config (src/daemon/worker-composition.ts:375) — src/leasing/create-leasing.ts:40 #2037 —
I2 warmPool.enabled's default false (was true). config.get's shape is unchanged, so no protocol bump — src/core/warm-pool/config.ts:48 #2038 —

Existing code

Commit 62c7299.

Searches: rg -n "warmPool" e2e --glob '*.ts' and rg -ln "spare|learned kind|warm" e2e (the files in B8); rg -n "enabled" src/core/warm-pool (11 hits outside tests); rg -n "behind-earlier-request" src (5 code, 6 test files); rg -n "queue.head\|get head" src/leasing (2); rg -n "maxConcurrentBoots" src outside tests and the pool (1, the contract schema); rg -n "warming-paused\|pauseWarming" src outside the pool (14); rg -n "warmPool" e2e/helpers (1 file); rg -il "warm pool\|warmPool" website/src/content/docs (21 pages).

Id Code (path:line) Today With this feature Handled by
X1 src/leasing/acquisition-workflow.ts:385 nextPlan: a virtual waiter that is not the head plans wait (or no-capacity under noWait) with behind-earlier-request with the pool off, every queued virtual waiter plans with the planner; with it on, as today; a noWait request is refused while the line holds any virtual waiter B1, B2, B3
X2 src/leasing/acquisition-workflow.ts:717 wakeQueue drives the head and every physical waiter with the pool off, drives every queued virtual waiter in line order too, each under the lock in turn; with it on, as today B1
X3 src/leasing/wait-queue.ts:255 head is the first virtual waiter, processing included; a starting head stays in the line until granted unchanged; no longer what decides who plans B1
X4 src/leasing/lease-acquisition-coordinator.ts:298, src/core/warm-pool/converger.ts:859 the pool reserves capacity for a waiter behind the head and registers its device only after the copy; it never creates for the head, and nothing behind the head plans unchanged with the pool on, because leasing keeps head-only planning then B4
X20 src/leasing/create-leasing.ts:40 LeasingConfig is health and lease also warmPool.enabled (I3) B1, B4
X5 src/core/warm-pool/policy.ts:150 pool off: every idle ready device is shut down disabled, nothing else is proposed unchanged; now the default B6
X6 src/core/warm-pool/converger.ts:222 lease.granted learns only with the pool on unchanged; now nothing is learned by default B6
X7 src/core/warm-pool/config.ts:48 enabled: true enabled: false I2
X8 src/core/config.ts:217 the worker branch validates membership and retention also warns I1 B7
X9 src/core/config-warm-pool.test.ts:24 asserts the default is on asserts it is off B6
X10 src/leasing/test-create-leasing.ts:172 the harness turns the pool on unless told unchanged; tests that rely on the pool keep it on B4
X11 src/core/testing.ts:48, src/daemon/test-dispatcher.ts:549, src/daemon/test-server.ts:670, src/cli/test-index.ts:560 these harnesses take the loader's defaults, so the pool is on the pool is off; every test that relies on it through them sets warmPool.enabled: true, e.g. src/daemon/dispatcher-leases-device-mode.test.ts:186, src/daemon/main-stop.test.ts:512 B6
X12 src/leasing/create-leasing-waiting-reasons.test.ts:36 expects behind-earlier-request for the second waiter expects its own capacity reason B3
X13 src/leasing/test-lease-model.ts:27 "an Android request at the head of the line can hold back an iOS one behind it" the comment and any check that rests on it change: an iOS request behind plans for itself B5
X14 e2e/helpers/env.ts:240 the e2e default leaves the pool on, with refillDelayMs: 0 the pool is off by default; each file in B8 sets warmPool.enabled: true B8
X15 src/core/seed-settle/policy.ts:88 a seed settle waits at any memory step but none, warming-paused included unchanged; why pauseWarming stays Decisions
X16 src/leasing/acquisition-waiter.ts:30 GRANT_SOURCE: grant-ready and grant-physical are warm unchanged Decisions
X17 src/gateway/routing/stages/warm-hit.ts:6 the rank a physical request keeps unchanged Decisions
X18 src/leasing/AGENTS.md ("Only the head of the virtual line plans"), src/core/warm-pool/AGENTS.md, docs/internal/flows/device-selection.md:86 describe head-only planning and the pool on by default updated to the new rule and default #2037, #2038
X19 website/src/content/docs/docs/concepts/warm-pool.mdx:8, worker/warm-pool.mdx:12, reference/configuration.mdx:118 "on by default and learns from your leases" off by default, deprecated B9

Tasks

flowchart LR
  A["#2037 leasing serves every waiting request (pool off)"] --> B["#2038 pool off by default, warning, docs"]
Loading

Completion conditions: B6, B7, B8 and B9 by #2038; B1 and B2 by #2037.

Open work in the same area:

Written by an agent.

Sub-issues

Sub-issues

0 of 2 Issues completed
Loading 2 sub-issues

Activity

  1. added
    feature:spec
    on Dec 2, 2026
  2. V3RON commented on Dec 2, 2026

    @V3RON
    ContributorAuthor

    Design posted: the business spec rewritten from the session; Decisions, Behaviours B1–B9, Interfaces I1–I2 and Existing code X1–X19 added; ADR 0101 proposed in #2034.

    Written by an agent.

  3. V3RON commented on Dec 2, 2026

    @V3RON
    ContributorAuthor

    Approve?

    #2033 Turn the warm pool off by default and deprecate it: #2033
    ADR 0101 (PR #2034): the warm pool is off by default and deprecated, and a release after this one removes it. With the pool off, leasing serves every waiting request in line order, against the capacity the earlier ones left. With the pool on, leasing keeps today's rule.

    Decided in the session:

    Task What it delivers Rows Depends on
    T1 With the pool off, every waiting request plans its own device in line order; with it on, as today B1, B2, B3, B4, B5, I3 —
    T2 The pool off by default, the targets-only start warning, the e2e opt-ins, the website pages B6, B7, B8, B9, I1, I2 T1

    Follow-ups filed at stage 5: a feature to remove the pool in the release after this one, and an issue to measure the iOS copy boot (17–27 s against about 7 s expected).

    Check: ready (two checks; all findings fixed).

    Written by an agent.

  4. added a commit that references this issue on Dec 2, 2026
  5. V3RON commented on Dec 2, 2026

    @V3RON
    ContributorAuthor

    Spec updated: tasks #2037 and #2038 written; task ids replace T1/T2 in the rows; Tasks section filled.

    Written by an agent.

  6. added
    feature:planned
    and removed
    feature:spec
    on Dec 2, 2026
  7. V3RON commented on Dec 2, 2026

    @V3RON
    ContributorAuthor

    Planned. Both tasks are task:ready; the tasks check says ready.

    Task What it delivers Depends on
    #2037 With the pool off, every waiting request starts its own device in line order; with it on, as today —
    #2038 The pool off by default and deprecated, the targets-only start warning, e2e opt-ins, website pages #2037

    Chain: chain 2 of 2 tasks — runnable: #2037; #2038 waits on #2037.

    Since the design was settled: ADR 0101 accepted (not yet implemented) on PR #2034; follow-ups filed as #2039 (remove the pool, the release after this) and #2040 (where a cold iOS lease spends its time); #1137, #1143–#1146, #1555 and PR #1139 closed. The tasks check added the e2e helpers warmUp/waitForFree and their callers, e2e/slow-ios-slim.test.ts and release check 09 to B8.

    Written by an agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions