Repository navigation
fix(ui): avoid redundant child-session refreshes in chat - #146122
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 2:26 PM ET / 18:26 UTC (Revision 4). ClawSweeper reviewWhat this changesChat 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 Review scores
Verification
How this fits togetherThe 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +277, Tests +617, Docs +11, Config +1. Total +906 across 21 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
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.
24e6d94 to
38452a3
Compare
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.
|
Merged via squash.
|
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 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): 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.
…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.
* 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.
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
sessions.listcalls across all queries. The selected roster still refreshes its own changes.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.
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.