Repository navigation
fix(ui): keep tool rendering lazy and preserve hidden plugin views - #169346
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. What this changesThis PR restores lazy tool rendering and preserves selected plugin views across transcript hiding and restoration. Example: A selected read-tool renderer contains the local draft “Retained plugin draft” when the transcript is hidden and restored.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: current main still needs the lazy-rendering and retained-view repair, no introduced defect was found, and all three UI unit shards now pass on the reviewed head. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI passes prepared tool results through a shared selector that chooses built-in output or a selected plugin view and follows presentation, context, and disposal lifecycles. flowchart TD
A[Prepared tool result] --> B[Solid message row]
B --> C[Shared surface selector]
D[Plugin registry] --> C
C --> E[Built-in output]
C --> F[Selected plugin view]
G[Presentation lifecycle] --> C
Technical reviewBest possible solution: Keep the existing selector and lifecycle owners responsible for lazy rendering, retained state, and view retirement. Do we have a high-confidence way to reproduce the issue? Current-main source shows eager hosting and runtime clearing during disconnection, and the author reports the mounted regression failing before repair; this review ran no target code. Is this the best way to solve the issue? Reusing the shared selector repairs the owning boundary, and migrating every facade caller completes the internal cutover without changing the public plugin SDK. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 70bfdc2b58e4. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +16, Tests +239, Other -2. Total +253 across 29 files. Added test files: 0. View PR surface stats
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 HistoryReview history (9 earlier review cycles; latest 8 shown)
Reviewed October 12, 2026, 2:48 AM ET / 06:48 UTC (Revision 10). |
Related: #168887, #169439, #169441 ## What Problem This Solves Fixes missing nested chat activity and stale media resources after the Solid transcript migration, restoring 20 failing `checks-ui` cases inherited by unrelated PRs. ## User Impact Expanded activity shows its nested calls again. Parked image and video previews release their resources and reconnect through the existing scope-checked caches. No settings, protocol, storage, or migration changes. ## Why This Change Was Made Keep deferred tool-card children inside their existing Lit-owned range instead of creating nested Solid roots that are retired while parked. Bind image and video resource lifetimes to the existing Solid presentation context. Update lifecycle fixtures to await the documented deferred Solid disposal boundary without removing or weakening any assertions. Checked steipete's open UI PRs before editing. #169442 overlaps the activity headline, not these repairs. #169346 has green UI results on an older tree, but its head lacks the later bridge changes and does not repair these current-main failures. No overlap with Pash/Sarah changes. ## Evidence - Baseline `a9b40cf325e`: all **20 reported failures reproduced** across eight files (116 other cases passed). - Rebased onto current main, including #169439 and #169441: **190 tests passed across 10 files**, including all 20 failures plus media handoff and native media siblings. - `pnpm tsgo:ui`: passed. - `pnpm run tsgo:test:ui`: all UI shards passed. - Changed-file oxlint/oxfmt, line-cap ratchet against `origin/main`, and `git diff --check`: passed. - Independent P0–P2 review: no actionable findings. - Original failing CI: [shard 2](https://github.com/openclaw/openclaw/actions/runs/38184982892/job/114605449166), [shard 3](https://github.com/openclaw/openclaw/actions/runs/38184982892/job/114605449173), and [image admission run](https://github.com/openclaw/openclaw/actions/runs/38184424359). ### Expanded activity, before and after Captured from the same Chromium fixture and inspected. Before: the opened parent has no nested calls. After: the calls render and the original height/collapse assertions pass. | Before | After | | --- | --- | |  |  | |  |  | <details> <summary>Per-test disposition: all 20 fixed</summary> | Test file | Previously failing cases | Status | | --- | --- | --- | | `chat-activity-layout.browser.test.ts` | Expanded height and collapse, standalone | fixed | | `chat-activity-layout.browser.test.ts` | Expanded height and collapse, inline | fixed | | `chat-activity-layout.browser.test.ts` | Opened lone step with routine nested calls | fixed | | `chat-activity-disclosure.test.ts` | Settled completed step with routine nested calls | fixed | | `chat-position-rail.test.ts` | Focused previews, pointer exit, removal, and session reset | fixed | | `chat-message-attachment-admission.test.ts` | Stale admission after source replacement/disconnect | fixed | | `chat-message-text-chip-admission.test.ts` | Stale comment observations | fixed | | `chat-message-text-chip-admission.test.ts` | Stale paste observations | fixed | | `chat-transcript-invalidation.test.ts` | Hidden video preview, rendered parent | fixed | | `chat-transcript-invalidation.test.ts` | Hidden video preview, parked parent | fixed | | `chat-message-media-lifecycle.test.ts` | Guarded managed image reconnect | fixed | | `chat-message-image-admission.test.ts` | Loaded assistant image remount | fixed | | `chat-message-image-admission.test.ts` | Loaded assistant image reconnect | fixed | | `chat-message-image-admission.test.ts` | Detached image after authToken change | fixed | | `chat-message-image-admission.test.ts` | Detached image after sessionKey change | fixed | | `chat-message-image-admission.test.ts` | Detached image after agentId change | fixed | | `chat-message-image-admission.test.ts` | Detached image after connectionEpoch change | fixed | | `chat-message-image-admission.test.ts` | Detached image after resourceBasePath change | fixed | | `chat-message-image-admission.test.ts` | Detached image after policyKey change | fixed | | `chat-message-image-admission.test.ts` | Detached image after expiry | fixed | No reported case was already fixed on the captured main baseline. The managed-image remount sibling already passed and continues to pass. </details> Two-way door: reverting restores the prior rendering/resource behavior without changing persistent state. Blast radius is Control UI chat activity disclosure and image/video preview lifecycles. Co-authored-by: Ayaan Zaidi <[email protected]>
b3d3411 to
621d737
Compare
Flush Solid after the fixture reconnects its transcript, matching the existing chat render helper. Main's presentation-gated images now commit after connection, so the immediate query saw a valid intermediate state. Preserve every custody, sender, image identity and promotion assertion. Reproduced all four failures on the CI merge base and clean current main without the plugin repair in #169346. Exact Bun UI check now passes all seven cases (9.302s wall); pnpm test file --maxWorkers=1 passes in 25.122s. Scoped format, typed lint and independent P0-P2 review pass.
Render ordinary tool output through its synchronous built-in owner and mount the plugin host only for a selected replacement. Resolve plugin context from retained Solid ranges, preserve selected view state while parked, and reacquire current context before reconnecting. Regenerate the boot graph, including already-landed Solid owner moves. Chat meets the unchanged 35-request budget. Mounted lifecycle and sibling tests: 29 passed; changed-file wall 12.206s, added case 101ms. Desktop/mobile bundled Code Mode proof, production/test types, scoped checks, and independent P2 review pass.
621d737 to
0c2782f
Compare
Related: openclaw#168887, openclaw#169439, openclaw#169441 ## What Problem This Solves Fixes missing nested chat activity and stale media resources after the Solid transcript migration, restoring 20 failing `checks-ui` cases inherited by unrelated PRs. ## User Impact Expanded activity shows its nested calls again. Parked image and video previews release their resources and reconnect through the existing scope-checked caches. No settings, protocol, storage, or migration changes. ## Why This Change Was Made Keep deferred tool-card children inside their existing Lit-owned range instead of creating nested Solid roots that are retired while parked. Bind image and video resource lifetimes to the existing Solid presentation context. Update lifecycle fixtures to await the documented deferred Solid disposal boundary without removing or weakening any assertions. Checked steipete's open UI PRs before editing. openclaw#169442 overlaps the activity headline, not these repairs. openclaw#169346 has green UI results on an older tree, but its head lacks the later bridge changes and does not repair these current-main failures. No overlap with Pash/Sarah changes. ## Evidence - Baseline `1bb91e30fd5`: all **20 reported failures reproduced** across eight files (116 other cases passed). - Rebased onto current main, including openclaw#169439 and openclaw#169441: **190 tests passed across 10 files**, including all 20 failures plus media handoff and native media siblings. - `pnpm tsgo:ui`: passed. - `pnpm run tsgo:test:ui`: all UI shards passed. - Changed-file oxlint/oxfmt, line-cap ratchet against `origin/main`, and `git diff --check`: passed. - Independent P0–P2 review: no actionable findings. - Original failing CI: [shard 2](https://github.com/openclaw/openclaw/actions/runs/38184982892/job/114605449166), [shard 3](https://github.com/openclaw/openclaw/actions/runs/38184982892/job/114605449173), and [image admission run](https://github.com/openclaw/openclaw/actions/runs/38184424359). ### Expanded activity, before and after Captured from the same Chromium fixture and inspected. Before: the opened parent has no nested calls. After: the calls render and the original height/collapse assertions pass. | Before | After | | --- | --- | |  |  | |  |  | <details> <summary>Per-test disposition: all 20 fixed</summary> | Test file | Previously failing cases | Status | | --- | --- | --- | | `chat-activity-layout.browser.test.ts` | Expanded height and collapse, standalone | fixed | | `chat-activity-layout.browser.test.ts` | Expanded height and collapse, inline | fixed | | `chat-activity-layout.browser.test.ts` | Opened lone step with routine nested calls | fixed | | `chat-activity-disclosure.test.ts` | Settled completed step with routine nested calls | fixed | | `chat-position-rail.test.ts` | Focused previews, pointer exit, removal, and session reset | fixed | | `chat-message-attachment-admission.test.ts` | Stale admission after source replacement/disconnect | fixed | | `chat-message-text-chip-admission.test.ts` | Stale comment observations | fixed | | `chat-message-text-chip-admission.test.ts` | Stale paste observations | fixed | | `chat-transcript-invalidation.test.ts` | Hidden video preview, rendered parent | fixed | | `chat-transcript-invalidation.test.ts` | Hidden video preview, parked parent | fixed | | `chat-message-media-lifecycle.test.ts` | Guarded managed image reconnect | fixed | | `chat-message-image-admission.test.ts` | Loaded assistant image remount | fixed | | `chat-message-image-admission.test.ts` | Loaded assistant image reconnect | fixed | | `chat-message-image-admission.test.ts` | Detached image after authToken change | fixed | | `chat-message-image-admission.test.ts` | Detached image after sessionKey change | fixed | | `chat-message-image-admission.test.ts` | Detached image after agentId change | fixed | | `chat-message-image-admission.test.ts` | Detached image after connectionEpoch change | fixed | | `chat-message-image-admission.test.ts` | Detached image after resourceBasePath change | fixed | | `chat-message-image-admission.test.ts` | Detached image after policyKey change | fixed | | `chat-message-image-admission.test.ts` | Detached image after expiry | fixed | No reported case was already fixed on the captured main baseline. The managed-image remount sibling already passed and continues to pass. </details> Two-way door: reverting restores the prior rendering/resource behavior without changing persistent state. Blast radius is Control UI chat activity disclosure and image/video preview lifecycles. Co-authored-by: Ayaan Zaidi <[email protected]>
Flush Solid after the fixture reconnects its transcript, matching the existing chat render helper. Main's presentation-gated images now commit after connection, so the immediate query saw a valid intermediate state. Preserve every custody, sender, image identity and promotion assertion. Reproduced all four failures on the CI merge base and clean current main without the plugin repair in openclaw#169346. Exact Bun UI check now passes all seven cases (9.302s wall); pnpm test file --maxWorkers=1 passes in 25.122s. Scoped format, typed lint and independent P0-P2 review pass.
The resolved tree exactly matches independently reviewed candidate 9d5f9ada5d7331fac7689e4ccfe6455d8b0a65a2. This preserves the published PR ancestry; no new source changes.
Hold the initial descriptor while publishing complete placement snapshots from the existing Gateway event builder. Assert visible provisioning, workspace preparation and startup phases without premature sends. This replaces the obsolete assumption that each event performs another parent describe read. Refresh the generated boot inventory after main component migrations and retain the shared tool-result selector export used by the lazy Solid path. Latest main integration passes 30 mounted owner cases and all 15 browser boot-boundary cases, plus UI production/test types and scoped checks. Fresh full-candidate P2 review is clean.
Complete the direct Solid component cutover by removing two obsolete re-export facades and migrating every caller. Preserve mock exports and all assertions. Strict Chat startup returns from 37 JavaScript requests to the existing 35-request budget; 315 affected tests, UI types, scoped checks and fresh independent review pass.
The one-shot session action helper hit-tests without scrolling or waiting for an actionable control. A visible enabled button below the viewport is therefore rejected before activation. Use Playwright's actionability-only trial before the unchanged synchronous guard and one real activation. The new browser regression fails on the old helper and passes in 278ms; 12 archive and sibling action cases pass in 56.850s wall. UI E2E types, scoped typed lint, formatting and diff checks pass. Independent review raised an immediate-readiness timing concern. Rejected after inspecting the introducing change and callers: this helper performs a user action, while permission tests assert denial independently. Bounded native readiness waiting is intended; no timeout or retry setting changes. The hosted archived-session guard failure lacked diagnostics identifying which condition failed. Its exact branch was not reproduced; the offscreen regression proves the helper defect without claiming that CI was offscreen.
Wait for the real detail-panel custom element and its first update before checking pasted-text fetch, download and content behavior. The rendered tag can exist while its module is still loading; no assertion or timeout changes. A controlled real-module gate fails the original one-second predicate before registration, then preserves all 11 existing cases after release. The candidate file passes 11/11 in 8.707s wall with the pinned CI Bun. Fresh P2 review is clean. The exact cold-load cause of the original hosted timeout remains unproven.
Baseline-Refresh: b6cd37b6d37242181ba99e22e3c9c7144faf55e4
Regenerate through the canonical manifest owner after combining the lazy plugin repair with current main chunk grouping. UI build and strict performance pass at31 Chat and28 New Session requests. All49 affected plugin, interop, composer and preview tests pass; fresh complete P2 review is clean.
|
Merged via squash.
|
…penclaw#169346) * fix(ui): keep tool replacements lazy across Solid boundaries Render ordinary tool output through its synchronous built-in owner and mount the plugin host only for a selected replacement. Resolve plugin context from retained Solid ranges, preserve selected view state while parked, and reacquire current context before reconnecting. Regenerate the boot graph, including already-landed Solid owner moves. Chat meets the unchanged 35-request budget. Mounted lifecycle and sibling tests: 29 passed; changed-file wall 12.206s, added case 101ms. Desktop/mobile bundled Code Mode proof, production/test types, scoped checks, and independent P2 review pass. * build(ui): refresh boot inventory after main repairs * test(ui): drive cloud placement through admitted snapshots Hold the initial descriptor while publishing complete placement snapshots from the existing Gateway event builder. Assert visible provisioning, workspace preparation and startup phases without premature sends. This replaces the obsolete assumption that each event performs another parent describe read. Refresh the generated boot inventory after main component migrations and retain the shared tool-result selector export used by the lazy Solid path. Latest main integration passes 30 mounted owner cases and all 15 browser boot-boundary cases, plus UI production/test types and scoped checks. Fresh full-candidate P2 review is clean. * fix(ui): avoid loading new-session chunks for ordinary chat Complete the direct Solid component cutover by removing two obsolete re-export facades and migrating every caller. Preserve mock exports and all assertions. Strict Chat startup returns from 37 JavaScript requests to the existing 35-request budget; 315 affected tests, UI types, scoped checks and fresh independent review pass. * test(ui): wait for actionable self-removing session controls The one-shot session action helper hit-tests without scrolling or waiting for an actionable control. A visible enabled button below the viewport is therefore rejected before activation. Use Playwright's actionability-only trial before the unchanged synchronous guard and one real activation. The new browser regression fails on the old helper and passes in 278ms; 12 archive and sibling action cases pass in 56.850s wall. UI E2E types, scoped typed lint, formatting and diff checks pass. Independent review raised an immediate-readiness timing concern. Rejected after inspecting the introducing change and callers: this helper performs a user action, while permission tests assert denial independently. Bounded native readiness waiting is intended; no timeout or retry setting changes. The hosted archived-session guard failure lacked diagnostics identifying which condition failed. Its exact branch was not reproduced; the offscreen regression proves the helper defect without claiming that CI was offscreen. * test(ui): await lazy preview registration before assertions Wait for the real detail-panel custom element and its first update before checking pasted-text fetch, download and content behavior. The rendered tag can exist while its module is still loading; no assertion or timeout changes. A controlled real-module gate fails the original one-second predicate before registration, then preserves all 11 existing cases after release. The candidate file passes 11/11 in 8.707s wall with the pinned CI Bun. Fresh P2 review is clean. The exact cold-load cause of the original hosted timeout remains unproven. * build(ui): regenerate boot membership after integration Regenerate through the canonical manifest owner after combining the lazy plugin repair with current main chunk grouping. UI build and strict performance pass at31 Chat and28 New Session requests. All49 affected plugin, interop, composer and preview tests pass; fresh complete P2 review is clean.
What Problem This Solves
Ordinary chat tool output eagerly loaded the plugin view host, and selected plugin views could lose local state when the transcript was hidden and shown again. This repairs the existing lazy-loading and retained-view behavior.
User Impact
Built-in tool output stays synchronous. A selected plugin renderer retains its mounted view and local draft while parked, then resolves current application context on reconnect. Deselecting or changing its provider retires the prior view and authority. No settings, protocol, storage, or migration changes.
Implementation
The Solid tool-result renderer uses the existing tool-result selector. Its directive resolves context from an attached Lit host or retained Solid marker, releases subscriptions while hidden, and retains the facts needed by the parked view. Keeping nested asynchronous directives inside their template preserves their connection registration. Two obsolete one-line component facades are removed, with all callers importing the existing TSX owners directly; this keeps New Session code out of ordinary Chat. Upstream live-translation behavior and boot grouping are preserved. The boot manifest is regenerated through its owner, with unchanged budgets.
Two test fixture corrections preserve their original assertions. Cloud placement now emits complete admitted Gateway snapshots and holds the initial descriptor pending instead of expecting obsolete payloadless events and repeated descriptor reads. Pasted-text preview assertions wait for real custom-element registration and its first update, since the tag exists while the module is still loading. No retries, longer timeouts, or weaker assertions are added.
Evidence
e158fc392ccpasses 49 tests across five affected plugin/interop/composer/New Session files in 18.370 s.Inspected synthetic screenshots
These captures show unchanged ordinary tool output. Selected-plugin parking and provider handoff are covered by mounted regression assertions, not these screenshots.
CI, Review, and Limitations
The CI attempt at
44e83d7failed the first pasted-text preview case inchecks-ui (3/3); 7,514 sibling cases passed and two were skipped. A local replay with the checksum-pinned CI Bun passed 571 files / 7,517 cases plus two skips in 218.103 s. That replay used the original selectors, not the exact CI merge tree, and is not claimed to prove a fix. The controlled registration proof establishes a real fixture defect; the exact hosted cold-load condition remains unproven. Cancelled sibling jobs remain unrun coverage.ClawSweeper at
44e83d7reported no introduced code findings but requested failure attribution; the investigations and their remaining uncertainty are recorded above. The complete prior candidate and preview correction passed independent P0–P2 review. Fresh complete integration review againste158fc392ccis also clean, with no actionable P0–P2 findings. Main independently landed the archive actionability repair and stronger regression in55cdee6967b; both upstream files are retained wholesale, and that superseded delta is removed from this PR. The conflict-only refresh incorporates main throughb9119c5435b; every remaining PR path is byte-identical to the freshly reviewed and tested491d8745f13candidate. The earlier auto-merge request was explicitly retired; native recovery preserves its record.Historical real
openai/gpt-5.6-lunaGateway proof at1478e25separately verifies final-answer persistence and a tool-created/read synthetic file. That is service-level evidence for the older head. The browser tool rejected reloading its old error page under URL policy, so this updated candidate does not claim fresh human browser proof.