Skip to content

fix(ui): avoid redundant child-session refreshes in chat - #146122

Merged
steipete merged 4 commits into
mainfrom
codex/chat-session-observation
Sep 12, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/chat-session-observation

Conversation

@steipete

@steipete steipete commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Related: #146102

What Problem This Solves

Fixes an issue where opening or viewing chat caused child sessions and their parent to reload after unrelated sidebar refreshes. Those extra requests increased Gateway load and delayed conversations while other agents were active.

Why This Change Was Made

Swarm progress now uses the existing managed child-session query and parent-row observation. The sidebar only seeds the initial view; later canonical roster publications do not start another child-list/parent-descriptor pair. Parent counts and access checks remain independent of slow child pages, and parent and child failures retry independently.

Query invalidation follows the parent, known children, and announced ownership or navigation lineage, including cross-agent children. Incomplete windows refresh conservatively because an event naming another parent may describe a child moving out of an unloaded page. Pending descriptors retain refresh intent when newer summaries or child membership arrive, while their own publications do not create redundant reads.

Hosted real-Gateway CI uses a 40-minute job budget when its existing routing selects Ubuntu, while Blacksmith retains 20 minutes. Run 34707873095, attempt 2 spent 7m42s before the browser suite began, then hit its 20-minute infrastructure limit while tests were progressing and before the widget cases. Per-test and subprocess deadlines, the full inventory, workers, runner routing, and concurrency limits remain unchanged. This adds no jobs or Blacksmith registrations.

User Impact

Chat generates less background traffic while child names, counts, status, and membership stay current. Missing or inaccessible parents remain cleared, and completed Swarm outcomes remain visible after the parent finishes or fails.

Evidence

  • Initial load plus ten unrelated canonical roster publications produced eleven child-list requests before the fix and one after. Relevant parent and child changes still refresh membership.
  • Browser regression: three bursts of unrelated agent activity produce zero additional sessions.list calls across all queries. The selected roster still refreshes its own changes.
  • Regressions cover cross-agent creation, known and off-page reparenting/deletion, pagination beyond 10,000 children, independent retry backoff, stale denied responses, and summaries or child pages overtaking a pending descriptor.
  • 135 focused owner, refresh, permission, hydration, and rendering tests pass.
  • All 10 browser cases pass against a freshly built production UI bundle: roster event scope, Swarm lifecycle on desktop/mobile/cross-agent sessions, and cloud dispatch.
  • UI production/test type checks, targeted lint, formatting, and staged changed-file checks pass. Independent review through P2 found no remaining actionable issues.
  • CI followups preserve selected-child labels and queued-message completion by committing mock state before its invalidation event and keeping child-query membership exact. All twenty associated browser cases pass across the focused runs.
  • Real-Gateway Stop regression passes with its exact-run terminal descriptor delayed until after the required no-active-run abort and post-Stop history recovery. Swarm remains enabled; the real descriptor is then delivered unchanged.
  • Initial CI also hit an unrelated Gateway type-shard budget failure from main. The candidate now includes main’s separate repair in ci: restore gateway typecheck shard headroom #146212; this PR retains no compiler configuration change.

The following inspected synthetic captures use the same thirty-child fixture before and after the change. They show that the completed outcome and presentation remain intact; the request reduction is established by the assertions above.

Before After
Before: synthetic Swarm outcome with 25 completed and 5 failed children After: the same synthetic Swarm outcome is preserved

Two source-equal updater timeout failures passed one unchanged diagnostic retry. The unchanged widget suite also passes locally on a fresh exact-head runtime; the canceled hosted attempt did not reach those widget cases. The budget guard failed against the old constant and passes across 96 runner-selection contexts. Pinned actionlint, repository workflow guards, targeted types/lint, standard docs links and touched-page anchors pass. The full local workflow wrapper could not bootstrap its pinned pre-commit version from the configured package index; hosted workflow/security gates remain required.

Live deployment timing will be measured after landing.

@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.

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Sep 12, 2026
@steipete
steipete marked this pull request as ready for review September 12, 2026 15:40
@openclaw-barnacle openclaw-barnacle Bot added size: L maintainer Maintainer-authored PR labels Sep 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 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, 2:26 PM ET / 18:26 UTC (Revision 4).

