Skip to content

fix(ui): finish roster refreshes during session activity - #140459

Merged
steipete merged 1 commit into
mainfrom
codex/team-ui-roster-refresh-event-owner
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/team-ui-roster-refresh-event-owner

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where switching agents could leave the Control UI sidebar empty and loading when an active session message arrived during the roster request.

Why This Change Was Made

Ordinary session snapshots include a permission field. Processing that field invalidated the entire foreground roster request, including requests for other sessions, without necessarily scheduling a replacement.

Permission facts now stay scoped to their conversation and session ID while the roster owner finishes its read. The single permission owner replaces the prior claim map, preserves newer facts across older responses, and keeps permission-mutation errors separate from unrelated refreshes. Conflicting acknowledgments with equal timestamps use the patch's existing canonical read instead of guessing which value is newer. Query membership, other row fields, and polling behavior are preserved.

User Impact

Agent switching and roster refreshes complete during active conversations. Newer permission choices survive older responses, and a stale mutation outcome cannot replace a newer choice. Session replacement and reconnects retire the corresponding permission state.

Evidence

  • The original six controller regressions fail on the baseline and pass after the repair.
  • 671 session and chat-composer tests pass, covering request completion, permission acknowledgments, errors, concurrent lists, exact session IDs, and connection retirement.
  • The same bundled Control UI and synthetic Gateway browser flow reproduces the empty sidebar on the baseline and passes both scenarios on the final source. It uses the real agent switcher, a held roster response, and an unrelated active session event.
  • Independent P0–P2 review is clean after reproducing and fixing the accepted ordering findings.
  • The full changed gate passed, including core/UI typechecks, unused exports, formatting, lint, and style validation.

The screenshots below show the same synthetic agent-switch sequence before and after the fix.

Before: the Research sidebar remains empty after the response

After: the Research roster finishes loading during session activity

Final qualification for commit 7cf891fc27371b7238930c73ad01d299b274dbb2: 671 tests pass after the documentation-only rebase; the unchanged native browser scenario passes both cases against the actual committed source, with tracked bytes and modes verified before and after the build. Exact-head CI passed. The current ClawSweeper review has no findings or pre-merge items. Its attachment retrieval was unavailable; the linked synthetic before/after images were separately inspected by the implementing and independent reviewers. This proof demonstrates roster completion during activity, not production latency.

@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Sep 6, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 5:41 PM ET / 21:41 UTC.

ClawSweeper review

What this changes

Repairs Control UI session-list loading during conversation activity and preserves confirmed permission choices across delayed responses and failed refreshes.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary: current main and the latest release retain the request-invalidation path responsible for stalled loading. No blocking introduced defect was found, and this maintainer-authored PR should remain open for normal landing.

Priority: P1
Reviewed head: 7cf891fc27371b7238930c73ad01d299b274dbb2

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent owner-level repair with meaningful ordering regressions and no blocking findings; reported runtime validation was not rerun during this read-only review.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-author exemption applies, with no material authority change requiring additional proof. The body reports the changed roster path passing in a bundled browser flow, but linked captures could not be independently retrieved here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-author exemption applies, with no material authority change requiring additional proof. The body reports the changed roster path passing in a bundled browser flow, but linked captures could not be independently retrieved here.
Evidence reviewed 8 items Verified introduced scope: The local checkout matches the pinned original PR head. The merge-base comparison contains the supplied ten UI, test, and documentation paths; unrelated base-branch changes are excluded. The introduced diff passes the read-only whitespace check.
Current main still contains the failure mechanism: Applied events containing permissionMode invalidate foreground publication. The active session.message path subsequently returns without scheduling a replacement, allowing a pending roster result or error to be discarded while loading remains set.
Latest-release comparison: The supplied latest release, v2026.9.2, also contains the permission-event call to invalidateForegroundPublication; this is not already repaired in that release.
Findings None None.
Security None None.

How this fits together

The Control UI combines Gateway session lists, activity events, and permission-change acknowledgments into the sidebar and conversation controls. This change separates list completion from the ordering of permission values displayed for each session.

flowchart TD
  A[Agent selection] --> B[Session list request]
  C[Gateway activity events] --> D[Session permission reconciliation]
  E[Permission change acknowledgments] --> D
  B --> D
  D --> F[Sidebar and conversation controls]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +285, Tests +907, Docs +2. Total +1194 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 5 368 83 +285
Tests 4 957 50 +907
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 1327 133 +1194

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +285 net lines; tests +907 net lines Production growth establishes one permission reconciliation owner; the larger test investment covers observable concurrency and lifecycle cases.

Technical review

Best possible solution:

Let the roster owner finish its requests while a single session-scoped owner reconciles confirmed permission values and retires them on connection or incarnation changes.

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

Yes, from source: hold a roster request, deliver an active session message containing permissionMode, then complete the request; current main invalidates its publication without arranging a replacement. This review did not execute the scenario.

Is this the best way to solve the issue?

Yes. Separating permission-field ordering from whole-roster completion repairs the owning invariant while preserving query membership, existing request APIs, and connection fencing.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7921ec48f82d.

Labels

Label justifications:

  • P1: The existing failure can leave agent switching stuck with an empty, loading sidebar during ordinary conversation activity.
  • 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: The maintainer-author exemption applies, with no material authority change requiring additional proof. The body reports the changed roster path passing in a bundled browser flow, but linked captures could not be independently retrieved here.

Evidence

What I checked:

  • Verified introduced scope: The local checkout matches the pinned original PR head. The merge-base comparison contains the supplied ten UI, test, and documentation paths; unrelated base-branch changes are excluded. The introduced diff passes the read-only whitespace check. (7cf891fc2737)
  • Current main still contains the failure mechanism: Applied events containing permissionMode invalidate foreground publication. The active session.message path subsequently returns without scheduling a replacement, allowing a pending roster result or error to be discarded while loading remains set. (ui/src/lib/sessions/index.ts:412, 7921ec48f82d)
  • Latest-release comparison: The supplied latest release, v2026.9.2, also contains the permission-event call to invalidateForegroundPublication; this is not already repaired in that release. (ui/src/lib/sessions/index.ts:412, 3928bad9badf)
  • Permission reconciliation and retirement: The new in-memory owner keys facts by conversation identity and session incarnation, resolves conflicting equal-time acknowledgments through the existing canonical read, and preserves newer permission fields without replacing unrelated row fields. Connection transitions and disposal clear the owner. (ui/src/lib/sessions/session-permission-projection.ts:25, 7cf891fc2737)
  • Behavior-focused regression coverage: The inspected tests exercise the production session capability with deferred requests: six event/completion combinations, independent list ordering, explicit global-agent identities, successor sessions, equal-time conflicts, and queued error ownership. Existing failure coverage is retained and extended to successful completion. Tests were inspected, not executed. (ui/src/lib/sessions/session-permission-refresh-order.test.ts:11, 7cf891fc2737)
  • Security and dependency boundary: Permission selection still uses the existing guarded UI action and sessions.patch request with expectedSessionId. Permission values used by media rendering invalidate previews; Gateway authorization remains authoritative. The introduced patch changes presentation ordering, not credentials, authorization, persistent storage, plugin APIs, or a Codex dependency contract. (ui/src/pages/chat/components/chat-message-media.ts:58, 7cf891fc2737)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vyctor H. Brzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (1 earlier review cycle)
  • reviewed 2026-09-06T21:33:50.054Z sha fada22c08c71aabc0a101bb70e35fc8f80338c42 :: blocked before merge. :: none

@steipete
steipete force-pushed the codex/team-ui-roster-refresh-event-owner branch from fada22c to 7cf891f Compare September 6, 2026 21:35
@steipete
steipete marked this pull request as ready for review September 6, 2026 21:36
@steipete
steipete merged commit ed500b4 into main Sep 6, 2026
177 checks passed
@steipete
steipete deleted the codex/team-ui-roster-refresh-event-owner branch September 6, 2026 21:49
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
* commit '294df333c58f2da104eccffc623ccb3c4d43d4d8': (1802 commits)
  fix: clear stale diagnostics after Gateway changes (#140426)
  fix: keep plugin catalogs intact after discovery timeouts (#140441)
  perf(tui): prepare session picker rows once per overlay (#140462)
  refactor(config): reuse environment substitution for write-back (#140460)
  refactor(discord): remove retired auto-presence templates (#140463)
  fix(ui): finish roster refreshes during session activity (#140459)
  fix(setup): match prepared credentials to the model provider (#140461)
  fix: keep MiniMax discovery on the selected credential (#140438)
  refactor(tests): remove unused parent context cache reset (#140456)
  fix: avoid repeated xAI OAuth refresh during discovery (#140434)
  perf(routing): reuse prepared event session targets (#140454)
  fix(media): keep deferred audio and extraction providers discoverable (#139231)
  refactor(codex): remove redundant app-server forwarding (#140451)
  fix(test): avoid false native polling timeouts (#140119)
  test(gateway): retain saved source in reload fixtures (#140453)
  fix(gateway): reduce repeated model work when listing sessions (#140414)
  fix(feishu): fall back to post mode over table limit (#136382)
  fix: use the bundle-compatible Proxyline runtime under Bun (#140411)
  refactor(trace): reuse the canonical usage counter type (#140444)
  refactor(node-host): share execution policy result fields (#140446)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
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 docs Improvements or additions to documentation maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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