Skip to content

fix(ui): stabilize agent model selection on switch - #72328

Merged
vincentkoc merged 2 commits into
mainfrom
clownfish/ghcrawl-165997-agentic-merge
Apr 27, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
clownfish/ghcrawl-165997-agentic-merge

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Summary

Validation

  • pnpm check:changed
  • Codex /review before merge

Fixes #39392. Credits #39401.

ProjectClownfish replacement details:

@greptile-apps

greptile-apps Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the stale primary-model dropdown in the Agents Overview panel by wrapping renderAgentOverview in Lit's keyed(selectedAgent.id, …) directive, which forces a full remount whenever the selected agent changes. A targeted regression test covering the before/after node-identity check is included, along with a CHANGELOG entry.

Confidence Score: 4/5

Safe to merge; the fix is minimal, correct, and covered by a new regression test.

Only a P2 style observation about the await Promise.resolve() flush pattern in the test, which is consistent with the existing suite. No logic or correctness issues in the production code change.

No files require special attention.

Prompt To Fix All With AI
This is a comment left during a code review.
Path: ui/src/ui/views/agents.test.ts
Line: 157

Comment:
**Single microtask tick may not flush Lit rendering**

`await Promise.resolve()` advances only one microtask. Lit's `render()` is synchronous in most jsdom setups, but if `renderAgentOverview` schedules any async work (e.g. via `scheduleUpdate` or reactive property callbacks), the DOM may not be fully settled before the `querySelector` call. The pattern is consistent with the existing suite, but if this test flakes, replacing both awaits with `await new Promise(r => setTimeout(r, 0))` (or a helper that drains microtasks + a 0-ms task) is the idiomatic fix for Lit tests.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "fix(ui): stabilize agent model selection..." | Re-trigger Greptile

Comment thread ui/src/ui/views/agents.test.ts Resolved
@vincentkoc
vincentkoc force-pushed the clownfish/ghcrawl-165997-agentic-merge branch from 7b0815d to ff30dcc Compare April 26, 2026 20:49
@vincentkoc vincentkoc added the clawsweeper Tracked by ClawSweeper automation label Apr 27, 2026
@vincentkoc
vincentkoc force-pushed the clownfish/ghcrawl-165997-agentic-merge branch from ff30dcc to 04d816e Compare April 27, 2026 19:04
@vincentkoc

Copy link
Copy Markdown
Member Author

ProjectClownfish follow-up pushed: 04d816e

Fix:

  • rebased onto current main
  • resolved the changelog conflict and replaced forbidden automation credits with the maintainer credit

Blacksmith validation:

  • pnpm test:serial ui/src/ui/views/agents.test.ts
  • pnpm check:changed

@vincentkoc
vincentkoc merged commit 3cb4608 into main Apr 27, 2026
56 of 60 checks passed
@vincentkoc
vincentkoc deleted the clownfish/ghcrawl-165997-agentic-merge branch April 27, 2026 19:06
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
* fix(ui): stabilize agent model selection on switch

* docs(changelog): credit projectclownfish fixes
globalcaos pushed a commit to globalcaos/tinkerclaw that referenced this pull request May 13, 2026
* fix(ui): stabilize agent model selection on switch

* docs(changelog): credit projectclownfish fixes
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* fix(ui): stabilize agent model selection on switch

* docs(changelog): credit projectclownfish fixes
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* fix(ui): stabilize agent model selection on switch

* docs(changelog): credit projectclownfish fixes
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* fix(ui): stabilize agent model selection on switch

* docs(changelog): credit projectclownfish fixes
vixco pushed a commit to vixco/openclaw that referenced this pull request Aug 16, 2026
* fix(ui): stabilize agent model selection on switch

* docs(changelog): credit projectclownfish fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui clawsweeper Tracked by ClawSweeper automation maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Agent switch causes stale/wrong model selection UI in Control UI

1 participant