Repository navigation
fix: show chat model menus without waiting for discovery - #157899
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 25, 2026, 2:43 AM ET / 06:43 UTC (Revision 4). ClawSweeper reviewWhat this changesMakes chat model menus show published choices while discovery continues, and adds a regression test and user and SDK documentation. Merge readiness✅ Ready for maintainer review Current main still makes chat menu reads wait for catalog acquisition. The PR addresses that behavior, and the previously raised SDK compatibility decision is resolved by the recorded owner approval. I found no actionable correctness or security defect. Priority: P2 Review scores
Verification
How this fits togetherChat commands and channel picker buttons use a shared model-menu builder. It reads the Gateway’s prepared catalog, applies visibility and readiness decisions, and returns choices to the chat transport. flowchart LR
A[Chat model request] --> B[Published catalog read]
B --> C[Visibility and readiness]
C --> D[Menu reply]
B --> E[Background discovery]
E --> F[Updated catalog]
F --> G[Next menu request]
G --> B
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +2, Tests +71, Docs +12. Total +85 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one catalog owner serving immediate known choices and later discoveries, while model selection continues to revalidate current readiness and authority. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source shows that chat menus request a writable catalog read that awaits acquisition; the contributor also reports baseline and candidate Gateway timings. I did not execute a current-main reproduction in this read-only review. Is this the best way to solve the issue? Yes. The shared menu loader uses the existing published-catalog owner and leaves explicit inventory refresh and selection validation with their existing owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8fe893da516e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
SDK owner decision (Ayaan): |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper please clarify and re-evaluate the remaining SDK owner-decision gate for head b2764d9. The standalone SDK decision is #157899 (comment). Its author, @obviyus, is Ayaan Zaidi (https://github.com/obviyus), and the repository collaborator-permission API reports Please distinguish the product-owner decision from code review, which has reported no code or security findings. If policy requires a different SDK maintainer to approve despite this direct decision, please cite that ownership/independence requirement and the required role. Do not waive CI or any substantive finding; the question is whether the recorded approval has been attributed correctly. |
|
🦞👀 I queued a lightweight read-only assist pass. It will post a separate answer comment and will not edit the durable ClawSweeper review comment or trigger close, merge, repair, label, or branch changes. Request: please clarify and re-evaluate the remaining SDK owner-decision gate for head b2764d9. The standalone SDK decision is #157899 (comment). Its author, @obviyus, is Ayaan Zaidi (https://github.com/obviyus), and the repository collaborator-permission API reports |
|
ClawSweeper assist: The SDK decision is correctly attributed to Ayaan’s own comment, rather than to a quotation in the PR body. It explicitly approves partial published results for both named builders. The supplied context cites no rule requiring approval from a different SDK maintainer. The reported Evidence:
Suggested next action: Request Source: #157899 (comment) |
|
ClawSweeper assist has resolved the SDK-decision attribution concern: #157899 (comment). It confirms that #157899 (comment) is Ayaan’s own standalone decision approving partial published results for both SDK builders, and cites no requirement for a different SDK maintainer. The production fix and head b2764d9 are unchanged; CI run 36097493602 is green. This records the resolved product decision without waiving code review or CI. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Landed as d3decdc. Chat model menus now return published choices without waiting for cold inventory discovery; reopening includes newly discovered rows. Retained Gateway and Telegram Test Server proof showed known choices while discovery was pending and discovered choices afterward. Exact-head CI passed (run 36097493602), and ClawSweeper Revision 4 is ready with the SDK-owner decision resolved. Thanks for reporting the delay and clarifying the SDK contract. |
…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]>
What Problem This Solves
Fixes: opening
/modelsor 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:
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
pendingProviderscontract 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.sendcommands exercised/models;models.listwas sampled alongside them./modelsreply after acceptancemodels.listsamplesThe 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:
A later candidate reply contained:
Typed selection also completed through the Gateway:
git diff --checkpassed. 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:
Its button showed
vllm (1). The next provider menu offered the known model whilethe 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.