ClawSweeper review

What this changes

Chat reuses scoped parent and child session observations to reduce background requests, adds regression coverage, and increases the real-Gateway CI job budget on hosted runners.

Merge readiness

✅ Ready for maintainer review

This remains a useful fix: current main and the latest release still refresh Swarm data after unrelated roster publications. The earlier refresh-intent finding is addressed, and this review found no remaining actionable defects.

Priority: P2
Reviewed head: 78281317baa3a76882b30b63c3d625b983a4fb91

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with relevant race coverage and a justified CI budget adjustment; no actionable defects remain.
Proof confidence 🌊 off-meta tidepool Not applicable: The contributor proof gate is exempt for this maintainer-authored PR. Inspected captures preserve Swarm presentation, while reported browser assertions cover request reduction and the real-Gateway Stop scenario covers delayed descriptor recovery; live deployment latency is not yet measured.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The contributor proof gate is exempt for this maintainer-authored PR. Inspected captures preserve Swarm presentation, while reported browser assertions cover request reduction and the real-Gateway Stop scenario covers delayed descriptor recovery; live deployment latency is not yet measured.
Evidence reviewed 7 items Still necessary on main and release: Both fetched main and v2026.9.4 retain the Swarm hydrator’s canonicalListRevision-driven refresh, which schedules another child-list and parent read after unrelated canonical publications.
Scoped refresh ownership: The hydrator now observes the existing managed child query and parent row. Event matching captures membership before reconciliation, includes announced cross-agent lineage, and conservatively refreshes incomplete windows.
Earlier finding resolved: Pending parent reads retain queued refresh intent; invalidated replies trigger a replacement read. Regression cases cover summaries overtaking the initial descriptor, stale denial, and child membership changing during a descriptor request. No session implementation changed since the previous reviewed head.
Findings None None.
Security None None.

How this fits together

The Control UI receives session lists and change events from the Gateway. Its shared session observations feed chat’s parallel-task progress display and sidebar without changing the Gateway’s authoritative session state.

flowchart TD
  A[Gateway session events] --> B[Match affected session queries]
  B --> C[Managed child list]
  B --> D[Parent row observation]
  E[Selected chat session] --> C
  E --> D
  C --> F[Reconcile current session facts]
  D --> F
  F --> G[Chat parallel-task progress]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +277, Tests +617, Docs +11, Config +1. Total +906 across 21 files.

View PR surface stats
Area Files Added Removed Net
Source 7 398 121 +277
Tests 11 744 127 +617
Docs 2 12 1 +11
Config 1 2 1 +1
Generated 0 0 0 0
Other 0 0 0 0
Total 21 1156 250 +906

Review metrics

Metric Value Why it matters
Production and test growth Production +277 net lines; tests +617 net lines Production growth supports scoped observation lifecycle and independent retries; tests cover refresh isolation and overlapping results.
Hosted job budget Hosted 20 → 40 minutes; Blacksmith remains 20 The larger overall budget accommodates measured preparation time while preserving individual test deadlines and runner counts.

Technical review

Best possible solution:

Keep parent details and child membership under the shared session observation owner, with scoped invalidation and independent recovery.

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

Yes, from source: current main keys Swarm hydration to every canonical roster revision, so unrelated publications trigger additional reads. This review did not execute that path.

Is this the best way to solve the issue?

Yes. Reusing the existing managed query and row-observation owners removes the broad refresh trigger while preserving membership, freshness, and connection boundaries.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 25dcf15b0aef.

Labels

Label justifications:

  • P2: Redundant background session requests add Gateway load and delay chat during other agents’ 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 contributor proof gate is exempt for this maintainer-authored PR. Inspected captures preserve Swarm presentation, while reported browser assertions cover request reduction and the real-Gateway Stop scenario covers delayed descriptor recovery; live deployment latency is not yet measured.

Evidence

