Repository navigation
fix: avoid false sign-in prompts during native model discovery - #153796
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 20, 2026, 12:47 PM ET / 16:47 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR distinguishes pending native model discovery from missing sign-in in model menus and setup, and extracts catalog preparation while preserving public SDK exports. Merge readiness✅ Ready for maintainer review Still useful: current main retains the false-auth fallback, and the merged prerequisite does not resolve it. No blocking defects found; the latest test cleanup preserves meaningful Gateway coverage and the supplied proof supports the fix. Priority: P2 Review scores
Verification
How this fits togetherNative model discovery feeds the Gateway’s shared model catalog. Readiness decisions from that catalog determine availability messages in channel menus and selectable choices in Control UI setup. flowchart TD
A[Installed native agents] --> B[Prepared model catalog]
C[Explicit account and API settings] --> D[Readiness decision]
B --> D
D --> E[Channel model menus]
D --> F[Control UI setup]
F --> G[Confirmed model selection]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +37, Tests +16, Docs +5, Other -1. Total +57 across 15 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep native readiness with the existing catalog owner and let setup and channel menus faithfully display unknown, unavailable, and confirmed states. Do we have a high-confidence way to reproduce the issue? Yes, from source: a configured native model without a primary-row observation falls back to host-auth guidance while discovery is pending. Supplied before/after evidence corroborates this; the reviewer did not execute a reproduction. Is this the best way to solve the issue? Yes. The patch repairs the shared readiness decision and reuses it in presentation while preserving explicit host authentication and disabled unknown choices. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0b6152183e49. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
|
Landed in cf625a1. Cold native discovery now stays checking/unconfirmed instead of inventing an API sign-in requirement. Explicit account/transport choices and native readiness hooks remain authoritative; setup does not enable an unconfirmed model. Verified real Telegram/OpenCode cold-to-ready behavior, inspected before/after Control UI proof, public SDK/source-equivalence checks, the registered Gateway/Codex account lifecycle test, a clean final review, and all required hosted checks. Removed the obsolete helper-only metadata assumption rather than changing the runtime to satisfy it. |
…law#153796) Keep native catalog readiness authoritative while discovery is pending or availability is unconfirmed. Preserve explicit host-account/transport choices and native readiness hooks instead of inventing an API sign-in requirement. Share catalog acquisition/projection through one owner, migrate command and SDK callers without changing public exports, and show checking/unconfirmed states in channel menus and model setup. Verified real Telegram Test Server and OpenCode cold-to-ready discovery without inference, full Control UI before/after and selection proof, focused owner tests, SDK smoke, source-equivalent integration, and exact-head review/CI. Co-authored-by: Ayaan Zaidi <[email protected]>
## What Problem This Solves Fixes: opening `/models` or a channel model picker can wait up to five seconds for inventory discovery even when usable models are already known. Related: #153796. ## User Impact Chat model menus return the current known choices while discovery continues in the background. Pending providers retain the existing `checking models…` text, and the next open includes newly discovered models. Discovery does not edit an already-sent reply. ## Why This Change Was Made The shared menu loader requested a writable catalog read, which waits for full inventory acquisition. It now reads the published catalog and lets the existing owner acquire the full inventory in the background. Native readiness and authentication facts still come from the same owner. Typed model selection and explicit refresh retain their existing paths; no configuration, startup, persistence, or protocol changes are required. Owner approval: > “chat pickers answer immediately from known rows, fetch in background” > > — Ayaan, 2026-09-25, model-picker invariants program This decision includes the existing SDK menu builders. The previous implementation already permitted partial results after its five-second acquisition race; awaiting a builder was not a complete-inventory guarantee. The SDK compatibility guide now states the published-row and `pendingProviders` contract explicitly. ## Evidence Built baseline and candidate Gateways used isolated state and a local vLLM endpoint that delayed its model listing by four seconds. Real `chat.send` commands exercised `/models`; `models.list` was sampled alongside them. | Observation | Baseline | Candidate | | --- | --- | --- | | First cold `/models` reply after acceptance | 7.493 s | 1.942 s | | Replies while provider discovery was pending | 5.2–7.5 s | 185–625 ms after the initial replies | | Later reply lists the newly discovered model | Yes | Yes | | Catalog-not-ready errors in 80 `models.list` samples | 0 | 0 | The first end-to-end candidate reply still includes cold session/admission work; this change removes the catalog acquisition wait, not every source of first-reply latency. Before, this reply excerpt arrived after the acquisition wait; after, it arrived while the HTTP listing was still pending: ```text - vllm/known-fixture vllm: checking models… ``` A later candidate reply contained: ```text - vllm/discovered-fixture - vllm/known-fixture ``` Typed selection also completed through the Gateway: ```text Model set to vllm/discovered-fixture for this session only; configured default unchanged. ``` - The held-acquisition regression fails on the original loader because no reply is produced; it passes with the fix and verifies that the next reply includes newly published rows. - Focused command and recovery suites: 61 tests passed across the scoped runs. After constructing the immutable snapshot fixture correctly, the messaging typecheck and held-acquisition regression passed; the regression took 1.054 s. The full recovery-file single-worker run took 35.11 s including worker-artifact preparation. - Clean-clone build, targeted formatting, and `git diff --check` passed. No model inference or paid provider calls were used. ### Telegram Test Server The checkout's Telegram userbot runner exercised the built candidate with a Convex-leased Test Server bot and user authorization. The first recorded menu was: ```text Select a provider: vllm: checking models… ``` Its button showed `vllm (1)`. The next provider menu offered the known model while the HTTP listing was still pending. Reopening after discovery showed two model buttons, including `discovered-fixture`. The first menu arrived 3.951 s after the send receipt, including Telegram ingress and cold-admission work; it was observed 17 ms after the four-second HTTP listing started, well before that listing could complete. The later two-model menu arrived 1.256 s after its send receipt. This proves nonblocking catalog acquisition, not sub-second end-to-end Telegram startup. TDLib recorded three new bot messages and zero edits or deletions: discovery did not modify a previously sent list. Recording completed, the runner released its credential state, and neither task port remained listening. Co-authored-by: Ayaan Zaidi <[email protected]>
…7899) ## What Problem This Solves Fixes: opening `/models` or a channel model picker can wait up to five seconds for inventory discovery even when usable models are already known. Related: openclaw#153796. ## User Impact Chat model menus return the current known choices while discovery continues in the background. Pending providers retain the existing `checking models…` text, and the next open includes newly discovered models. Discovery does not edit an already-sent reply. ## Why This Change Was Made The shared menu loader requested a writable catalog read, which waits for full inventory acquisition. It now reads the published catalog and lets the existing owner acquire the full inventory in the background. Native readiness and authentication facts still come from the same owner. Typed model selection and explicit refresh retain their existing paths; no configuration, startup, persistence, or protocol changes are required. Owner approval: > “chat pickers answer immediately from known rows, fetch in background” > > — Ayaan, 2026-09-25, model-picker invariants program This decision includes the existing SDK menu builders. The previous implementation already permitted partial results after its five-second acquisition race; awaiting a builder was not a complete-inventory guarantee. The SDK compatibility guide now states the published-row and `pendingProviders` contract explicitly. ## Evidence Built baseline and candidate Gateways used isolated state and a local vLLM endpoint that delayed its model listing by four seconds. Real `chat.send` commands exercised `/models`; `models.list` was sampled alongside them. | Observation | Baseline | Candidate | | --- | --- | --- | | First cold `/models` reply after acceptance | 7.493 s | 1.942 s | | Replies while provider discovery was pending | 5.2–7.5 s | 185–625 ms after the initial replies | | Later reply lists the newly discovered model | Yes | Yes | | Catalog-not-ready errors in 80 `models.list` samples | 0 | 0 | The first end-to-end candidate reply still includes cold session/admission work; this change removes the catalog acquisition wait, not every source of first-reply latency. Before, this reply excerpt arrived after the acquisition wait; after, it arrived while the HTTP listing was still pending: ```text - vllm/known-fixture vllm: checking models… ``` A later candidate reply contained: ```text - vllm/discovered-fixture - vllm/known-fixture ``` Typed selection also completed through the Gateway: ```text Model set to vllm/discovered-fixture for this session only; configured default unchanged. ``` - The held-acquisition regression fails on the original loader because no reply is produced; it passes with the fix and verifies that the next reply includes newly published rows. - Focused command and recovery suites: 61 tests passed across the scoped runs. After constructing the immutable snapshot fixture correctly, the messaging typecheck and held-acquisition regression passed; the regression took 1.054 s. The full recovery-file single-worker run took 35.11 s including worker-artifact preparation. - Clean-clone build, targeted formatting, and `git diff --check` passed. No model inference or paid provider calls were used. ### Telegram Test Server The checkout's Telegram userbot runner exercised the built candidate with a Convex-leased Test Server bot and user authorization. The first recorded menu was: ```text Select a provider: vllm: checking models… ``` Its button showed `vllm (1)`. The next provider menu offered the known model while the HTTP listing was still pending. Reopening after discovery showed two model buttons, including `discovered-fixture`. The first menu arrived 3.951 s after the send receipt, including Telegram ingress and cold-admission work; it was observed 17 ms after the four-second HTTP listing started, well before that listing could complete. The later two-model menu arrived 1.256 s after its send receipt. This proves nonblocking catalog acquisition, not sub-second end-to-end Telegram startup. TDLib recorded three new bot messages and zero edits or deletions: discovery did not modify a previously sent list. Recording completed, the runner released its credential state, and neither task port remained listening. Co-authored-by: Ayaan Zaidi <[email protected]>
Builds on #153707.
What Problem This Solves
Fixes incorrect sign-in and custom-provider setup hints while an installed agent's native catalog is still loading.
User Impact
Native models show checking or unconfirmed availability until their own runtime reports usable models. Unknown choices stay disabled in setup; explicitly selected accounts and API routes keep their existing authentication behavior.
Why This Change Was Made
Native-owned readiness stays authoritative even when availability is unknown. Observations must match both model and runtime, and existing readiness hooks still decide readiness when provided. Channel notices and the setup page consume those facts rather than inventing a host API sign-in requirement.
Catalog acquisition/projection is separated from command parsing, preserving the published SDK entry points. There are no schema, model-ID, credential-migration, or dependency changes.
Evidence
Real Telegram Test Server with installed OpenCode 1.18.31, an isolated credential-free home and controlled 12-second startup latency: the same native model moved from 0 of 1 available / Checking native agent to 1 available after discovery. No model prompts or provider inference requests; lease, Gateway and native processes cleaned up.
Full Control UI browser flow with deterministic Gateway replay: pending and unconfirmed rows remain disabled; a confirmed native model sends the exact
agents.updateselection without a setup/inference request.60 command/catalog cases and 25 native catalog-view cases passed. Core/UI type checks, targeted lint, localization verification and runtime build passed.
Catalog extraction preserves function/type contracts and all existing SDK export names. The inherited route-helper relocation is byte-identical.
The registered Gateway/Codex account-catalog test passes across account readiness transitions, explicit host overrides, disconnection, and registry replacement. Removed an obsolete helper-only assertion that treated a missing primary-row metadata tag as host ownership even when a matching native route variant and configured native runtime remained. No production behavior changed in that correction.
Before: discovery was mistaken for missing sign-in
After: pending discovery stays explicit
Unconfirmed availability remains unselectable