Skip to content

fix(gateway): a request waits while a connected worker's catalog is not read yet - #1788

Merged
V3RON merged 4 commits into
mainfrom
bug/1629
Nov 20, 2026
Merged

V3RON merged 4 commits into
mainfrom
bug/1629

Conversation

@V3RON

@V3RON V3RON commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1629

Status

Implement: done Review: round 2 passed, 1 finding fixed Hardware: n/a Gate: running
Next: gate

Assumptions

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 1 blocking, 1 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 2. Tokens: 2.1M.
Runs: 10. Cost USD: 2.416. Agent seconds: 972.

Assessment: complete

Written by an agent.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

When a connected, undrained worker has no catalog, routing checks now defer rejection and wait. This applies to capability, except-list, leading-row, and capacity checks. Tests distinguish drained workers from unread workers and cover requests with unknown platform, model, runtime, or capability. The routing documentation now states this behavior.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 63715

Requests that arrive while a connected worker's catalog is still unread now wait instead of being rejected as unknown. No merge-blocking risk remains in the supplied evidence.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main behavior change: a request waits while a connected worker's catalog is not yet read. The raw summary shows serviceability and routing changes that defer rejection for unread w…
Description check Passed The description links issue #1629, states the implementation status, and names the pinned test at the old line 182 that is rewritten for the drained case. It relates directly to the serviceability cha…
Linked Issues check Passed Issue #1629 requires that a request for a model listed only by a connected, undrained worker without a catalog wait instead of failing with UNKNOWN_MODEL. At head 6371556, src/gateway/routing/service…
Out of Scope Changes check Passed Changes stay within the #1629 fix. serviceability.ts adds isUnread and gates the rejection rows on it. It also extracts the known-worker rows into assessKnown, which is the refactor the fix needs. ser…
Full details: Title check

Explanation

The title names the main behavior change: a request waits while a connected worker's catalog is not yet read. The raw summary shows serviceability and routing changes that defer rejection for unread workers, matching the title. The title uses the conventional fix(gateway) prefix and is 80 characters, slightly long but specific.

Full details: Description check

Explanation

The description links issue #1629, states the implementation status, and names the pinned test at the old line 182 that is rewritten for the drained case. It relates directly to the serviceability changes, so it is not off-topic. It is mostly process metadata, but the check is lenient.

Full details: Linked Issues check

Explanation

Issue #1629 requires that a request for a model listed only by a connected, undrained worker without a catalog wait instead of failing with UNKNOWN_MODEL. At head 6371556, src/gateway/routing/serviceability.ts adds isUnread (connection === "connected" && !drained && catalog === undefined). assessLeading returns no rejection when any view is unread, so the UNKNOWN_MODEL check in assessKnown is skipped. assessExcept, assessServing, and the requires branch of assessFleet also return route-or-wait when an unread view exists. The NO_DRIVER and RUNTIME_MISSING rows are skipped in the same way. The pinned test at serviceability.test.ts:182 is rewritten to the drained case, and a new wait test covers the unread case, per the PR description and the changed-file summary. #1300 (UNKNOWN_BASELINE) is background context only and is not a requirement here. The non-blocking note that the NO_CAPACITY row lacks a dedicated test is a coverage observation, not an issue requirement. Limit: the serviceability.test.ts diff was not readable, so test behavior is taken from the PR summary. The head file read confirms the implementation.

Full details: Out of Scope Changes check

Explanation

Changes stay within the #1629 fix. serviceability.ts adds isUnread and gates the rejection rows on it. It also extracts the known-worker rows into assessKnown, which is the refactor the fix needs. serviceability.test.ts changes the pinned test and adds the wait test. docs/internal/adr/0009-gateway-routing-is-a-list-of-stages.md and src/gateway/routing/AGENTS.md document the new waiting rule for unread workers. These documentation changes support the behavior change and do not add unrelated behavior. No unrelated change was found in the evidence available. The serviceability.test.ts diff could not be read, so test-only edits are assessed from the summary.

  • 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

