Repository navigation
perf(control-ui): render cached Subagents without awaiting live activity - #194263
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: blocked before merge. What this changesThis PR renders cached Subagents immediately while the live activity module loads, removing the wait that holds all desktop Details sections. Example: Reload an open desktop Details panel with two cached ordinary child sessions while the activity chunk is delayed.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this maintainer-owned experiment open under its explicit do-not-merge hold; source review found no actionable introduced defect. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherControl UI Details consumes scoped cached display receipts and live session queries, renders child activity, and enables navigation through the existing live owners. flowchart TD
A[Warm chat reload] --> B[Scoped Details receipt]
B --> C[Desktop Details composition]
C --> D[Static activity fallback]
C --> E[Outputs and Automations]
F[Lazy live activity module] --> G[Live activity renderer]
D --> G
Technical reviewBest possible solution: Use the existing static renderer inside the activity loading boundary while preserving live query ownership and localized recovery. Do we have a high-confidence way to reproduce the issue? Current main explicitly awaits activity-module preparation before mounting the desktop composition when ordinary cached rows exist; the strengthened browser case holds that request, but no reproduction was executed during this review. Is this the best way to solve the issue? The patch is the smallest complete source change for removing this dependency: it reuses existing rendering, loading, and recovery owners without adding state or another presentation implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 097f990aa244. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -11, Tests +11, Other +2. Total +2 across 4 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 6, 2026, 1:19 PM ET / 18:19 UTC. |
39356d5 to
e3b66a3
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Landed as d482d76 (squash of e3b66a3). Land-ready evidence at the pinned head:
Known gap: the full UI suite could not run because current main fails to build the Deep Research browser pane (missing client.js); the same failure reproduces on main 650091d, and #194283 restores it. Follow-up: four or more ordinary children on the default expanded desktop Subagents section still cache three rows while live shows all of them. |
…ity (openclaw#194263) Follow-up to openclaw#193913. That change made the whole native Details composition wait for the live subagent-activity chunk whenever the cached receipt held ordinary children, because independent section roots could otherwise paint before the activity body. The wait cost 60.4 ms natively before the first populated Details frame. It also made it impossible to draw Details in the same frame as the first cached transcript rows, which openclaw#194142 needs. The composition-wide prepared() memo and its Show wrapper are gone, along with the now-unused preloadChatSubagentActivity export. The existing static SubagentActivity presentation becomes the fallback of the activity's existing ChatLazyBoundary. It receives the receipt rows (or the current query rows if the receipt retires first) strictly as noninteractive presentation, at the same geometry as the live row. When the live observer module resolves through its unchanged createIdleImport owner, live rows replace the cached ones in place. A failed chunk still stays inside the boundary's local error view with Reload, and the other sections still render. The receipt, projection, empty/denied retirement and the display-only rule are unchanged. Proof: 11 interleaved pairs plus A/A on a quiet AWS c7a.4xlarge, native and Team-scale, with active chat and seeded ordinary children. Outputs/Automations movement stays 0 px in 11/11 pairs on both harnesses. First populated Details is earlier natively in 10/11 pairs (paired median -32.3 ms, 1,394 -> 1,329 ms) and at Team scale by -8.8 ms. No hard secondary crosses the standing regression rule. The strengthened e2e holds the real activity chunk request and asserts cached rows in the first Details frame; it fails on main, where Details never appears while the chunk is held. Synthetic before/after stills of that held state are in the PR. Exact-head CI is green, including all selected checks-ui shards, the UI e2e shard and control-ui-performance. The full UI suite could not run because current main fails to build extensions/deep-research/browser (missing client.js, fix in flight as openclaw#194283); that gap is identical on main. Size: UI runtime -11 LOC. CI Chat boot JS -416 B against its base, New and startup unchanged, no caps or baselines touched. Test changes are line-neutral. Open follow-up: on the default expanded desktop section, a session with four or more ordinary children still caches three rows while live shows all of them.
What Problem This Solves
A signed-in warm reload with cached ordinary child activity holds every Details section until the live observer module loads. The cached display receipt already has the row geometry. This removes that admission wait and unblocks #194142's synchronous Details composition; that lane owns co-framing integration.
Why This Change Was Made
Delete the composition-wide
prepared()memo/Show and the unused activity preload import/export. Reuse the existing staticSubagentActivityas the existing lazy boundary's fallback. The fallback receives receipt rows, or current query rows if the receipt retires before the module resolves, strictly as noninteractive presentation. The live observer remains behind the existingcreateIdleImportand dynamic import. Error containment and localized Reload recovery are unchanged.There is still one receipt/projection owner. Empty/denied retirement, scope, caps, protocol and cache shape are unchanged. Cached rows confer no open/stop actions. Emitted source maps put the static row and live observer in separate deferred activity chunks, not startup/shared chunks.
User Impact
Cached Subagents and the other Details sections render without waiting for live activity. Outputs and Automations remain stationary through the static-to-live handoff. Native first populated Details is earlier in 10/11 pairs: paired median −32.3 ms, just over half of the prior 60.4 ms admission. Unpaired medians are 1,394.3 → 1,328.8 ms, with separated IQRs. Team-scale improves by a paired median 8.8 ms, descriptive only.
Open follow-up, deliberately outside this change: four-or-more ordinary rows in the default expanded desktop section still exceed the bounded cached preview.
Evidence
Before/after (synthetic fixture)
Base
e27b909e49d3: with two ordinary children already cached, the activity chunk held and connect deferred, the open Details panel still has no populated sections.Candidate
e3b66a3a94b2: the first populated held state shows both display-only cached children in the final 203 px Subagents group, with Outputs and Automations already in place while connect remains deferred.Candidate after the module and connect resolve: both live rows retain exactly the same Subagents, Outputs and Automations bounds as the first populated held frame (0 px maximum difference).
Base
e27b909e49d33bd723a2cfc10e944845f00249b7; candidatee3b66a3a94b2c50dc5ddff763e8f2a7b5da4b2cb. One dedicated AWS c7a.4xlarge, leasecbx_267469c1ce10, observed 16 vCPUs / 32 GiB, repository Playwright Chromium 156.0.8078.4. Native RTT 80 ms and Team-scalelive-capped, 240 messages / 12 widgets, seeded ordinary children, warm cache, open Details, no persistent-children owner-filter override. Existing committed native and Team-scale workloads; unprofiled, eight-second windows, standing LoAF/mutation and RPC probes. Native alternates pair order; Team interleaves ABAB. Acceptance was recorded on this draft before capture.The compared UI directories are frozen clean-source
pnpm ui:buildoutputs. The Gateway usesnode scripts/prepare-native-protocol.mjs,OPENCLAW_BUILD_PRIVATE_QA=1 OPENCLAW_RUN_NODE_SKIP_DTS_BUILD=1 node --import ./scripts/tsx.mjs scripts/build-all.mts gatewayWatch, thennode --import ./scripts/tsx.mjs scripts/write-build-info.ts. Build/fixture preparation is outside capture.BASE_UI/CANDIDATE_UIname those frozen directories;PROBE_DIRcontains the unchanged standing init probes. A/A replacesCANDIDATE_UIwithBASE_UIin both commands.First post-hello RPC send means the first serialized non-connect request on the authenticated WebSocket. Hello-handled is the application microtask completion mark; a request sent during handling can precede that mark.
Each harness has 11 A/B pairs plus 11 A/A pairs. All 88 scored captures valid; no discarded/replayed samples, missing hard metrics, truncated buffers or censored tails. At least 6.05 s native / 5.52 s Team quiet tail remains after final rows, last Details sample and visual/layout/mutation activity. Native A/A and Team A/A use identical frozen baseline bundles. Per-file hashes bind each bundle to its pinned clean source; native quiet-host idle samples were 81.0% and 75.9% on the dedicated 16-vCPU box.
Primary A passes 11/11 on both harnesses: first populated Subagents is already at final height (native 112→112 px, Team 142→142 px); Outputs/Automations movement is 0/0 px on every base and candidate capture, including A/A, with no later section insertions/removals. Primary B passes natively: 10/11 earlier, paired median −32.3 ms, and 6/11 recover more than the preregistered 30.2 ms. Native A/A is only 6/11 earlier, paired median −5.8 ms.
No hard secondary crosses the standing regression rule. Native hello/first-RPC paired rises are +21.7/+22.9 ms, with mixed 5-better/6-worse signs and overlapping IQRs; identical-bundle A/A has +38.5/+38.8 ms and the same sign split. Team LoAF is +17 ms paired median, 8/11 worse with overlapping IQRs; final rows are +27.4 ms, 7/11 worse (A/A +31.2 ms, 8/11 worse). These are reported as noise/inconclusive secondaries, not claims of unchanged execution cost.
Three separate unscored native pairs establish causality: first populated Details follows live-module response by +15.7/+36.1/+36.3 ms on base, but precedes it by 24.3/12.2/10.1 ms on candidate. All retain final geometry. The regression also holds the actual activity request until cached rows are asserted, rather than substituting a mocked lazy component.
CI-owned byte check
corepack pnpm ui:check-performance:base e27b909e49d33bd723a2cfc10e944845f00249b7passes, Node 24.19.0 / Vite 8.3.5 / Pako 3.0.3. These are its hash-normalized source-comparison values, not full-build or served-gzip sizes. No caps changed.Chat has inherited absolute excess on both arms (1,150 → 734 B); the repository comparison accepts the reduction. The largest ordinary shared chunk also has inherited excess. This is not a claim that every absolute cap is below its limit. Request counts are unchanged: Chat 20, New 15, startup 3. An earlier pre-rebase candidate exceeded Chat; that result is superseded by this exact-head/current-base comparison.
Native target snapshot: 114,800 → 114,800 B. Team target snapshot: 61,967 → 62,223 B (+256); identical-bundle A/A also differs 61,741 → 61,966 B (+225), so the whole difference cannot be attributed to code. No cache fields changed. Native RPC counts are base 66–67 / candidate 66; median request payload size is 37,701 B on both, response 563,156 → 562,625 B (A/A also varies). Team is 54–55 RPCs on both arms.
native-ab — 11 pairs
All times are ms from navigation. Entries are median [Q1, Q3]; delta is candidate minus base. A/A labels are positional, with identical source bytes.
All 11 geometry pairs: base/candidate first→final Subagents height and 0/0 px Outputs/Automations movement match the values above; no insertions/removals.
native-aa — 11 pairs
All times are ms from navigation. Entries are median [Q1, Q3]; delta is candidate minus base. A/A labels are positional, with identical source bytes.
All 11 geometry pairs: base/candidate first→final Subagents height and 0/0 px Outputs/Automations movement match the values above; no insertions/removals.
bench-ab — 11 pairs
All times are ms from navigation. Entries are median [Q1, Q3]; delta is candidate minus base. A/A labels are positional, with identical source bytes.
All 11 geometry pairs: base/candidate first→final Subagents height and 0/0 px Outputs/Automations movement match the values above; no insertions/removals.
bench-aa — 11 pairs
All times are ms from navigation. Entries are median [Q1, Q3]; delta is candidate minus base. A/A labels are positional, with identical source bytes.
All 11 geometry pairs: base/candidate first→final Subagents height and 0/0 px Outputs/Automations movement match the values above; no insertions/removals.
Validation and remaining gap
pnpm test ui/src/e2e/chat-details-subagents-reload.e2e.test.ts --maxWorkers=1wall 35.13 s. The exact strengthened normal case is red on pinned base: actual module request is held, cache priming succeeds, butsection.chat-details-sessionnever appears (10 s assertion timeout).650091daacdc10aa374e82a6327e8beffe136072. Both failextensions/deep-research/browser/index.tsximporting missing./client.js. Candidate wall 11.25 s; current-main control 11.36 s. Chromium, Firefox and WebKit (including OS dependencies) were installed; checkout ancestry was not group/world-writable. No missing-browser/private-boundary exception was applied. No whole-suite pass is claimed; this remains a landing-proof gap until the unrelated main build is repaired.gatewayWatchruntime profile plus normal UI builds from separate clean pinned source checkouts because the ordinary full build hits that same inherited research error. Both UI bundles use the same build method; the unchanged candidate Gateway backend serves both through the existing comparison owner. Native browsers/Gateways were stopped.e3b66a3a94b2c50dc5ddff763e8f2a7b5da4b2cb, 26 successful / 29 skipped jobs. All three selectedchecks-uishards, the selected UI e2e shard andcontrol-ui-performancepass. This selected CI coverage does not replace the full-suite gap above. No merge/auto-merge is authorized.AWS provenance: final proof lease/run,
cbx_267469c1ce10. Subsequent comparison stages ran serially over its native SSH transport without another checkout sync. Earlier setup-only leasescbx_dad6a50dd97eandcbx_756f15385e23were released before this comparison; their measurements were not mixed into it. Reusing fresh-PR checkout once reset ignored build artifacts before capture; that failed setup stage was corrected, not treated as a product result.Production LOC
git diff --stat origin/main...HEAD -- ':!*.test.ts' ':!*test-support*' ':!docs/*':Runtime −11 LOC. Third touched file:
ui/src/e2e/chat-details-subagents-reload.e2e.test.ts(37 added / 37 deleted). No schema, config, global boot/mount ordering, L293 docking/loader/prewarm, sidebar or transcript edits.Inspected synthetic before/after
The attached strips are raw crops of the same viewport region, from native pair 5 (the median paired Details delta, −32.3 ms). Main at 1,336 ms still has empty Details; candidate at 1,333 ms has the complete 112 px Subagents group, Outputs and Automations. Their DOM first-populated milestones are 1,352 / 1,320 ms. Screencast samples support the visible state; they do not claim every-vsync precision. Full frames were inspected for incidental data before cropping/upload; all content is synthetic.
All three task leases are released with provider cleanup complete; no task Gateway listeners remained before release.