Skip to content

fix(ui): refresh selected agent roster immediately - #133133

Merged
vincentkoc merged 2 commits into
mainfrom
fix/ui-agent-roster-refresh
Aug 30, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/ui-agent-roster-refresh

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 30, 2026 •

Copy link
Copy Markdown
Member

Related: #133132

What Problem This Solves

Fixes an issue where selecting a different agent for a global Control UI chat updated the visible owner but did not immediately refresh that agent's session roster. It also prevents an older in-flight roster request from publishing rows or errors after a newer foreground replacement is queued.

Why This Change Was Made

The agent-selection path now refreshes sessions immediately after the owner transition, when the selected agent is authoritative. The roster controller owns a foreground publication generation so queued replacements invalidate older publications without delaying their callers. Fixed-session, append, background, and event transitions remain unchanged.

The production growth is confined to the roster lifecycle owner: it replaces a caller-specific selection fence with one canonical publication boundary shared by bootstrap, queued refresh, reset, and dispose. No compatibility path or downstream fallback was added.

User Impact

The session list and agent-scoped state update immediately after switching agents instead of waiting for a later connection or identity event.

Evidence

  • Pre-fix regression: 2/2 selected-global cases made zero roster-refresh calls.
  • Pre-fix concurrency regressions: 6/6 failed across stale success/error, append/background priority, and bootstrap publication.
  • Focused roster and event regressions: 53/53 passing.
  • Sibling session tests: 40/40 passing.
  • chat-pane-identity.test.ts: 4/4 passing.
  • chat-state.test.ts: 106/106 passing.
  • Full Control UI suite: 12,633 passing, 1 skipped.
  • pnpm tsgo:ui, changed-file gate, format, lint, and diff checks pass.
  • Independent P0-P2 autoreview: scoped-clean.
  • Production LOC: +27/-4 (net +23). Tests: +244/-80.

Visual Proof

An isolated mock-Gateway browser run used the real agent selector and verified:

  • Main roster visible before selection.
  • sessions.list requested with agentId: "work".
  • Work roster visible after selection.
  • Main roster removed after selection.

Command: node --import tsx .artifacts/control-ui-e2e/selected-agent-roster-refresh/record.mts

Capture: three 1440x900 screenshots and a 5.44s video. The artifacts contain only synthetic data. Browser attachment is unavailable in this session, so the sanitized captures are retained locally and identified by SHA-256:

  • Before: ac5fc16740cfcf7029d0780dd9de60743856a537384e8c7015179333d0c9b579
  • Selector: 2294923171af8c815fdcf9ee02dba68e3000447c320927dadeb32e144c5985c6
  • After: 6d4393f966e3dbf6e986cab2bf7eb895f7fff3f3e0b0daf0712cce35a51b8a8c
  • Video: c79369f6f73b07f5e86f2c430c6771319ea923bf235267fa6bdc579e5c59278f

@vincentkoc vincentkoc self-assigned this Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Aug 30, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 7:08 AM ET / 11:08 UTC.

ClawSweeper review

What this changes

This PR refreshes the Control UI session roster after selecting a different global-chat agent and prevents older roster loads from publishing after a newer foreground selection.

Merge readiness

⚠️ Ready for maintainer review - 5 items remain

Keep open for maintainer review. Current main still lacks the selected-global roster refresh, and the branch adds it at the owner transition while fencing stale roster publications in the shared lifecycle; no introduced correctness defect was found.

Priority: P2
Reviewed head: 18b15eb1049cacc1d09fb43642c22d55406cb1c7
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused and has substantial targeted regression coverage, with exact-head CI and independently inspectable visual evidence still pending.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored Control UI PR is exempt from the external-contributor proof gate; its body describes a mocked browser capture, but the referenced artifacts were unavailable for independent review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored Control UI PR is exempt from the external-contributor proof gate; its body describes a mocked browser capture, but the referenced artifacts were unavailable for independent review.
Evidence reviewed 7 items Current-main gap: The fetched main revision performs the global-chat owner transition but returns without refreshing the session roster; the PR adds the refresh immediately afterward.
Scoped request boundary: The existing roster helper derives the agentId from the currently selected global session before issuing a forced session refresh, so calling it after the transition targets the new owner.
Shared publication owner: The introduced generation is captured by each roster load and checked before success or error publication; a queued foreground request advances it before the older request completes.
Findings None None.
Security None None.

