Skip to content

fix(core): a platform the host cannot run has no capacity, warm reserve or share of the global limit - #1695

Merged
V3RON merged 5 commits into
mainfrom
bug/1689
Nov 18, 2026
Merged

V3RON merged 5 commits into
mainfrom
bug/1689

Conversation

@V3RON

@V3RON V3RON commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1689

Status

Implement: done Review: round 1 + fix-check, 0 open Hardware: Windows check done on DesktopWindows Gate: running
Next: gate

Done when

  • A worker whose host has no driver for a platform reports that platform with 0 devices and 0 running slots, and the global running limit counts only the platforms that can run (src/core/capacity/serving-only.ts, wired in create-core.ts; test: "reports no iOS device or running slot, no iOS warm reserve, and a global running limit of the Android slots alone") — red on the repro branch, green here; the audit's probes break it.
  • The warm-pool reserve of that platform reads 0 (warm-pool/converger.ts, same test) — same test; doctor's reserve matches it (doctor-warm-pool-targets.test.ts).
  • Text status prints no capacity line and no reserve entry for it (cli/format.ts; test: "simlock status prints no iOS capacity line and no iOS warm reserve for a worker that reports 0 iOS devices and 0 iOS running slots") — that test, plus a row for a worker with no served platform.
  • status --json keeps capacity.ios with every figure 0; no protocol bump — no contract or protocol change in the diff; seen on Windows (next line).
  • Windows check: on Windows 11 (build 22631), with the daemon from this branch's build and a data directory of its own, status printed Running global: 0 + 0 reserved/1, only the Android capacity line and warm pool: enabled, reserve android 0; status --json had capacity.ios all 0 and capacity.global.maxRunning 1 — run on DesktopWindows at 9912abd; the later fix commit only changes the no-served-platform line and doctor.

Assumptions

  • Assumption: fixtures with an iOS driver only that assert an Android reserve or a global limit above the iOS one — I gave them an Android driver so their assertions stay unchanged, except server-requests.test.ts, whose global figure now reads 1 because its harness has an iOS driver only.
  • Assumption: does a platform whose driver was refused keep its slots? — yes, as the triage says, but its warm reserve reads 0, as the pool's existing hasDriver already decides.

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 2 blocking, 2 fixed, 1 notes. Claims review: 1 blocking, 1 fixed, 0 notes.
Rounds: 1. Tokens: 2.3M.
Runs: 10. Cost USD: 4.0813. Agent seconds: 1884.

Assessment: complete

Written by an agent.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 46285d08-62c3-4aad-92f3-f18143bdfcc0
Commits

Reviewing files that changed from the base of the PR and between 2df19f8 and 747a570.

Files selected for processing: 15

  • src/cli/format.ts
  • src/cli/index-status-warm-pool.test.ts
  • src/core/capacity/index.ts
  • src/core/capacity/serving-only.ts
  • src/core/create-core.test.ts
  • src/core/create-core.ts
  • src/core/doctor-warm-pool-targets.test.ts
  • src/core/doctor.ts
  • src/core/warm-pool/converger.ts
  • src/daemon/dispatcher-leases-capacity.test.ts
  • src/daemon/dispatcher-leases-device-mode.test.ts
  • src/daemon/dispatcher-status.test.ts
  • src/daemon/server-requests.test.ts
  • src/leasing/create-leasing-waiting-reasons.test.ts
  • website/src/content/docs/docs/worker/monitoring.mdx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@V3RON

V3RON commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Decision taken

Question: should a platform whose driver was refused (the driver exists on the host but its check failed) also report 0 slots, like a platform with no driver at all?

  • Keep its slots (taken). What a user sees: a refused iOS driver on a Mac still shows its iOS capacity line, as today; only a platform the host has no driver for (iOS on Windows) drops to 0.
  • Zero it too. A refused driver's platform disappears from status and from the global limit until the driver passes its check.

Why: it is what the code does today and what the triage proposed; the bug is only about hosts with no driver. No new test: the audit flagged the refused-driver branch of servingOnly as untested, and the existing driver-rejection behaviour is unchanged by this PR.

Reverting: a follow-up that also zeroes rejected platforms in servingOnly (src/core/capacity/serving-only.ts) plus one test at the createCore seam.

Written by an agent.

… doctor skips the reserve of a platform with no driver; drop a manual line the code says (#1689)
@V3RON

V3RON commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 9912abd
Round fix-check: 747a570

Runs: 10. Cost USD: 4.0813. Agent seconds: 1884.
Tokens input 281, output 72335, cache read 8772301, cache write 597236.
- build implementer: claude-sonnet-5-5 628 s $0.846
- audit implementer: claude-sonnet-5-5 100 s $0.2344
- review 1 reviewer: claude-sonnet-5-5 405 s $0.2868
- review 1 spec: claude-sonnet-5-5 14 s $0.1158
- review 1 code behaviour: claude-opus-5-5 340 s $1.4626
- review 1 claims: claude-sonnet-5-5 28 s $0.1599
- fix 1 implementer: claude-sonnet-5-5 86 s $0.2238
- review fix-check reviewer: claude-sonnet-5-5 162 s $0.1348
- review fix-check code behaviour: claude-opus-5-5 96 s $0.5117
- review fix-check claims: claude-sonnet-5-5 25 s $0.1055
Finding outcomes: {"fixed":3,"nonblocking":1}. Classes: {"capped global limit counts unserved records":1,"documentation 7":1,"output malformed with no served platform":1,"two sites decide one reserve rule":1}.
{"findings":[{"id":"R1","role":"code","class":"output malformed with no served platform","outcome":"fixed","path":"src/cli/format.ts","round":"1","fix":"747a57006f2e3d79af1886cd1b475dc132c97a7b"},{"id":"R2","role":"code","class":"capped global limit counts unserved records","outcome":"nonblocking","path":"src/core/capacity/serving-only.ts","round":"1"},{"id":"R3","role":"code","class":"two sites decide one reserve rule","outcome":"fixed","path":"src/core/doctor.ts","round":"1","fix":"747a57006f2e3d79af1886cd1b475dc132c97a7b"},{"id":"R4","role":"claims","class":"documentation 7","outcome":"fixed","path":"src/core/capacity/AGENTS.md","round":"1","fix":"747a57006f2e3d79af1886cd1b475dc132c97a7b"}]}

Written by an agent.

@V3RON

V3RON commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

Not blocking, not verified. Each is one reviewer's claim.

  • code: src/core/capacity/serving-only.ts:40 leftover leased or quarantined records of an unserved platform still use up a served slot under the capped global limit (needs an SDK that vanished after devices existed).

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 18, 2026 08:11
@V3RON
V3RON merged commit 35fadd6 into main Nov 18, 2026
66 checks passed
@V3RON
V3RON deleted the bug/1689 branch November 18, 2026 08:18
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.

On Windows, simlock status lists iOS capacity and counts it in the global limit

1 participant