Repository navigation
Description
Request: #1130
Problem
An operator who runs a worker cannot change what the warm pool keeps running without editing config.json and restarting the daemon. To keep one more Pixel 8 warm, or to stop keeping iPhone 17s warm, they run simlock config set warmPool.targets …, which prints "takes effect on daemon restart", and restart. To shut down a device the pool keeps because it learned the kind from a lease, they can only forget the kind from the CLI (simlock warm forget), and the console offers nothing at all: its Warm pool tab only shows.
Nor can the operator add a simulator or emulator of a chosen model and OS ahead of the first agent. A device nobody asked for and nothing keeps is shut down by the pool after 10 minutes (idle.shutdownAfterMs), so "create one" alone would not last.
Who it is for
A developer or an operator who runs one worker for their own coding agents and keeps its console open. They want a different set of devices running ("keep one Pixel 8 and one iPhone 17 warm, shut the rest down") and want to set it where they see it, or from one command, without a restart.
Outcome
On a worker, from the console, the CLI or the HTTP API, the operator can:
- warm up: keep more devices of a kind booted and ready, at once;
- warm down: keep fewer, or none, of a kind; the devices no longer kept shut down at once;
- choose what the pool keeps: the count of every kind, configured or new, and whether it learns kinds from leases;
- forget a learned kind from the console too;
- from the console, add a device of a model, OS and mode picked from the worker's catalog: the pool keeps one more of that kind warm and boots it.
Changes last across a daemon restart. config.json is never rewritten; a runtime count stands in for the configured one until the operator removes it.
How it works for the user
flowchart TD
A[Worker page, Warm pool tab] --> B{What the operator does}
B -->|+ or − on a kind| C[PUT the runtime list with that count]
B -->|Use config or Remove on a runtime row| C
B -->|Learn choice| C
B -->|Forget on a learned kind| F[Confirm, then DELETE the learned kind]
B -->|Add device… beside Enrol phone…| G[Dialog: platform, model, OS, mode from the catalog]
G --> C
C --> D{Daemon answers}
D -->|200| E[Toast; the pool boots, or shuts down what it no longer keeps, at once]
D -->|refused| H[Error toast with the daemon's message]
F --> D
On a gateway, and while the console does not know the daemon's mode, none of these controls is offered: the Warm pool tab stays read-only.
Before, in a terminal on the worker:
$ simlock config set warmPool.targets '[{"platform":"android","model":"Pixel 8","count":1}]'
Updated warmPool.targets in /Users/me/.simlock/config.json; takes effect on daemon restart.
$ simlock warm list
{"error":{"code":"USAGE","message":"Unknown warm command: list (run `simlock --help` for usage)"}}
After:
$ simlock warm set android "Pixel 8" --count 1
Keeping 1 android Pixel 8 warm (runtime). The pool acts on its next pass.
$ simlock warm set ios "iPhone 17" 26.0 --count 0
Keeping no ios iPhone 17 26.0 warm (runtime). Its idle devices shut down now.
$ simlock warm list
Learning: on (configured)
ios iPhone 17 26.0: 0 (runtime; config says 2)
android Pixel 8: 1 (runtime)
Learned: ios iPhone 16 18.5 (full), peak 1
$ simlock warm unset ios "iPhone 17" 26.0
ios iPhone 17 26.0 follows config.json again.
$ simlock warm learn off
Learning: off (runtime).
Examples
A runtime row (warm.set, PUT /v1/warm-pool/targets, simlock warm set):
| Input | Today | After |
|---|---|---|
{platform: ios, model: "iPhone 17", osVersion: "26.0", count: 2} |
no operation | stored; replaces every configured target with the same platform, model, OS and mode |
the same, count: 0 |
no operation | stored; keeps none of that kind, learned or not |
{platform: android, model: "Pixel 8", count: 1}, no configured target of that key |
no operation | stored; the pool creates and boots one |
count: 257, count: -1 or count: 1.5 |
no operation | 400 BAD_REQUEST naming targets.<i>.count |
| two rows with the same platform, model, OS and mode | no operation | 400 BAD_REQUEST naming the second row |
a row with class: "phone" |
no operation | 400 BAD_REQUEST: unknown key |
osVersion: "twenty" |
no operation | 400 BAD_REQUEST naming targets.<i>.osVersion |
| 257 rows | no operation | 400 BAD_REQUEST naming targets |
the list already stored, in the same order, with the same learn |
no operation | 200; nothing changes, no event |
| any input, on a gateway | no operation | 501 UNSUPPORTED_IN_GATEWAY_MODE |
How the key matches a configured target (configured {ios, "iPhone 17", osVersion "26.0", count 2}):
| Runtime row | Replaces it? | Kept warm |
|---|---|---|
{ios, "iPhone 17", osVersion "26.0", count 1} |
yes | 1 |
{ios, "iPhone 17", osVersion "26.0", mode "full", count 1} |
no: mode differs as written |
3, both rows planned (one spec, counts summed) |
{ios, "iPhone 17", osVersion "26", count 1} |
no: osVersion differs as written |
3, if 26 resolves to 26.0 |
| none | — | 2 |
With a second configured target of that same key (counts 2 and 1), the effective list shows one row of count 3; the first runtime row above replaces it, keeps 1, and warm list says config says 3.
What + and Add device… send (a learned peak counts as kept):
| Row | Learned peak of its kind | + sends | − sends |
|---|---|---|---|
| configured, count 1 | none | 2 | 0 |
| configured, count 1 | 3 | 4 | 2 |
| runtime, count 0 | 2 (not planned while the row is there, so learnedCount is 0) |
1 | disabled |
| runtime, count 1 | 3 (not planned) | 2 | 0 |
| Add device… on a kind only learned | 2 | 3 | — |
| Add device… on a new kind | none | 1 | — |
What could go wrong
- The operator lowers a count by mistake and a device shuts down; an agent asking for it pays a boot. Likely now and then; raising the count back boots one.
- A runtime row written with a different OS spelling from the config's does not replace it, and both are kept. Now and then;
simlock warm listand the tab show both rows. - Two people edit the targets at once and one change is lost. Rare on a worker one person runs.
- Two rows of different keys resolve to one kind the pool also learned, and + on one of them keeps more than one extra. Rare; the tab shows the count kept.
- The machine has no room for a raised count; the tab shows the kind short (for example
running-limit). Likely on a small machine; the toast still says the count was set.
Words used
- warm: booted, clean and unleased, so a lease of that kind is granted at once.
- target: a kind of device and how many of it the pool keeps warm, e.g.
{platform: ios, model: "iPhone 17", osVersion: "26.0", count: 2}. - runtime row: a target set from the console, the CLI or the HTTP API, kept in the daemon's state, not in
config.json. - key: a target's platform, model, OS and mode exactly as written; an absent OS or mode is part of it.
iPhone 17+26.0andiPhone 17+26are two keys. - configured target: a target from
config.json'swarmPool.targets. - effective list: the configured targets with those a runtime row of the same key replaces, then the other runtime rows; what the pool keeps.
- learned kind: a kind the pool keeps warm because it was leased in the last 24 hours, e.g.
ios iPhone 16 18.5 (full), peak 1. - learned peak: how many devices of a learned kind were leased at once at the busiest moment of the last 24 hours, at least 1.
- worker mode: the daemon runs devices itself, as opposed to a gateway, which routes to workers.
- principal: the id of the token or signed-in person a request came from; events name it
requesterId.
Non-goals
- Targets set on a gateway for its fleet, or relayed through a gateway to a worker.
- Pinning one device by id; the pool keeps kinds.
- Writing
config.jsonfrom the daemon, and changing any other setting at runtime (Console: manage devices, the warm pool and settings from the console #1130 item 5). - A target of an Android image type (
imageTag): targets have none today. - Refusing a stale write when two operators edit at once.
- An MCP tool for any of this.
Completion conditions
- On a worker,
simlock warm set <platform> <model> --count <n>changes what the pool keeps within one pass, without a restart, andsimlock warm listshows it with originruntime. - Lowering a count shuts the idle devices no longer kept down at once; raising it boots or creates them.
- A daemon restart keeps the runtime rows and the runtime
learn;simlock warm unsetbrings back the configured target. GET /v1/warm-pool,PUT /v1/warm-pool/targetsandDELETE /v1/warm-pool/learnedwork on a worker and answer 501 on a gateway.- On a worker's console, the Warm pool tab sets a kind's count, removes a runtime row, turns learning on or off and forgets a learned kind; on a gateway it offers none of these.
- On a worker's console, Add device… keeps one more of the chosen kind warm, and the pool boots it.
- The website's pages on the warm pool, the CLI, the events and the console describe all this.
Open questions
none
- Moved from Shared values: which Interfaces rows are stored state, and belong under Stored state with their Schema step?
Decisions
- ADR 0056 — An operator sets warm targets at runtime, and they replace the config's (PR docs(adr): propose 0056, an operator sets warm targets at runtime (#1137) #1139): runtime rows in the warm pool's own
state.dbtables; a row replaces the configured targets of the same key; count 0 keeps none, learned included; runtime rows rank with configured counts; a change that keeps fewer devices shuts them down at once;warm.list,warm.set,warm-pool.targets-changed; worker only. - ADR 0051 — Configured warm targets come first: runtime rows fill with them, before learned counts, and may displace.
- ADR 0050 — An operator can forget a learned warm kind: the console's Forget sends
warm.forget. - ADR 0037 — The console acts through the HTTP routes: one action list per kind of item, a confirm for what cannot be undone, results from the daemon's events, worker actions gated on the daemon's mode.
- ADR 0036 — Each owner keeps its own tables: the warm pool's schema owner rises by one version.
- Assumption: Should
simlock warmgainlist,set,unsetandlearn? — yes, so every frontend has the same operations (ADR 0003). - Assumption: Should a runtime row's key be its written fields, not the spec it resolves to? — written fields, so a row that does not resolve today still has a key, and the console knows which configured row a runtime row replaces.
- Assumption: Should a runtime row's count also replace the learned count of its spec? — yes, its count is exact; 0 keeps none, and a lower count is not topped up by learning.
- Assumption: What does + or Add device… raise from, when a learned peak is above the row's count? — the larger of the two:
warm.listgives each row the learned peak of the kind it resolves to, so + never keeps fewer. - Assumption: A runtime row whose key two configured targets share? — it replaces both, is planned once at the first one's place, and its
configuredCountis their sum. - Assumption: What bounds does a runtime row take? — count an integer from 0 to 256, at most 256 rows, the other fields as a configured target's.
- Assumption: How long may the effective list be? — at most 512 rows (256 configured keys, 256 runtime ones), configured targets of one key making one row; status's warm-pool bound rises to 576, since a
config.jsonedit and a restart could pass any limitwarm.setchecked. - Assumption: When does a lowered count act? — in the first pass that plans after the change: it compares the stored rows with those of its last plan and shuts down what that plan kept and this one does not; a pass under nuke, while stopping or that fails leaves it to the next; after a restart there is no last plan, so those devices are left to the idle rules.
- Assumption: How does Forget on an untagged learned kind name what it forgets, when the match also covers tagged kinds? — the confirm and the toast name every kind the match covers.
- Assumption: When does Add device… read the catalog? — before its dialog opens; a failed read or an empty catalog is a toast, not a dialog.
- Assumption: Should a change that keeps fewer devices shut down only devices it stopped keeping? — yes: devices kept before and not after; a device leased, claimed or serving a waiting request is left alone.
- Assumption: Should
nukeclear the runtime rows? — no, they are settings; nuke still forgets learned kinds. - Assumption: Should
warm.setbe accepted withwarmPool.enabled: false? — yes, stored; nothing is kept until the pool is on. - Assumption: Two writers at once? — the last write wins; the event marks the other console's list stale.
- Assumption: Does
warm.setcompare rows in order? — yes;warm.listreturns the stored runtime list as stored, and clients send it back in that order with their one change. - Assumption: What does the event name,
warm.targets-changedorwarm-pool.targets-changed? —warm-pool.targets-changed, besidewarm-pool.target-missed. - Assumption: What does the event call the caller? —
requesterId, as the lease events name an admin's principal. - Assumption: Should learned kinds get a stepper in the console? — no; they get Forget, and a count is set through a runtime row, since a learned Android kind may carry an image type a row cannot name.
- Assumption: Where does Add device… sit? — beside Enrol phone… on all its surfaces (the Fleet row, the worker page, ⌘K), worker mode only.
- Assumption: Which row does Add device… raise? — the row with the key it would write, else the first effective row that resolved to the picked kind (
warm.listgives each row its resolved OS and mode), so a configured row written with no mode is matched; with none it adds a row. A row already at 256 is a toast at submit, not a disabled button. - Assumption: Should
warm.setwait for a running pass? — no: it stores and answers at once, so a caller's 10 s limit is never spent on a pass; every pass compares the stored rows with those of its last plan. - Assumption: Should the console read the catalog for Add device… from
GET /v1/catalog? — yes. - Assumption: Should Add device… offer a mode for Android? — no; Android offers
fullonly, iOSfullandslim. - Assumption: Which OpenAPI tag do the three routes take? —
Devices, an existing tag.
Behaviours
| Id | Behaviour (invoker, action, what it sees) | Seam | Cases | Task |
|---|---|---|---|---|
| B1 | An admin client sets the runtime list and gets the effective list back, which a later list answers | WarmPool.setTargets, listTargets (converger.test.ts) |
replace a configured target by key; two configured targets of one key make one row, and one runtime row replaces it; a new kind; count 0; a list without a row brings the configured target back; learn set, then absent; a key that differs only by mode as written keeps both; learnedCount of a configured row's learned spec, 0 on a runtime row; resolved of a row with no mode; learn.configured; runtime in stored order |
#1143 |
| B2 | An admin sends an invalid warm.set, or an agent sends either operation, and nothing is stored; a valid one reaches the pool with the caller's principal |
Dispatcher.dispatch("warm.set") |
count −1, 257, 1.5; a repeated key; an unknown key class; 257 rows; osVersion twenty; platform windows; an agent on warm.set and warm.list FORBIDDEN; an admin's principal passed; both operations from the socket (model: src/daemon/server.test.ts:2793) |
#1143 |
| B3 | The pool keeps what the effective list says, from the pass a change asks for | WarmPool (converger.test.ts) |
a raised count boots a shut-down device or creates one; count 0 on a configured kind keeps none; count 0 on a learned kind keeps none; count 1 under a learned peak of 2 keeps 1; runtime learn: false over a configured true; a runtime row fills before a learned kind and displaces it |
#1143 |
| B4 | A change that keeps fewer devices shuts down the idle ones no longer kept at once, initiator warm-pool, log reason target-lowered |
WarmPool (converger.test.ts) |
count 2 → 1 shuts the newest ready one; count → 0 shuts every idle one; a leased device stays; a device a waiting request is matched to stays; runtime learn: false shuts learned-only devices; a raised count shuts nothing; a set during a running pass answers at once and the next pass shuts down; two sets between passes shut down the union; a pass under nuke leaves the comparison to the next pass that plans; a pass that starts right after the store plans with the new rows |
#1143 |
| B5 | A change emits warm-pool.targets-changed with the runtime list, learn and the caller's principal as requesterId; a set that changes nothing emits nothing |
WarmPool.setTargets (converger.test.ts) |
a change; the same input again; a learn-only change; a reordered list |
#1143 |
| B6 | A daemon restart keeps the runtime rows and learn, and nuke leaves them |
the store, reopened (learned.test.ts) |
reopen the same state.db; after the pool's forget(); a database at warm-pool version 1 migrates with no rows (model: learned.test.ts:209) |
#1143 |
| B7 | Status shows a runtime row with origin runtime, and a short runtime row fires warm-pool.target-missed with origin runtime |
WarmPool.figures() and the bus (converger.test.ts) |
a runtime row met; a runtime row short for running-limit; a configured row as today; a configured 26.0 row and a runtime 26 row resolving to one spec report runtime; a list change between two short passes emits once for a row still short; 512 rows and 64 learned kinds pass the status schema |
#1143 |
| B8 | Doctor counts runtime rows in its warm findings | Doctor (src/core/doctor.test.ts) |
a runtime row whose runtime is missing is warm-pool-target-unreachable; a runtime row that replaced a configured one is summed once in the over-limit check, whose remedy says to lower the warm targets' counts in config.json or the runtime list; a count-0 row adds 0 and no finding (src/core/doctor.test.ts) |
#1143 |
| B9 | A store write that fails answers an error, keeps the old rows and emits nothing | WarmPool.setTargets (converger.test.ts) |
the transaction throws | #1143 |
| B10 | A gateway refuses warm.list and warm.set with UNSUPPORTED_IN_GATEWAY_MODE |
the gateway's dispatch (src/gateway/dispatcher.test.ts) |
warm.list; warm.set (extend the warm.forget case at src/gateway/dispatcher.test.ts:1573) |
#1143 |
| B11 | An HTTP caller reaches the three warm-pool routes and the OpenAPI document lists them | createHttpApp (src/http/app.test.ts, openapi.test.ts) |
GET 200; PUT 200 with the body passed through; DELETE with the query passed to warm.forget; an agent token 403; a bad body 400; a gateway's 501 |
#1144 |
| B12 | A user runs simlock warm list and reads the effective list |
simlock CLI entry (src/cli/index.test.ts) |
configured, runtime and replaced rows; learned kinds; --json; nothing set |
#1144 |
| B13 | A user runs simlock warm set and the one row changes, the rest of the runtime list and the runtime learn kept |
simlock CLI entry (src/cli/index.test.ts) |
a new row, at the end; an existing row; --count 0; a runtime learn: false kept; --json; --count missing, 257, 1.5, "", 02 or many is the count usage error; platform windows and --mode tiny are usage errors |
#1144 |
| B14 | A user runs simlock warm unset or simlock warm learn |
simlock CLI entry (src/cli/index.test.ts) |
unset a runtime row; unset a key with no runtime row, sending nothing; learn on, off, config; --json on each; learn maybe is a usage error |
#1144 |
| B15 | An operator opens the Warm pool tab on a worker and sees the targets with a count stepper, Use config or Remove on runtime rows, a Learn choice and Forget on learned kinds | the tab's model (ui/src/model/worker-page.ts, fleet.test.tsx) |
mode worker / gateway / unknown; a configured, a runtime and a replaced row; count 0 disables −, 256 disables +; a learned kind |
#1145 |
| B16 | An operator steps a count, uses config, removes a row or picks Learn, and sees one PUT /v1/warm-pool/targets with the whole runtime list changed by that one thing, then a toast |
useActions().run (ui/src/state/actions.ts) |
+ on a configured row adds a runtime row; + on a row whose learned peak is above its count raises from the peak; − on a runtime row; − to 0 (Keeping no …, Its idle devices shut down now.); Use config drops the row; Remove drops a runtime-only row (Stopped keeping …); Learn off, On, and Config (drops learn; toast from the answer); a runtime learn kept on a count change; three + in a row send 3, 4, 5, each from the last answer; + on a second row keeps the first row's change; every control disabled while a PUT is out; 400 and 501 show the daemon's message |
#1145 |
| B17 | An operator runs Forget on a learned kind and sees a confirm naming it, then one DELETE /v1/warm-pool/learned and a toast |
useActions().run (ui/src/state/actions.ts) |
confirmed, then ['warm-pool'] read again; cancelled sends nothing; an Android kind with an image tag passes it; an untagged kind whose match covers a tagged one names both in the confirm and the toast; nothing forgotten |
#1145 |
| B18 | warm-pool.targets-changed marks the warm-pool list and the workers stale |
staleKeys through the query client (ui/src/state/queries.test.ts) |
the event; warm-pool.target-missed marks nothing, as today |
#1145 |
| B19 | An operator sees Add device… beside Enrol phone… on the Fleet row, the worker page and ⌘K only in worker mode | the action list (ui/src/model/actions.ts) |
mode worker / gateway / unknown |
#1146 |
| B20 | An operator opens Add device… and picks platform, model, OS and mode from the worker's catalog | the browser lane (e2e/console/actions.spec.ts) |
iOS offers full and slim, Android no Mode field; a model lists only its runtimes; a model with no runtime shows No runtime is installed for <model>. and Add stays disabled; Add disabled until all are picked; a catalog read that fails or lists no device opens no dialog and shows its toast; Cancel sends nothing |
#1146 |
| B21 | An operator adds a device and sees one PUT /v1/warm-pool/targets raising that kind's count by one, then a toast |
useActions().run (ui/src/state/actions.ts) |
a kind with a runtime row; the same kind again before a pass, matched by key; a kind with only a configured target written with no mode, matched by resolved; a kind only learned, peak 2, sends 3; a new iOS kind writes its mode, a new Android kind none; a runtime learn kept; the warm-pool read at submit fails (error toast, nothing sent, Retry reads again); a matching row already at 256 sends nothing and shows This kind is already kept at 256.; 400 and 501 show the daemon's message |
#1146 |
Stored state
none
Interfaces
| Id | What | Shape and bounds | Errors and limits | Where | Task | Used by |
|---|---|---|---|---|---|---|
| I1 | Runtime row | {platform: "ios"|"android", model: 1–256 chars, osVersion?: 1–256 chars that parseOsConstraint accepts, mode?: "slim"|"full", count: integer 0–256}; any other key refused; at most 256 rows; key = platform, model, osVersion, mode as written; a repeated key refused |
— | ADR 0056 §1; src/core/warm-pool/config.ts:55-79, src/contract/schemas.ts:476-477 |
#1143 | #1144, #1145, #1146 |
| I2 | Effective list | one row per key: configured targets in config order, those of one key as one row at the first one's place, counts summed; a runtime row replaces the row of its key in place; then runtime rows with no configured target, in list order; at most 512 rows, and status's warm-pool bound rises from 320 to 576; all rank as configured counts (ADR 0051) | — | ADR 0056 §2–3; src/core/warm-pool/config.ts:101-107 (configured keys may repeat); src/contract/schemas.ts:480-481 (status cap 256 + 2×32) |
#1143 | #1144, #1145, #1146 |
| I3 | warm.list answer |
{targets: [{platform, model, osVersion?, mode?, count, origin: "configured"|"runtime", configuredCount?, learnedCount, resolved?: {osVersion, mode}}], runtime: {targets: [runtime row], learn?: boolean}, learn: {value: boolean, origin: "configured"|"runtime", configured: boolean}, learned: [{platform, model, osVersion, mode, imageTag?, count}]}; targets is the effective list; configuredCount (summed) only on a runtime row that replaced configured ones; learnedCount the learned peak the pool plans for the spec the row resolves to, 0 on a runtime row (its count is exact) and when none, unresolved or learning off; resolved the OS version and mode (full or slim) the row resolved to in the last pass, absent when it did not resolve; runtime the stored list in stored order |
— | ADR 0056 §5 | #1143 | #1144 (CLI), #1145, #1146 |
| I4 | warm.set input and answer |
input {targets: [runtime row], learn?: boolean}, replacing the whole runtime list and the runtime learn (absent learn removes it, so a client changing one row resends runtime.learn); unchanged when the list, in order, and learn equal the stored ones; answers the warm.list answer |
— | ADR 0056 §5 | #1143 | #1144, #1145, #1146 |
| I5 | Count a client raises from | + and Add device… send max(count, learnedCount) + 1, − sends max(count, learnedCount) − 1, between 0 and 256; Add device… raises the effective row whose key is the one it would write (iOS: platform, model, OS, mode; Android: platform, model, OS), else the first effective row whose platform, model and resolved equal the picked kind (Android's mode counting as full); with none, it adds a row at the end (iOS writes the picked mode, Android none) from the peak of a learned kind with the same platform, model, OS and mode and no image tag, else 0 |
— | ADR 0056 §2; src/core/warm-pool/policy.ts:525-529 (kept = max of the two) |
#1145 | #1146 |
| I6 | warm-pool.targets-changed |
payload {targets: [runtime row], learn?: boolean, requesterId: string} (the caller's principal); once per warm.set that changes the stored list or learn; none otherwise |
— | ADR 0056 §5; src/bus/index.ts:210-233 (requesterId for a principal) |
#1143 | #1145 (marks ['warm-pool'] and the workers, ['workers'] and ['inbox'], stale) |
| I7 | Status figures origin |
configured, runtime or learned; warm-pool.target-missed origin configured or runtime |
— | src/contract/schemas.ts:502, src/bus/index.ts:279; its EVENTS.md row |
#1143 | #1145 (the figures table's Origin column) |
| I8 | Protocol | #1143 bumps it by one, and adds warm-pool to CORE_ROUTE_SEGMENTS; #1144 to #1146 change no contract shape |
— | src/contract/protocol.ts:13, :82-98 |
#1143 | #1144 (the routes' segment) |
| I9 | Gateway refusal | warm.list, warm.set, warm.forget: UNSUPPORTED_IN_GATEWAY_MODE, "<operation> acts on one machine's devices; run it against a worker"; HTTP 501; written by #1143 (operations), #1144 (routes) |
— | src/gateway/dispatcher.ts:767-774, src/contract/errors.ts:423 |
#1143 | #1145, #1146 (offer nothing on a gateway) |
| I10 | HTTP routes | GET /v1/warm-pool → warm.list; PUT /v1/warm-pool/targets (JSON body = warm.set input) → warm.set; DELETE /v1/warm-pool/learned?platform=&model=&osVersion=&mode=&imageTag= → warm.forget; all role admin, tag Devices |
— | ADR 0056 §6; PUT is new on both sides: src/http/routes.ts:98, ui/src/data/api.ts:29, :106 |
#1144 | #1145, #1146 |
| I11 | Kind spelling | <platform> <model> [<osVersion>], then (<mode>[, <imageTag>]) when given, e.g. ios iPhone 17 26.0 (slim); used by the CLI's lines and the console's toasts |
— | src/cli/commands/warm.ts:73-78 (named) |
#1144 | #1145, #1146 |
| I12 | Shutdown log reason | target-lowered, in the daemon log line "a warm pool shut a device down"; device.shutdown stays {deviceId, initiator} with initiator warm-pool |
— | src/core/warm-pool/converger.ts:723-731, src/bus/index.ts:181; its EVENTS.md row |
#1143 | — |
| I13 | Console mode gate | the warm controls and Add device… are offered only when the mode is worker; gateway or unknown offers none, and the console does not read GET /v1/warm-pool |
— | ADR 0037 §4; ui/src/data/mode.ts:4, :43 |
#1145 | #1146 |
Existing code
Commit ce8fea8.
Searches: #1143: config.warmPool (4 hits, 2 files), figures() (9 hits, 6 files), targeted() (3 hits, 2 files), warm_kinds (10 hits, 1 file), warmPool.targets (5 hits, 4 files); the one writer of config.json is simlock config set (src/cli/commands/config.ts:60-62).; #1144: callers of setWarmTargets and listWarmTargets (none before this task), writers of the runtime list (warm.set only).; #1145: writers of the runtime list (warm.set: #1144's CLI and this tab), readers of ['warm-pool'] (this tab only), the workers' warmPool figures (warmTabOf).; #1146: writers of the runtime list (#1144's CLI, #1145's tab, this dialog)..
| Id | Code (path:line) | Today | With this feature | Handled by |
|---|---|---|---|---|
| X1 | A pass running when setTargets is called |
— | setTargets stores and answers without waiting; the running pass plans with the rows it read at its start, and the next pass sees the new rows and compares |
#1143 (wins: the change, from the next pass) |
| X2 | Two warm.set between passes |
— | the next pass compares the rows of its last plan with the latest rows | #1143 (wins: the later list; the union of what both lowered is shut down) |
| X3 | targeted() read by the reaper |
— | reads the effective list from the next resolve on; before that, the last pass's | #1143 (wins: the effective list, from the next pass) |
| X4 | idle-shutdown, idle-destroy |
— | a device the change stopped keeping may be proposed by both; each revalidates ready and unclaimed under the lock |
#1143 (wins: the first to claim; the other skips) |
| X5 | A lease granted between the change and the pass | — | the shutdown revalidates no lease (F6) | #1143 (wins: the lease) |
| X6 | A waiting request | — | its matched device is in targeted() before and after, so never in the difference (F5) |
#1143 (wins: the request) |
| X7 | forgetKinds |
— | keeps the backoff of a spec any effective-list row resolved to | #1143 (wins: the effective list) |
| X8 | Nuke | — | forget() clears learned kinds only; runtime rows stay |
#1143 (wins: —) |
| X9 | simlock config set warmPool.targets |
— | writes the file; after a restart a runtime row still replaces a configured target of its key | #1143 (wins: the runtime row) |
| X10 | config.get |
— | still answers the file's warmPool; runtime rows are only in warm.list |
#1143 (wins: —) |
| X11 | Doctor | — | reads the effective list for both warm findings | #1143 (wins: —) |
| X12 | config.json with two targets of one key |
— | one runtime row of that key replaces both, once (F28) | #1143 (wins: the runtime row) |
| X13 | Another warm set or a console change between this command's warm.list and its warm.set |
— | this command sends the list it read with its one change | #1144 (wins: the later warm.set; the earlier change is lost (#1137's Assumption on two writers)) |
| X14 | warm unset or warm learn |
— | read warm.list and send the stored runtime list with one change, the same way |
#1144 (wins: the later warm.set) |
| X15 | simlock config set warmPool.targets |
— | writes the file; a runtime row still replaces its key after a restart | #1144 (wins: the runtime row; warm list shows runtime) |
| X16 | A CLI warm set or another console between this tab's read and its PUT |
— | this tab sends the list it last read with its one change | #1145 (wins: the later PUT; the event marks this tab stale and it reads the list again) |
| X17 | Two clicks before the first answer | — | the second is disabled while the write is in flight (F6) | #1145 (wins: the first) |
| X18 | The figures table (['workers']) |
— | changes after the pool's pass, read again on the event | #1145 (wins: —) |
| X19 | #1145's tab or a CLI warm set between this dialog's GET /v1/warm-pool and its PUT |
— | the dialog sends the list it read at submit with its one change | #1146 (wins: the later PUT (#1137's Assumption on two writers)) |
| X20 | A second Add while the first is in flight | — | Add is disabled while busy | #1146 (wins: the first) |
Tasks
flowchart LR
A["#1143 warm.set and warm.list"] --> B["#1144 HTTP routes and CLI"]
B --> C["#1145 Console: Warm pool tab"]
C --> D["#1146 Console: Add device…"]
E["#1133, #1135 (feature #1131)"] --> C
E --> D
- Runtime warm-pool targets: warm.set and warm.list, kept in state.db #1143 Runtime warm-pool targets:
warm.setandwarm.list, kept instate.db— an admin client changes what the pool keeps without a restart. Risk: a lowered count shuts down a device it should not, if the before-and-after comparison is wrong. - Warm-pool targets over HTTP and the CLI #1144 Warm-pool targets over HTTP and the CLI — a user runs
simlock warm list|set|unset|learn, or calls the three routes. Risk:warm setdrops another runtime row if it does not keep the rest of the list. - Console: edit the warm pool's targets on a worker's Warm pool tab #1145 Console: edit the warm pool's targets on a worker's Warm pool tab — an operator warms up and down, picks learning and forgets a kind from the console. Risk: a stepper sends a stale list and undoes another change.
- Console: Add device… from the catalog keeps one more warm #1146 Console: Add device… from the catalog keeps one more warm — an operator adds a device of a chosen model and OS. Risk: the dialog offers a model and OS pair the catalog does not pair, and the target stays short.
Completion conditions:
simlock warm setandwarm listwithout a restart: Warm-pool targets over HTTP and the CLI #1144 (the behaviour is Runtime warm-pool targets: warm.set and warm.list, kept in state.db #1143's).- Lowering shuts down at once, raising boots: Runtime warm-pool targets: warm.set and warm.list, kept in state.db #1143.
- A restart keeps the rows;
warm unset: Runtime warm-pool targets: warm.set and warm.list, kept in state.db #1143 (the restart), Warm-pool targets over HTTP and the CLI #1144 (unset). - The three routes, and 501 on a gateway: Warm-pool targets over HTTP and the CLI #1144.
- The Warm pool tab's controls, none on a gateway: Console: edit the warm pool's targets on a worker's Warm pool tab #1145.
- Add device…: Console: Add device… from the catalog keeps one more warm #1146.
- The website: Runtime warm-pool targets: warm.set and warm.list, kept in state.db #1143 (events), Warm-pool targets over HTTP and the CLI #1144 (CLI, capacity, configuration, the HTTP reference from the OpenAPI document), Console: edit the warm pool's targets on a worker's Warm pool tab #1145 and Console: Add device… from the catalog keeps one more warm #1146 (console).
Open work in the same area:
- docs(adr): propose 0056, an operator sets warm targets at runtime (#1137) #1139 (ADR 0056's PR): the bottom of this feature's stack; merges with its last task.
- Console: enrol and remove phones, and delete idle simulators and emulators #1131's tasks Console: enrol a phone from the plugged-in list or by id, and remove an enrolled one #1133 and Console: delete an idle simulator or emulator #1135 add ids to
ItemAction["id"](ui/src/model/actions.ts:27-34); Console: enrol a phone from the plugged-in list or by id, and remove an enrolled one #1133 addsenrolActions, the form fields onActionConfirm(ui/src/ds/confirm-dialog.tsx), Enrol phone… on the worker page andwebsite/.../worker/console.mdx. Console: edit the warm pool's targets on a worker's Warm pool tab #1145 adds ids to the same union and edits the same page; Console: Add device… from the catalog keeps one more warm #1146 joinsenrolActions' surfaces and extends its form. So Console: edit the warm pool's targets on a worker's Warm pool tab #1145 and Console: Add device… from the catalog keeps one more warm #1146 depend on Console: enrol a phone from the plugged-in list or by id, and remove an enrolled one #1133 and Console: delete an idle simulator or emulator #1135: Console: enrol and remove phones, and delete idle simulators and emulators #1131's tasks go first. - device attached lists the phones plugged into a worker that have no record #1134 changes
src/contract/operations.ts,src/daemon/dispatcher.ts,src/gateway/dispatcher.ts,src/http/route-declarations.ts,src/cli/index.tsand the protocol. Runtime warm-pool targets: warm.set and warm.list, kept in state.db #1143 and Warm-pool targets over HTTP and the CLI #1144 add to the same files in other places. No Depends on: the protocol bump rule settles whichever merges second, and the other additions do not share lines. - feat(android): android.emulator.hardwareKeyboard gives emulators a hardware keyboard #1082, feat(tunnel): reverse a leased Android device's port over a lease WebSocket on a worker #1121 to feat(tunnel): simlock tunnel forward reaches a leased device's port from the caller's machine #1127 bump the protocol and add to
operations.tsand the dispatchers; feat(daemon): device.rotate rotates a leased iOS simulator #1122 to feat(tunnel): simlock tunnel forward reaches a leased device's port from the caller's machine #1127 also editsrc/daemon/server.ts,src/admin/index.tsandsrc/contract/operations.test.ts, and feat(tunnel): reverse a leased Android device's port over a lease WebSocket on a worker #1121, feat(tunnel): the gateway relays the tunnel socket to the lease's worker #1125 to feat(tunnel): simlock tunnel forward reaches a leased device's port from the caller's machine #1127 editsrc/http/core-routes.test.ts, which Runtime warm-pool targets: warm.set and warm.list, kept in state.db #1143 adds to. No Depends on, for the same reason: additions in other places. - Every action leaves a trace of who did it #703 (who did an action) may later move the
requesterIdthis feature puts on its event. No Depends on: it is arequest:new. - fix(daemon): daemon stop shuts down idle devices (#1056) #1150 (bug/1056) edits the
device.shutdownrows ofdocs/internal/EVENTS.mdandwebsite/.../reference/events.mdx, which Runtime warm-pool targets: warm.set and warm.list, kept in state.db #1143 extends with thetarget-loweredshutdown. No Depends on: whichever merges second resolves a one-row conflict. - No open PR touches
src/core/warm-pool/**orui/src/screens/fleet/worker-page.tsx.
Written by an agent.
Activity
docs(adr): 0056 settles repeated keys, the list bound and the raise b…
docs(adr): 0056's warm.list names what each row resolved to (callstac…
docs(adr): 0056 merges repeated keys, raises the status bound, and bo…
docs(adr): 0056 answers warm.set at once and compares rows in the nex…
docs(adr): 0056 compares learn with the rows (callstackincubator#1137)
docs(adr): propose 0056, an operator sets warm targets at runtime (ca…
docs(adr): 0056 settles repeated keys, the list bound and the raise b…
docs(adr): 0056's warm.list names what each row resolved to (callstac…
docs(adr): 0056 merges repeated keys, raises the status bound, and bo…
docs(adr): 0056 answers warm.set at once and compares rows in the nex…
docs(adr): 0056 compares learn with the rows (callstackincubator#1137)
docs(adr): 0056 runtime rows name no baseline, warm-pool goes to vers…
V3RON commentedon Nov 27, 2026
A change in #1131 that this feature's tasks rest on. #1135 (Delete device) is closed as not planned, so #1145 and #1146 list a closed issue under Depends on. #1133 no longer adds form fields to
ActionConfirm. Enrol phone… opens its own dialog through a form host: anItemActionwithform, anenrolconsole service, and its host insideLiveProvider(#1131 row I9). #1146's Add device… should build on that host. The next spec session on this feature should drop the #1135 line and reread #1133.Written by an agent.
V3RON commentedon Dec 2, 2026
Closing: the warm pool is now off by default and deprecated, and a later release removes it (#2033, ADR 0101 in #2034; removal in #2039). This work builds on the pool, so it will not be done.
Written by an agent.