Recent review info

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: c9172070-4c1e-44fc-a987-5de066fc352b
Commits

Reviewing files that changed from the base of the PR and between f8cf4b3 and 6371556.

Files selected for processing: 4

  • docs/internal/adr/0009-gateway-routing-is-a-list-of-stages.md
  • src/gateway/routing/AGENTS.md
  • src/gateway/routing/serviceability.test.ts
  • src/gateway/routing/serviceability.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@V3RON

V3RON commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 54a9e0f
Round 2: 6371556

Runs: 10. Cost USD: 2.416. Agent seconds: 972.
Tokens input 188, output 43413, cache read 3705724, cache write 406218.
- build implementer: claude-sonnet-5-5 197 s $0.2452
- audit implementer: claude-sonnet-5-5 53 s $0.1226
- review 1 reviewer: claude-sonnet-5-5 220 s $0.1476
- review 1 spec: claude-sonnet-5-5 29 s $0.1542
- review 1 code behaviour: claude-opus-5-5 155 s $0.7868
- review 1 claims: claude-sonnet-5-5 27 s $0.1433
- fix 1 implementer: claude-sonnet-5-5 49 s $0.1792
- review 2 reviewer: claude-sonnet-5-5 141 s $0.1294
- review 2 code behavior: claude-opus-5-5 84 s $0.4038
- review 2 claims: claude-sonnet-5-5 17 s $0.1039
Finding outcomes: {"fixed":1}. Classes: {"restart window left on requires/except rows; claim false":1}.
{"findings":[{"id":"R1","role":"code","class":"restart window left on requires/except rows; claim false","outcome":"fixed","fix":"63715562c38520fb31f6ada6be64b4b169d62ceb","path":"src/gateway/routing/serviceability.ts","round":"1"}]}

Written by an agent.

@V3RON

V3RON commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

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

  • spec: src/gateway/routing/serviceability.test.ts row 5 (NO_CAPACITY) has no test of its own; the new wait test covers assessServing's isUnread guard only indirectly.

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 20, 2026 07:12
@V3RON
V3RON merged commit e808cc3 into main Nov 20, 2026
66 checks passed
@V3RON
V3RON deleted the bug/1629 branch November 20, 2026 07:18
V3RON added a commit that referenced this pull request Nov 20, 2026
## Summary

Rewrites the website docs as task pages and concept pages, 63 pages in
all:

- **Task page:** one task: a `Result:` line, *Before you start*, steps
that end in a `Check:` line, and a *When it fails* table.
- **Concept page:** what a feature is and how it behaves, with no steps.

Getting started has one install page per OS (macOS, Linux, Windows
preview). New sections: Concepts and Troubleshooting. New reference
pages: MCP tools, Node client and Web console. Each fact lives on one
page; other pages link to it.

Also:

- Removed URLs redirect to their new pages.
- The docs links in the CLI, the console, the manuals and `README.md`
point at the new pages.
- The sidebar sections in `website/src/site/pages.ts` name the new
folders.
- SSO sign-in (#1632) and the gateway catalog wait (#1788) are
documented.
- Docs the code contradicted are fixed.

## Validation

- [x] `pnpm --dir website build`: 140 pages, no broken internal links
- [x] `node website/scripts/check-openapi.mjs`
- [x] `pnpm test:changed` (3610 passed)
- [x] `pnpm typecheck`
- [ ] Walk each install page on a clean machine

## Review

Spec review: skipped. Code review: 0 blocking, 0 fixed, 0 notes. Claims
review: 2 blocking, 2 fixed, 0 notes.
Assessment: complete
Rounds: 2. Tokens: 18.8M.

- claims: Ctrl-C on a waiting `simlock lease` cancels the request
(`concepts/queue-and-capacity`), fixed in 4a580f9.
- claims: a phone is not erased after a lease; only apps added since
enrolment are removed (`using-devices/keep-a-device`), fixed in
4a580f9.

*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.

A gateway refuses a lease UNKNOWN_MODEL while the only worker that lists the model is connected but its catalog is not read yet

1 participant