Skip to content

feat(leasing): an Android worker tries its default image tag first (#1595) - #1609

Merged
V3RON merged 15 commits into
feature/1590-adrfrom
task/1595
Nov 16, 2026
Merged

V3RON merged 15 commits into
feature/1590-adrfrom
task/1595

Conversation

@V3RON

@V3RON V3RON commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1595

Status

Implement: done (6/6 green) Review: passed (round 1, round 2; 4 fixed, R4 duplicate) Hardware: n/a Gate: waiting for the stack
Next: joins the #1590 stack; #1596 and #1597 build on it

Assumptions

  • Assumption: the B2 foreign-CPU leasing case — the fake driver has one scripted refusal (taggedRefusals) for both the misfit and the foreign-CPU case, since leasing sees the same missing-runtime refusal; the CPU rule itself is proved in the B10 catalog test.
  • Assumption: B3 baseline and physical cases — both return before the tagged attempt, and a baseline grant needs the real baseline service, so only explicit tag, iOS and unset are tested.
  • Assumption: how protocol tests build a previous range — below min, not by moving both ends, since min stays by spec.

Done when

  • pnpm test:changed passes, with the B1–B5 and B10 tests among the tests it runs. — audit run at 83a3cd2 (6876 tests) and fix run at ea4bec1; the two daemon files that also fail on the merge-base are flaky: lease-files and relay-gateway-files tests answer 422 instead of 201 on a clean base #1613
  • pnpm --dir website install && pnpm --dir website build && node website/scripts/check-openapi.mjs passes. — audit run at 83a3cd2
  • PROTOCOL_VERSION_RANGE.max is one above main's, and min is unchanged. — src/contract range is {89, 90}; review round 1 confirmed the spec's range is delivered as written
  • configuration.mdx lists android.defaultImageTag. choosing-a-device.mdx says what a tagless Android lease gets with and without it: the host-CPU rule, that Play Store images refuse adb root, and --image-tag google_apis for a lease that needs it. The MCP lease tool's description says the worker's default applies when imageTag is omitted. — audit Done when walk 4/4; claims review round 1 raised nothing on these pages

Review

Spec review: 1 blocking, 1 fixed, 0 notes. Code review: 3 blocking, 3 fixed, 1 notes. Claims review: 1 blocking, 1 fixed, 0 notes.
Rounds: 2. Tokens: 4.1M.
Runs: 8. Cost USD: 5.2759. Agent seconds: 2208.
Assessment: complete

Rejected:

  • code: src/daemon/server-roles.test.ts:663 previous-protocol fixture overlaps the widened range — [incorrect] its {min-2, min-1} = {87, 88} still has no overlap with {89, 90}

Written by an agent.

@coderabbitai

coderabbitai Bot commented Nov 16, 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 28 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: 88c1b023-301f-4aff-84b4-0783e89545fb
Commits

Reviewing files that changed from the base of the PR and between 880bec2 and 55b7144.

Files selected for processing: 30

  • docs/internal/flows/device-selection.md
  • e2e/physical-enrollment.test.ts
  • src/contract/config-schemas.ts
  • src/contract/protocol.ts
  • src/core/config-platform-and-driver-settings.test.ts
  • src/core/config-types.ts
  • src/core/config-validators.ts
  • src/core/driver.ts
  • src/core/fake-driver.ts
  • src/daemon/dispatcher.test.ts
  • src/daemon/driver-discovery.test.ts
  • src/daemon/server-roles.test.ts
  • src/daemon/server-update.test.ts
  • src/daemon/test-dispatcher.ts
  • src/daemon/worker-composition.ts
  • src/drivers/android/catalog.test.ts
  • src/drivers/android/catalog.ts
  • src/drivers/android/system-images.ts
  • src/gateway/service-worker-protocol.test.ts
  • src/leasing/acquisition-ports.ts
  • src/leasing/acquisition-spec-resolver.ts
  • src/leasing/create-leasing-warm-targets.test.ts
  • src/leasing/create-leasing.ts
  • src/leasing/lease-acquisition-default-image-tag.test.ts
  • src/leasing/test-create-leasing.ts
  • src/leasing/test-lease-acquisition.ts
  • src/leasing/testing.ts
  • src/mcp/server.ts
  • website/src/content/docs/docs/reference/configuration.mdx
  • website/src/content/docs/docs/using-devices/choosing-a-device.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 added this pull request to stack #1612 November 16, 2026 14:52
…flag at the leasing seam (#1595)

docs: the device-selection flow names the default-tag attempt
…ault tag is pinned off iOS and baselines, and a stale comment goes (#1595)
@V3RON

V3RON commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 83a3cd2
Round 2: ea4bec1

Runs: 8. Cost USD: 5.2759. Agent seconds: 2208.
Tokens input 391, output 117025, cache read 15112315, cache write 658440.
- build implementer: claude-sonnet-5-5 707 s $1.6118
- audit implementer: claude-sonnet-5-5 260 s $0.5027
- review 1 reviewer: claude-sonnet-5-5 535 s $0.356
- review 1 spec: claude-sonnet-5-5 34 s $0.2353
- review 1 code both: claude-opus-5-5 407 s $1.8949
- review 1 claims: claude-sonnet-5-5 49 s $0.2454
- fix 1 implementer: claude-sonnet-5-5 142 s $0.2329
- review 2 reviewer: claude-sonnet-5-5 74 s $0.1969
Finding outcomes: {"duplicate":1,"fixed":4}. Classes: {"B3 baseline and physical cases unproven":1,"architecture 13":1,"protocol widen breaks min-based fixture test":1,"testing 1":1,"testing 2":1}.
{"findings":[{"id":"R1","role":"code","class":"protocol widen breaks min-based fixture test","outcome":"fixed","path":"e2e/physical-enrollment.test.ts","round":"1","fix":"ea4bec199563be84610e255a6a886ad6c9eb4ac0"},{"id":"R2","role":"code","class":"testing 1","outcome":"fixed","path":"src/gateway/service-worker-protocol.test.ts","round":"1","fix":"ea4bec199563be84610e255a6a886ad6c9eb4ac0"},{"id":"R3","role":"code","class":"testing 2","outcome":"fixed","path":"src/leasing/lease-acquisition-default-image-tag.test.ts","round":"1","fix":"ea4bec199563be84610e255a6a886ad6c9eb4ac0"},{"id":"R4","role":"spec","class":"B3 baseline and physical cases unproven","outcome":"duplicate","canonicalId":"R3","path":"src/leasing/lease-acquisition-default-image-tag.test.ts","round":"1"},{"id":"R5","role":"claims","class":"architecture 13","outcome":"fixed","path":"src/core/config-validators.ts","round":"1","fix":"ea4bec199563be84610e255a6a886ad6c9eb4ac0"}]}

Written by an agent.

@V3RON

V3RON commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

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

  • code: src/leasing/acquisition-spec-resolver.ts:76 the physical clause in #defaultTag is a redundant guard behind the coordinator's earlier return (lease-acquisition-coordinator.ts:217); no test would notice its removal.

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 16, 2026 15:13
@V3RON
V3RON merged commit 27fdb7a into main Nov 16, 2026
33 checks passed
@V3RON
V3RON deleted the task/1595 branch November 16, 2026 18:59
V3RON added a commit that referenced this pull request Nov 16, 2026
…mage tag (#1616)

Closes #1597

### Status

Implement: done (2/2 green; Fallow fix 74b99a8) Review: passed (round 1,
round 2, fix-check; 3 fixed) Hardware: n/a Gate: waiting for the stack
Next: in the #1590 stack above #1609

## Assumptions

none

## Done when

- [x] `pnpm test:changed` passes, with the B9 test among the tests it
runs. — audit run at 8a973f1 (`run: pass`); review round 2 re-ran
`index-profiles-components.test.ts` (25) and `driver-discovery.test.ts`
(36) at 0640d5f
- [x] `pnpm --dir website install && pnpm --dir website build && node
website/scripts/check-openapi.mjs` passes. — audit run at 8a973f1 (Done
when walk 3/3)
- [x] `troubleshooting.mdx` lists `default-image-tag-not-installed`,
what it means and how to fix it (install the image with `sdkmanager`, or
correct the setting). —
`website/src/content/docs/docs/worker/troubleshooting.mdx`, cause text
matched to I5's message in review round 2

## Review

Spec review: 4 blocking, 4 fixed, 0 notes. Code review: 3 blocking, 3
fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 2. Tokens: 7.5M.
Runs: 8. Cost USD: 1.9311. Agent seconds: 815.
Assessment: complete

*Written by an agent.*
V3RON added a commit that referenced this pull request Nov 16, 2026
…ateway ranks by it (#1615)

Closes #1596

### Status

Implement: done (419 files, 6891 tests green) Review: passed (round 1,
round 2, fix-check, maintainer-directed fix-check; 5 fixed); ADR 0078
flip 80ea461 verified by: coordinator Hardware: n/a Gate: running for
the stack
Next: merge-pr.sh 1615

## Assumptions

- Assumption: which levels count as warm for a tagless request on a
defaulting worker — the newest level with a host-CPU image of the tag
for a request naming a model, any installed level for one naming none;
with `--os` the named level is kept (revised by review R2 and R3).
- Assumption: how the gateway knows the worker's CPU image — `hostAbiOf`
in `request-match.ts` repeats the driver's `hostAbiFor` rule (arm64 is
`arm64-v8a`, anything else `x86_64`), since the gateway cannot import
the driver; a view with no `host` counts every image, as before.

## Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 4 blocking, 4
fixed, 1 notes. Claims review: 1 blocking, 1 fixed, 0 notes.
Rounds: 2. Tokens: 10.4M.
Runs: 17. Cost USD: 5.8831. Agent seconds: 2299.
Assessment: complete

## Done when

- [x] `pnpm test:changed` passes, with the B6, B7, B8 and B11 tests
among the tests it runs. — ran on head 80ea461: 419 files, 6891 tests
passed; the B6 test is in `src/daemon/dispatcher.test.ts`, B7 in
`src/gateway/routing/stages/warm-hit.test.ts`, B8 in
`src/cli/index-catalog-components.test.ts`, B11 in
`src/gateway/aggregate-catalog.test.ts`.
- [x] `pnpm --dir website install && pnpm --dir website build && node
website/scripts/check-openapi.mjs` passes. — ran on head 80ea461: 92
pages built, `check-openapi: 45 operations, 12 tags: ok`.
- [x] `PROTOCOL_VERSION_RANGE.max` is one above #1595's, and `min` is
unchanged. — `src/contract/protocol.ts:13` is `{ min: 89, max: 91 }`
here; `origin/task/1595` has `{ min: 89, max: 90 }`.
- [x] `routing.mdx` says a gateway ranks a tagless Android lease by each
worker's default tag. `runtimes-and-images.mdx` shows the catalog's
`Default image tag` line and when a gateway prints it. — read in
`website/src/content/docs/docs/gateway/routing.mdx` and
`website/src/content/docs/docs/worker/runtimes-and-images.mdx`; the
website build above passes.

### Feature #1590 completion conditions

- [x] On a worker with API 36 `google_apis_playstore`, API 37
`google_apis` and `android.defaultImageTag: google_apis_playstore`,
`simlock lease --platform android --device "Pixel 9"` grants a Pixel 9
on API 36 whose spec names `google_apis_playstore`. — #1595 (PR #1609):
`src/leasing/lease-acquisition-default-image-tag.test.ts` (B1), green in
`pnpm test:changed`.
- [x] On the same worker, `--os 37` grants API 37 with no tag, and a
Pixel 6 lease grants what it grants without the setting. — #1595: same
file (B2).
- [x] On a worker without the setting, every lease in the Examples table
gets its Today result. — #1595: same file (B3, setting unset).
- [x] A request that names `--image-tag`, a baseline or `--physical`
gets the same result with and without the setting. — #1595: same file
(B3).
- [x] A configured warm target for Pixel 9 with no tag, on that worker,
keeps a Pixel 9 on API 36 with `google_apis_playstore` warm. — #1595:
`src/leasing/create-leasing-warm-targets.test.ts` (B4).
- [x] Through a gateway, a tagless Pixel 9 lease goes to the worker that
has a ready Pixel 9 on 36 with `google_apis_playstore` when another
worker has only free capacity. — #1596 (this PR):
`src/gateway/routing/stages/warm-hit.test.ts` (B7).
- [x] `simlock catalog --platform android` prints `Default image tag:
google_apis_playstore` on that worker, and no such line on a worker
without the setting. Through a gateway it prints the line only when
every Android worker reports the same tag. — #1596:
`src/cli/index-catalog-components.test.ts` (B8),
`src/daemon/dispatcher.test.ts` (B6),
`src/gateway/aggregate-catalog.test.ts` (B11).
- [x] `simlock doctor` reports `default-image-tag-not-installed` when no
installed image for the machine's CPU has the tag, and nothing for the
setting when one does or the setting is unset. — #1597 (PR #1616):
`src/drivers/android/index-profiles-components.test.ts` (B9) and
`src/daemon/driver-discovery.test.ts`, green in `pnpm test:changed`.
- [x] On an arm64 worker whose only image with the tag is x86_64, a
tagless lease gets what it gets without the setting. — #1595:
`src/drivers/android/catalog.test.ts` (B10) and the leasing file above
(B2).
- [x] A value that is not an image tag stops the config load with the
message in I1. — #1595:
`src/core/config-platform-and-driver-settings.test.ts` (B5).

*Written by an agent.*
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.

Android leases that name no image tag get the worker's android.defaultImageTag where it fits

1 participant