Skip to content

feat(catalog): a worker's catalog names its default image tag and a gateway ranks by it - #1615

Merged
V3RON merged 16 commits into
task/1597from
task/1596
Nov 16, 2026
Merged

V3RON merged 16 commits into
task/1597from
task/1596

Conversation

@V3RON

@V3RON V3RON commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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

  • 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.
  • 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.
  • PROTOCOL_VERSION_RANGE.max is one above Android leases that name no image tag get the worker's android.defaultImageTag where it fits #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 }.
  • 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

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 6 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: 6cde3a20-8009-44e7-9038-7ca285006b29
Commits

Reviewing files that changed from the base of the PR and between 74b99a8 and 80ea461.

Files selected for processing: 15

  • docs/internal/adr/0078-an-android-worker-tries-its-default-image-tag-first-and-falls-back-to-none.md
  • docs/internal/adr/README.md
  • src/cli/commands/catalog.ts
  • src/cli/index-catalog-components.test.ts
  • src/contract/protocol.ts
  • src/contract/status-schemas.ts
  • src/daemon/dispatcher-status.ts
  • src/daemon/dispatcher.test.ts
  • src/gateway/aggregate-catalog.test.ts
  • src/gateway/aggregate.ts
  • src/gateway/routing/request-match.ts
  • src/gateway/routing/serviceability.test.ts
  • src/gateway/routing/stages/warm-hit.test.ts
  • website/src/content/docs/docs/gateway/routing.mdx
  • website/src/content/docs/docs/worker/runtimes-and-images.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 16, 2026

Copy link
Copy Markdown
Contributor Author

Decision taken

Question. Should the gateway rank a tagless Android lease that names a baseline by the worker's default image tag? B7 does not say. The code skips the default for such a request (the request.baseline === undefined guard in defaultImageTagOf, src/gateway/routing/request-match.ts), and no test fails when that guard is dropped.

Options.

  • A: a baseline request ranks as today (taken). A user leasing from a baseline gets the same worker choice as before this feature. This matches Android leases that name no image tag get the worker's android.defaultImageTag where it fits #1595, where a baseline request never gets the default tag on the worker.
  • B: rank a baseline request by the default tag too. A user leasing from a baseline could be steered to a worker with a warm Play Store device that the baseline does not use, which ranks those workers worse.

Why A. It matches the worker's behaviour from #1595 and the code as written. It is the smallest change to undo.

What it takes. B7 now has the case "a request that names a baseline ranks as today", and the next fix run pins it in src/gateway/routing/stages/warm-hit.test.ts. Reverting it means dropping the guard and that test case.

Written by an agent.

@V3RON
V3RON changed the base branch from task/1595 to task/1597 November 16, 2026 15:30
@V3RON
V3RON added this pull request to stack #1612 November 16, 2026 15:33
…worker's CPU when ranking a tagless Android request (#1596)
@V3RON

V3RON commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 72315ba
Round 2: efc335a
Round fix-check: e5d03cc
Round fix-check: 84103ad

Runs: 2. Cost USD: 0.4147. Agent seconds: 179.
Tokens input 43, output 11109, cache read 926993, cache write 84353.
- fix implementer: claude-sonnet-5-5 70 s $0.1548
- review fix-check reviewer: claude-sonnet-5-5 109 s $0.2599
Finding outcomes: {"fixed":5}. Classes: {"routing.mdx newest level false for model-less request":1,"spec I4 any paired level, not tag levels":1,"spec I4 fallback ignores host CPU images":1,"spec I4 fallback to request as it came missing":1,"testing 3":1}.
{"findings":[{"id":"R1","role":"code","class":"spec I4 fallback to request as it came missing","outcome":"fixed","path":"src/gateway/routing/request-match.ts","round":"1","fix":"efc335a99df22897d24bcd21c2fd0ca365b6fcee"},{"id":"R2","role":"code","class":"spec I4 any paired level, not tag levels","outcome":"fixed","path":"src/gateway/routing/request-match.ts","round":"1","fix":"efc335a99df22897d24bcd21c2fd0ca365b6fcee"},{"id":"R3","role":"code","class":"spec I4 fallback ignores host CPU images","outcome":"fixed","path":"src/gateway/routing/request-match.ts","round":"2","fix":"e5d03cc10d249c6f3b45de89dacffa8993904d1a"},{"id":"R4","role":"claims","class":"routing.mdx newest level false for model-less request","outcome":"fixed","path":"website/src/content/docs/docs/gateway/routing.mdx","round":"2","fix":"e5d03cc10d249c6f3b45de89dacffa8993904d1a"},{"id":"R5","role":"code","class":"testing 3","outcome":"fixed","path":"src/gateway/routing/stages/warm-hit.test.ts","round":"fix-check","fix":"5a781b8775d35693e9deb1428f043551c947096c"}]}

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 16, 2026 18:50
@V3RON
V3RON merged commit aa202bb into main Nov 16, 2026
86 of 88 checks passed
@V3RON
V3RON deleted the task/1596 branch November 16, 2026 18:59
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.

A worker's catalog names its default image tag, and a gateway ranks and shows it

1 participant