Repository navigation
fix(ui): refresh automation models after team agent switch - #164357
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 October 5, 2026, 11:01 AM ET / 15:01 UTC (Revision 8). ClawSweeper reviewWhat this changesRefresh Automations model suggestions when the selected team agent changes, preserve the task list and editor, and move the shared selection observer into the agents module. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main and the latest release still miss selected-agent-only catalog refreshes. The focused implementation and supplied browser proof support keeping it open, with no actionable patch findings. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI Automations page reads scheduled tasks by page scope and model suggestions by selected agent. Team navigation can change the selected agent while the task scope remains All agents. flowchart TD
A[Team agent selection] --> B[Selection observers]
B --> C[Page scope changed]
B --> D[Selected agent changed]
C --> E[Refresh task inventory]
D --> F[Read agent model catalog]
F --> G[Publish current model suggestions]
E --> H[Automations page]
G --> H
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +11, Tests +191. Total +202 across 6 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep catalog suggestions owned by selected agent while inventory and editor state remain owned by page scope. Do we have a high-confidence way to reproduce the issue? Yes: switching selected agent in roster mode while scope stays null demonstrably bypasses current main's scope observer. This review established the path from source without executing target code. Is this the best way to solve the issue? Yes: reuse the existing selected-agent observer and existing guarded catalog loader, preserving the separate scope lifecycle and Sessions semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bb3a8a9ac304. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Maintainer override: the only failing job on exact head de9a710 is |
…164357) Refresh the Automations page model list when the selected agent changes in place, for example when the selected agent is deleted and selection falls back to another agent, instead of keeping the previous agent's models. Fixes openclaw#164346. Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #164346
What Problem This Solves
Fixes: Automations retains the previous agent's model suggestions when the selected team agent changes while the page remains scoped to all agents.
User Impact
User impact: model suggestions follow the selected agent without resetting the all-agent task list or an open automation draft.
Why This Change Was Made
Inventory follows the page scope, while models follow the selected agent. Observe these independently and retire stale catalog results. The existing Sessions observer is moved to the agents module without changing its semantics.
Thanks @TUARAN for reporting the issue and implementing the fix. No overlap with Pash/Sarah changes.
Evidence
Real Chromium and built Gateway
Compared current main
16e94f50ee95237a79368fd012c44cd135d8d8abwith candidatede9a710c7b9801d4c6f3f6b2ceb67f6eb33622b3. Both Gateway/UI builds and Chromium 154 ran in isolated Linux containers, using synthetic agents and credentials, with Gateway state on tmpfs.fixture/main-extraandfixture/writer-extra; use the team roster sidebar.Keep this roster draft, and open the model picker.openclaw --profile <isolated-profile> agents delete writer --force --json.Before: selection is Main, but the picker still contains
fixture/writer-extra, lacksfixture/main-extra, and displays an old-agent error.After: the picker removes Writer's stale suggestions and contains
fixture/main-extra. The same open draft survives.This is a real deletion-driven selection change, not a direct JavaScript call to the selection owner. Ordinary sidebar selection navigates to Chat; it does not reproduce the in-place transition by itself.
Control: both builds remove Writer from the sidebar and retain Main. Opening Main's chat subsequently displays Main Session with Main model, while the previously opened Writer pane retains Writer model on both. The shared Sessions agent-selection-priority tests pass on both builds; the relocated observer body is unchanged.
Regression checks
models.listrequest. These mock-Gateway tests supplement the real-Gateway proof above.openai/gpt-5-mini, reasoning low, configured output budget 4096: completed and returnedlive gate passed.One assistant turn, no tool calls. The credential file and its container were removed.de9a710c7b9801d4c6f3f6b2ceb67f6eb33622b3: review run.CI classification
The three failure entries represent one failed test job and two aggregate gate entries:
checks-ui (3/3): inheritedchat-gateway.test.tscasetimestamps materialized streamed text after the persisted user prompt, expected 201, received 100. The identical case fails on main's run, and was repaired upstream bye1fd019ceaadc4fc2e9b3e8dd44893ba6702a5a6. It also fails identically in the local candidate run. This PR changes neither Chat history timestamp handling nor that test.openclaw/ci-gatecheck and status mirror: aggregate failures, not additional failing test cases.check-guards. Local replay of its executable guards passed, including duplicate, coercion, dependency patch, authentication, and both import-cycle checks. The report-only Git-diff temp-directory annotation step was not replayed.No hosted jobs were rerun. No source changes or new commits were needed for this verification; the contributor's exact reviewed head is preserved.