What I checked:

  • Still necessary on main and release: Both fetched main and v2026.9.4 retain the Swarm hydrator’s canonicalListRevision-driven refresh, which schedules another child-list and parent read after unrelated canonical publications. (ui/src/lib/sessions/swarm-roster.ts:125, 25dcf15b0aef)
  • Scoped refresh ownership: The hydrator now observes the existing managed child query and parent row. Event matching captures membership before reconciliation, includes announced cross-agent lineage, and conservatively refreshes incomplete windows. (ui/src/lib/sessions/session-list-query.ts:34, 78281317baa3)
  • Earlier finding resolved: Pending parent reads retain queued refresh intent; invalidated replies trigger a replacement read. Regression cases cover summaries overtaking the initial descriptor, stale denial, and child membership changing during a descriptor request. No session implementation changed since the previous reviewed head. (ui/src/lib/sessions/swarm-roster.ts:254, 78281317baa3)
  • Prepared visual evidence inspected: Both downloaded before/after images show the same thirty-child outcome: 25 completed and 5 failed. They support presentation preservation, not network-request reduction. The captured PR body separately reports focused browser request assertions and real-Gateway Stop recovery; no tests or target code were executed during this review. (78281317baa3)
  • Hosted timeout rationale verified: The referenced job started at 17:40:38 UTC and began the browser suite at 17:48:20, confirming 7m42s of preparation; it was cancelled around its old twenty-minute limit. The introduced workflow expression assigns forty minutes to hosted routing and twenty to Blacksmith without changing steps, permissions, workers, or individual test deadlines. (.github/workflows/ci.yml:2790, 78281317baa3)
  • Related merged work is distinct: fix(gateway): keep chat request bursts responsive under load #146102 fixes WebSocket compression latency, while ci: restore gateway typecheck shard headroom #146212 restores typecheck shard headroom. Neither implements scoped UI child-session refreshes.

Likely related people:

  • Peter Steinberger: Raw commit 1ad9fe2 adds ui/src/lib/sessions/session-roster-observations.ts:92 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1ad9fe2a759d; files: ui/src/lib/sessions/session-roster-observations.ts)

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 (3 earlier review cycles)
  • reviewed 2026-09-12T15:46:03.383Z sha 64b5004 :: needs changes before merge. :: [P2] Preserve refresh intent when a summary overtakes the descriptor
  • reviewed 2026-09-12T16:48:01.144Z sha 82b0ca747cb9219bc6db456ff0aa00c76e60a9ba :: needs maintainer review before merge. :: none
  • reviewed 2026-09-12T17:25:55.165Z sha 38452a3 :: needs maintainer review before merge. :: none

@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 Sep 12, 2026
Keep canonical mock transitions and child query membership aligned across descriptor, history, and list reads. Preserve real Gateway stale Stop coverage by delaying only the exact terminal descriptor until post-Stop history recovery. Rebalance existing Gateway test-type graphs after main exceeded the unchanged root budget.
@steipete
steipete force-pushed the codex/chat-session-observation branch from 24e6d94 to 38452a3 Compare September 12, 2026 17:19
Give the existing hosted real-Gateway route a 40-minute job budget while retaining 20 minutes on Blacksmith. The hosted diagnostic run reached its job deadline after 7m42s of preparation and a progressing full suite. Preserve every per-test deadline, test inventory, worker, runner and concurrency setting; check budget/routing agreement across 96 contexts.
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Sep 12, 2026
@steipete
steipete merged commit 7729235 into main Sep 12, 2026
148 checks passed
@steipete
steipete deleted the codex/chat-session-observation branch September 12, 2026 18:40
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 12, 2026
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
steipete added a commit that referenced this pull request Sep 12, 2026
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
steipete added a commit that referenced this pull request Sep 12, 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: #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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 13, 2026
…6122)

* fix(ui): avoid redundant child-session refreshes in chat

* fix(ui): preserve scoped chat refresh ownership

* test(ui): keep scoped session fixtures authoritative

Keep canonical mock transitions and child query membership aligned across descriptor, history, and list reads. Preserve real Gateway stale Stop coverage by delaying only the exact terminal descriptor until post-Stop history recovery. Rebalance existing Gateway test-type graphs after main exceeded the unchanged root budget.

* ci: match real Gateway job budgets to hosted runners

Give the existing hosted real-Gateway route a 40-minute job budget while retaining 20 minutes on Blacksmith. The hosted diagnostic run reached its job deadline after 7m42s of preparation and a progressing full suite. Preserve every per-test deadline, test inventory, worker, runner and concurrency setting; check budget/routing agreement across 96 contexts.
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 docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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