Repository navigation
fix: command palette shows stale or wrong-agent model results - #139923
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 6, 2026, 4:38 AM ET / 08:38 UTC. ClawSweeper reviewWhat this changesThe command palette refreshes catalogs after configuration changes, scopes searches to the selected agent, and retains model results with retry guidance during temporary read failures. Merge readiness✅ Ready for maintainer review This remains a useful, focused repair: current main still lacks publication-driven refresh and selected-agent binding. No blocking introduced defect was found, and the related staging draft does not supersede this independently scoped PR. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI command palette combines navigation destinations with catalogs and session search results from the Gateway. Its model results open model settings rather than changing the active model. flowchart TD
A[Search input] --> D[Command palette]
B[Selected agent] --> D
C[Gateway publication events] --> D
D --> E[Configured catalog read]
E --> F[Check current connection and request]
F --> G[Fresh results or retained results with retry guidance]
G --> H[Open model settings]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +33, Tests +326, Config +1. Total +360 across 10 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep catalog freshness and result retention owned by the palette, using shared connection and agent-selection lifecycles while preserving existing navigation semantics. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the path: keep a palette search open during catalog publication or switch the selected agent; current main neither subscribes to those publications nor reads the selected-agent owner. No runtime reproduction was executed during this review. Is this the best way to solve the issue? Yes. The patch repairs the component's existing lifecycle using shared owners, preserves prepared catalog reads, and adds meaningful failure and replacement coverage without introducing another catalog implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8b37368a4e3f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Landed after real Gateway/browser validation and a clean platinum local review. Proof: the served palette follows actual CLI catalog publication and sidebar agent selection. Explicit read failure retains only same-agent results, and changing the search recovers without reloading. A held Main reply does not replace Reviewer results.
67 focused component/controller/navigation tests, nine CI registration guards, and the real Gateway/browser suite pass. Native settings, model navigation, shared stores, protocol and auth contracts remain intact. |
…aw#139923) Related: openclaw#136257 ## What Problem This Solves Fixes an issue where users searching in Command Palette would keep seeing retired models after the configured catalog changed. Switching agents in the sidebar also left palette requests scoped to the Gateway default. A failed model read silently removed results without an explanation or an immediate retry path. ## Why This Change Was Made The palette now follows the application agent-selection owner and reloads after catalog/config publication. It retains useful model results during a failure in the same connection and selected agent, shows a retry instruction, and discards old-agent and late responses. The existing Gateway page controller replaces the palette's duplicate connection tracking. Prepared, configured, advertised-method reads and existing navigation stay intact. Native-device Settings, session search and other catalog categories retain their current contracts. This is an independent component-owned extraction; the source draft remains unmerged. ## User Impact An open search shows the new catalog without reloading the app. Temporary failures keep useful choices visible, and the next search can recover. Model entries still open Models; they do not change a session or default model. ## Evidence - Baseline `7e5219093f71586975ef09e861a4506b1041d4f6`: a successful real CLI catalog update emits `config.changed` and `chat.metadata.changed`, but the open palette sends no replacement read and the new model never appears. - The same real Gateway/browser scenario passes with this change: replacement appears, retired entry disappears, an explicit read failure retains choices and shows feedback, changing the query recovers, and Enter opens the existing Models route. - The failure stimulus replaces an observed real reply with an explicit transport error. Catalog data and publication events come from the real Gateway. Browser and Gateway use one matching combined build with isolated synthetic state. - Independent browser validation confirms live publication, retained-error recovery, older-reply rejection, reconnect and model navigation. Native companion and arbitrary source replacement are unavailable in the browser fixture; focused lifecycle/native-navigation tests cover those contracts. - 67 focused component, connection-owner and native-navigation tests pass. They use the actual selection capability and cover agent/source/reconnect/detach replacement, late replies, overlapping publications, closed-palette invalidation and bare-session transcript scope. - The expanded real Gateway/browser test and independent sidebar replay confirm Reviewer-scoped reads, removal of retained Main choices during failure, user-input recovery, and rejection of a held Main reply after Reviewer results arrive. The Agents settings editor keeps its separate selection contract. - Nine focused native test-inventory/command guards, workflow checks, keyless UI translation verification, focused lint and line/assertion checks pass. The new real test is registered in the existing CI command and remains serial. Full type checking is left to CI. - Runtime/UI: +33 lines; CI routing: +1; tests/support: +326; docs/generated: 0. Remaining growth supplies publication/error handling, correct selection ownership and meaningful cross-boundary regression coverage. AI-assisted. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #136257.
What Problem This Solves
Command Palette kept retired models after catalog updates and could search the wrong agent. Failed reads silently removed results without recovery guidance.
Why This Change Was Made
The palette follows the shared agent-selection and connection owners and refreshes on catalog publication. It retains useful same-agent results after failures, shows retry guidance, and rejects old-agent or late responses.
User Impact
Open searches update without reloading the app. Changing the search can recover from a failed read. Model entries still open Models rather than changing a selection.
Evidence
Real Gateway/browser checks reproduced stale results, then verified catalog replacement, failure recovery, sidebar agent switching, late-reply rejection, reconnect, and navigation. All 67 focused component and connection tests passed. The native companion was unavailable; focused tests covered native navigation.
AI-assisted.