How this fits together

The Control UI agent picker changes the active owner for a global chat. That owner determines the scoped session-list request and the roster subsequently displayed beside the chat.

flowchart LR
A[Agent picker] --> B[Selected global chat]
B --> C[Owner transition]
C --> D[Scoped roster refresh]
D --> E[Roster publication guard]
E --> F[Visible session roster]
Loading

Decision needed

Question Recommendation
After exact-head CI completes, should this maintainer-authored PR adopt the foreground-publication boundary for shared Control UI roster state? Accept after exact-head checks: Approve the canonical shared guard once the pending exact-head checks complete successfully.

Why: The author association and maintainer label require explicit human handling, while the change deliberately alters shared asynchronous session-state publication order.

Before merge

  • Resolve merge risk (P1) - The shared roster lifecycle changes publication ordering; exact-head CI is still in progress, so the focused ordering tests have not been independently executed in this read-only review.
  • Resolve merge risk (P1) - Production code is net +23 lines for a bug fix; the generation is justified by invalidating a request before it has an issued request revision, but a maintainer should explicitly accept that shared lifecycle boundary.
  • Resolve merge risk (P1) - The claimed browser captures are not available to inspect in this environment, leaving the visible before/after state as a maintainer evidence gap.
  • Complete next step (P2) - An open maintainer-authored PR already owns the concrete repair; the remaining action is exact-head validation and maintainer review.
Agent review details

Security

None.

PR surface

Source +23, Tests +164. Total +187 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 27 4 +23
Tests 5 244 80 +164
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 271 84 +187

Review metrics

Metric Value Why it matters
Production versus regression coverage production +27/-4 (net +23); tests +244/-80 (net +164) The added shared publication boundary is accompanied by targeted stale-result, bootstrap, coalescing, and selection-transition coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #133132
Summary: This PR directly implements the immediate-roster-refresh repair track documented by the broader selected-global ownership issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Verify the shared ordering contract (recommended)
    Wait for the exact-head Control UI and session checks before merging the new roster-publication ordering.
  2. Pause if the guard needs redesign
    Hold the PR if owner review finds the new generation does not preserve the intended append, background, and event semantics.

Technical review

Best possible solution:

Retain one roster-lifecycle publication boundary, land it only after exact-head checks are green, and have the Control UI owner confirm the shared ordering contract.

Do we have a high-confidence way to reproduce the issue?

Yes—source inspection gives a high-confidence path: select another agent in a selected-global chat and observe that current main transitions ownership without requesting the scoped roster. No code was executed because this is a read-only review.

Is this the best way to solve the issue?

Yes—the refresh uses the existing scoped roster helper and the stale-publication rule belongs in the shared roster owner rather than a chat-specific caller fence.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 162c33ef55cc.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This repairs a silent Control UI session-roster refresh failure with bounded impact.
  • merge-risk: 🚨 session-state: The PR changes how concurrent session-roster results and errors may publish into shared UI state.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored Control UI PR is exempt from the external-contributor proof gate; its body describes a mocked browser capture, but the referenced artifacts were unavailable for independent review.

Evidence

What I checked:

Likely related people:

  • shakkernerd: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let the exact-head CI run complete before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-08-30T06:58:47.039Z sha 3266dac :: needs maintainer review before merge. :: none
  • reviewed 2026-08-30T07:31:35.499Z sha 3266dac :: found issues before merge. :: [P2] Fence roster refreshes against later agent selections
  • reviewed 2026-08-30T08:26:04.537Z sha 999aa21 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-30T08:35:38.684Z sha 999aa21 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-30T08:50:12.854Z sha 999aa21 :: needs maintainer review before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 30, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 30, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 30, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 30, 2026 08:43
@vincentkoc
vincentkoc force-pushed the fix/ui-agent-roster-refresh branch from 999aa21 to 18b15eb Compare August 30, 2026 11:01
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 30, 2026
@vincentkoc
vincentkoc merged commit 4306140 into main Aug 30, 2026
158 checks passed
@vincentkoc
vincentkoc deleted the fix/ui-agent-roster-refresh branch August 30, 2026 11:19
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 31, 2026
* fix(ui): refresh selected agent roster immediately

* fix(ui): fence stale roster refresh publications
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 maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant