Skip to content

fix(ui): stop unrelated sidebar child refreshes - #146410

Merged
steipete merged 4 commits into
mainfrom
codex/sidebar-child-observation
Sep 12, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/sidebar-child-observation

Conversation

@steipete

@steipete steipete commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Related: #146122

What Problem This Solves

Fixes an issue where users keeping chats open would repeatedly reload expanded sidebar child lists when unrelated sessions refreshed. On busy Gateways, this adds background requests and rendering work long after the chat has loaded.

Why This Change Was Made

The sidebar now consumes the existing managed child query instead of clearing every child read on each canonical roster publication. Pagination updates that same query's complete window. History invalidation follows affected membership, while adopting a selected child excludes the query that supplied it. Held descriptors retain newer accepted facts when delayed child results arrive.

User Impact

Expanded and selected children remain current without unrelated chats causing repeated child-list reads. Relevant child changes still refresh, removed children leave the window, and failed or incomplete loads keep their visible error until the operator retries. Retry also recovers a query retained by another view. Teardown cannot reopen background observations.

Evidence

  • Red/green mounted-sidebar regression: three unchanged canonical publications previously grew one child read into four. The fixed sidebar keeps one read, and a 101-child window keeps its two initial page reads through unrelated history updates.

  • Red/green selected-child regression: without the supplying-query exclusion, a controlled update produced six requests instead of two as runtime fields changed. The corrected path retains two.

  • Red/green teardown, replacement-connection, ancestor-movement, and collapsed-refresh retirement regressions; moving-window recovery and exhaustion; unchanged ancestry, field-provenance, permission, and reconnect coverage.

  • 1,752 tests across 80 session, sidebar, bootstrap, website, and chat-metadata files pass, including the full mounted-sidebar suite and unchanged ancestry, field-provenance, permission, and reconnect coverage. Failed, incomplete, and synchronously shared queries retain their errors through unrelated events and recover through explicit retry.

  • Twelve mocked-Gateway Chromium scenarios pass, including error retention and recovery alongside the sidebar stability scenarios.

  • Shared result projection, event parsing, and refresh lifecycle operations remove duplicated work. After rebasing onto main d569fcdba8bd, the controlled startup bundle check passes at 355,045 bytes gzip against the inherited 355,719-byte enforcement limit (official baseline 355,143 bytes); this PR changes no baseline, cap, or allowance. Startup CSS stays unchanged. Website-only hints load with their widget while the shared label stays eager; all 9,018 translation keys retain identical text and canonical order.

  • The full changed check, focused production/test types, UI lint, and import-cycle checks passed during preparation. P2 autoreview found no actionable P0–P2 findings. The rebase preserves the complete reviewed patch byte-for-byte; fresh validation on d11a85a6cea5 passes 463 focused sidebar, child-query, and bootstrap tests plus production UI types, UI test types, i18n verification, and the controlled bundle comparison.

  • The prior 7eff2ea2 CI run passed the real-Gateway model-catalog scenario and startup budget check. The notice assertion now records state, text, and group in the same DOM read without changing its assertion or timing; this improves diagnostics and does not claim to fix a race. That run failed the main-owned shard inventory guard, now repaired by merged fix: restore core test shard headroom #146538 and inherited in this rebase, and one unexplained authenticated-request profile-authorization timeout. The exact CI source passes locally in the original four-case order and the full two-worker Gateway shard (106 files, 2,905 tests). Required CI run 34725130762 now passes on refreshed head d11a85a6cea5, including the real-Gateway scenario, the shard inventory check, the previously timed-out Gateway shard, and the aggregate gate. The earlier timeout did not recur in Linux CI; its cause remains unexplained. No timeout, retry, or authorization-path change was added.

The images show the candidate before and after an authoritative child update. They are synthetic behavior proof, not an old-build performance comparison. Live latency depends on concurrent Gateway load and is verified separately after deployment.

Candidate before the authoritative child update:

Expanded sidebar before the child update

Candidate after the authoritative child update:

Expanded sidebar after the child update

@clawsweeper

clawsweeper Bot commented Sep 12, 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.

@steipete
steipete marked this pull request as ready for review September 12, 2026 20:39
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Sep 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 7:27 PM ET / 23:27 UTC (Revision 5).

ClawSweeper review

What this changes

The PR keeps sidebar child lists under the existing managed-query owner, preserves pagination and retry recovery, consolidates session projections, and loads website hints with their widget.

Merge readiness

✅ Ready for maintainer review

This remains a useful sidebar-specific repair beyond the merged chat optimization. No actionable introduced defect was found, and the maintainer-authored PR is protected from cleanup closure.

Priority: P2
Reviewed head: d11a85a6cea5796c18eb493d191b1d221ebb4291

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent owner-level repair with useful browser captures and targeted regression coverage; no blocking defect was identified.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The ordinary external-contributor proof gate does not apply to this maintainer-authored PR. Inspected synthetic Chromium captures show the sidebar child update; supplied boundary regressions support request reduction, while live latency remains unmeasured.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor proof gate does not apply to this maintainer-authored PR. Inspected synthetic Chromium captures show the sidebar child update; supplied boundary regressions support request reduction, while live latency remains unmeasured.
Evidence reviewed 9 items Current main still contains the reported trigger: Current main calls resetChildSessionState(true) whenever canonicalListRevision changes, clearing loaded child keys even for unrelated roster publications. The sidebar navigation subsequently requests expanded children again.
Managed child-query lifecycle: The introduced controller retains observations across unrelated publications, disposes them on connection replacement or teardown, and makes failed observations dormant until explicit retry.
Scoped invalidation and complete pagination: History reconciliation supplies the accepted row and supplying query scope to membership-based invalidation. Child pagination consumes the managed window, replacing cross-pass membership and reporting incomplete windows after bounded attempts.
Findings None None.
Security None None.

How this fits together

The Control UI sidebar displays session trees from Gateway lists and events. Its session-query owner reconciles incoming rows and refreshes affected child windows before publishing them to the sidebar.

flowchart TD
  A[Gateway lists and events] --> B[Session query owner]
  B --> C{Affected child window?}
  C -->|Yes| D[Refresh and complete pagination]
  C -->|No| E[Retain current window]
  D --> F[Reconcile current session facts]
  E --> F
  F --> G[Sidebar session tree]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +209, Tests +584, Other +10. Total +803 across 32 files.

View PR surface stats
Area Files Added Removed Net
Source 23 397 188 +209
Tests 8 614 30 +584
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 10 0 +10
Total 32 1021 218 +803

Review metrics

Metric Value Why it matters
Production versus regression coverage Production/tooling +219 net lines; tests/support +584 net lines Production growth is explained by observation lifecycle and recovery handling, with most net growth devoted to regression coverage.

Technical review

Best possible solution:

Keep child membership and refresh scheduling with the existing managed-query owner while the sidebar owns expansion, presentation, and visible retry recovery.

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

Yes, from source: expand a child list and publish unrelated canonical rosters; current main clears its loaded state and the navigation owner reloads it. Execution was not performed in this read-only review.

Is this the best way to solve the issue?

Yes. Reusing managed queries removes competing freshness handling while preserving event-driven membership updates, pagination, and explicit recovery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2dc783b784ae.

Labels

Label justifications:

  • P2: Redundant background child-list requests are a bounded Control UI performance and reliability problem.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 ordinary external-contributor proof gate does not apply to this maintainer-authored PR. Inspected synthetic Chromium captures show the sidebar child update; supplied boundary regressions support request reduction, while live latency remains unmeasured.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The ordinary external-contributor proof gate does not apply to this maintainer-authored PR. Inspected synthetic Chromium captures show the sidebar child update; supplied boundary regressions support request reduction, while live latency remains unmeasured.

Evidence

What I checked:

  • Current main still contains the reported trigger: Current main calls resetChildSessionState(true) whenever canonicalListRevision changes, clearing loaded child keys even for unrelated roster publications. The sidebar navigation subsequently requests expanded children again. (ui/src/components/session-data-controller.ts:368, 2dc783b784ae)
  • Managed child-query lifecycle: The introduced controller retains observations across unrelated publications, disposes them on connection replacement or teardown, and makes failed observations dormant until explicit retry. (ui/src/components/session-data-controller.ts:552, d11a85a6cea5)
  • Scoped invalidation and complete pagination: History reconciliation supplies the accepted row and supplying query scope to membership-based invalidation. Child pagination consumes the managed window, replacing cross-pass membership and reporting incomplete windows after bounded attempts. (ui/src/lib/sessions/session-roster-refresh.ts:184, d11a85a6cea5)
  • Regression coverage inspected: Mounted-sidebar coverage checks unrelated publications, 101-child pagination, selected-child updates, connection replacement, collapsed-query retirement, queued failures, and shared-query retry. Supplied results report passing focused tests; this read-only review did not execute them. (ui/src/components/app-sidebar.child-snapshot-freshness.test.ts:1, d11a85a6cea5)
  • Inspected browser captures: Prepared proof-image-1.png and proof-image-2.png show the selected child changing from “Research in progress” to “Research completed” while the expanded tree remains visible. The supplied body explicitly identifies synthetic candidate captures; they demonstrate presentation, not request counts or live latency. The corresponding browser scenario exercises a delayed child-list response. (ui/src/e2e/sidebar-session-stability.e2e.test.ts:66, d11a85a6cea5)
  • Related merged work and routing history: Provided GitHub metadata confirms fix(ui): avoid redundant child-session refreshes in chat #146122 merged as 7729235 and covers chat Swarm observations. Current-main history also records Peter Steinberger's concurrent-session and sidebar work; this supports routing without attributing defect introduction. (ui/src/lib/sessions/session-roster-refresh.ts, 77292356e9a7)

Likely related people:

  • steipete: 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 (4 earlier review cycles)
  • reviewed 2026-09-12T20:47:30.360Z sha 2bf8d11 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-12T21:52:34.812Z sha f7c2683a57b7bac1ff9a0243804bf481b90bd4c2 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-12T22:17:18.436Z sha 0139d9f :: needs maintainer review before merge. :: none
  • reviewed 2026-09-12T22:52:26.255Z sha 7eff2ea27c9c88bae801f353556f9a626cbbaa90 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/sidebar-child-observation branch 3 times, most recently from 0139d9f to 7eff2ea Compare September 12, 2026 22:45
Keep child windows under their managed query owner and target history
invalidation to affected membership without refreshing the supplying query.
Preserve descriptor freshness, complete pagination, retry errors, ancestry,
and connection/disposal lifecycles while avoiding repeated sidebar reads.

Related: #146122
Keep failed sidebar child observations dormant until explicit retry, including
synchronous errors from queries retained by another view. Preserve incomplete
pagination errors and retire their leases without reopening background reads.

Align the mounted-sidebar regressions with managed child-event refresh and
make scheduled event assertions deterministic. Share stale-row comparison,
result projection, event parsing, and refresh lifecycle operations to keep the
startup bundle within its existing budget.

Validation: 1,598 session/sidebar/bootstrap tests, 10 Chromium scenarios, UI
production and test types, UI lint, import-cycle checks, and controlled startup
bundle check. Fresh review found no actionable P0-P2 findings.
Keep the shared Website label eager and register the three website-only hints
synchronously with the widget. Compose the same canonical English catalog
without mutating the runtime catalog; all 9,018 keys retain their text and order.

Forward public session invalidation directly to its existing closure-owned
scheduler without a redundant wrapper. The public zero-argument contract stays
unchanged.

Validation: 1,752 tests across 80 files, 12 Chromium scenarios, unchanged catalog
bytes and key order, i18n verification, production/test types, lint, import-cycle
checks, and the unchanged startup gzip gate. Fresh review found no actionable
P0-P2 findings.
Use the existing result-identity owner for terminal updates, pending mutations,
permission projection, confirmed archives, and Swarm presentation. Preserve
mapper order, side effects, membership and metadata while removing repeated
change tracking and result copies.

Record model-catalog notice state, text and group in one E2E DOM snapshot while
retaining the same empty-notice assertion and timing. The prior single CI failure
remains unexplained; exact-source local checks pass and no race fix is claimed.

Validation: 1,752 tests, 12 mocked Chromium scenarios, exact-source Node 24
real-Gateway diagnostic proof, UI types/lint, import-cycle checks, and unchanged
startup bundle gate at 355052 bytes gzip. Fresh review has no actionable P0-P2
findings.
@steipete
steipete force-pushed the codex/sidebar-child-observation branch from 7eff2ea to d11a85a Compare September 12, 2026 23:19
@steipete
steipete merged commit 1ccb3e1 into main Sep 12, 2026
144 of 146 checks passed
@steipete
steipete deleted the codex/sidebar-child-observation branch September 12, 2026 23:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 13, 2026
* fix(ui): stop unrelated sidebar child refreshes

Keep child windows under their managed query owner and target history
invalidation to affected membership without refreshing the supplying query.
Preserve descriptor freshness, complete pagination, retry errors, ancestry,
and connection/disposal lifecycles while avoiding repeated sidebar reads.

Related: openclaw#146122

* fix(ui): preserve child query recovery and share refresh work

Keep failed sidebar child observations dormant until explicit retry, including
synchronous errors from queries retained by another view. Preserve incomplete
pagination errors and retire their leases without reopening background reads.

Align the mounted-sidebar regressions with managed child-event refresh and
make scheduled event assertions deterministic. Share stale-row comparison,
result projection, event parsing, and refresh lifecycle operations to keep the
startup bundle within its existing budget.

Validation: 1,598 session/sidebar/bootstrap tests, 10 Chromium scenarios, UI
production and test types, UI lint, import-cycle checks, and controlled startup
bundle check. Fresh review found no actionable P0-P2 findings.

* perf(ui): load website hints with dashboard widgets

Keep the shared Website label eager and register the three website-only hints
synchronously with the widget. Compose the same canonical English catalog
without mutating the runtime catalog; all 9,018 keys retain their text and order.

Forward public session invalidation directly to its existing closure-owned
scheduler without a redundant wrapper. The public zero-argument contract stays
unchanged.

Validation: 1,752 tests across 80 files, 12 Chromium scenarios, unchanged catalog
bytes and key order, i18n verification, production/test types, lint, import-cycle
checks, and the unchanged startup gzip gate. Fresh review found no actionable
P0-P2 findings.

* refactor(ui): share session result projections

Use the existing result-identity owner for terminal updates, pending mutations,
permission projection, confirmed archives, and Swarm presentation. Preserve
mapper order, side effects, membership and metadata while removing repeated
change tracking and result copies.

Record model-catalog notice state, text and group in one E2E DOM snapshot while
retaining the same empty-notice assertion and timing. The prior single CI failure
remains unexplained; exact-source local checks pass and no race fix is claimed.

Validation: 1,752 tests, 12 mocked Chromium scenarios, exact-source Node 24
real-Gateway diagnostic proof, UI types/lint, import-cycle checks, and unchanged
startup bundle gate at 355052 bytes gzip. Fresh review has no actionable P0-P2
findings.
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 P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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