Repository navigation
fix(ui): correct chat attachment lifetimes and diff refresh - #179073
Conversation
Pair each mobile Details attachment with its keyed Solid lifecycle cleanup. Render the chat page with JSX and update route consumers, test paths, and generated boot metadata.
|
🦞👀 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 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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR releases replaced mobile Details attachments and converts the chat page renderer to JSX. Example: A mounted mobile Details view replaces host A with host B.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR fixes a lifecycle defect still present on main; no actionable patch defect was found, but failed CI checks remain unattributed. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI chat sidebar receives pane-owned mobile presentation callbacks, attaches the Details DOM container, and releases that attachment when its rendering lifetime ends. flowchart LR
A[Chat route] --> B[Chat page bridge]
B --> C[Retained chat pane]
C --> D[Pane mobile presentation owner]
D --> E[Keyed Details attachment]
E --> F[Details DOM container]
Technical reviewBest possible solution: Keep attachment setup and cleanup together in the existing keyed rendering branch while preserving pane ownership and lazy chat loading. Do we have a high-confidence way to reproduce the issue? Source inspection establishes that replacing the keyed attachment overwrites the previous cleanup callback without invoking it; the supplied regression exercises that transition, but no target code was run during this read-only review. Is this the best way to solve the issue? The repair uses the existing lifecycle owner, removes redundant callback state, and adds one meaningful regression; the JSX conversion preserves reactive props and updates the route, test, and boot-manifest consumers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ef6d500b5340. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests +68, Other 0. Total +68 across 15 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
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 October 21, 2026, 1:59 AM ET / 05:59 UTC. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ffd01e0bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "ui/src/pages/chat/chat-page-retained-sessions.ts", | ||
| "ui/src/pages/chat/chat-page-state.ts", | ||
| "ui/src/pages/chat/chat-page.ts", | ||
| "ui/src/pages/chat/chat-page.tsx", |
There was a problem hiding this comment.
Update the startup guard for the TSX rename
After this path changes to chat-page.tsx, the source-map matcher in ui/src/e2e/workspace-panel-startup.e2e.test.ts:106-108 still recognizes only pages/chat/chat-page.ts. If the New Session bundle begins eagerly including the renamed chat module, that entry is now omitted from sources.filter(...) and the E2E assertion passes, removing the regression coverage for keeping chat-only code out of New Session. Update the matcher to recognize the .tsx path.
AGENTS.md reference: ui/AGENTS.md:L76-L79
Useful? React with 👍 / 👎.
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
Include the landed #179073 correction for the session-diff CI failure. The authored dashboard filter patch is unchanged.
…#179073) * fix(ui): release replaced mobile chat details hosts Pair each mobile Details attachment with its keyed Solid lifecycle cleanup. Render the chat page with JSX and update route consumers, test paths, and generated boot metadata. * fix(ui): stabilize mobile details attachment ownership * test(ui): complete mobile details fixture props * test(ui): use Panels in dashboard continuity flow * test(ci): compare only selected shard metadata fields * test(ui): dismiss session hovercard before pane activation * fix(ui): refresh native session diffs explicitly
What Problem This Solves
Replacing a chat pane's mobile Details host leaves the previous host holding its mounted element. During full CI, a changed-patch refresh failure also exposed that explicit Refresh uses the native polling contract and can receive a recent stale diff. This completes the lifecycle/JSX portion of the top-level chat Solid 2 audit and repairs that coupled freshness path.
User Impact
Mobile Details keeps its attachment across ordinary pane snapshots and releases each previous owner when it is replaced or removed. Explicit Review refresh and gap revalidation request current native state; late background reads cannot replace the newer uncommitted result. Layout, routes, tags, classes, and split-pane behavior stay the same.
Why This Change Was Made
The Details attachment now returns its own cleanup from the keyed branch's existing
onSettled, removing the component-wide last-host variable. The pane exposes a stable instance callback so fresh presentation snapshots do not detach and reattach the same owner. The chat page renders JSX from.tsx, with all source-path consumers and the generated boot manifest updated while retaining the route's lazy boundary. A small optional loader{ refresh: true }maps explicit reads to the existing nativepoll: falsecontract. Initial/background/computing reads keep polling; the cache and Gateway owners are unchanged.Evidence
7be766ca2198(15m 45.2s)fc13def7723c)ci:fullThe real-owner regression fixture supplies the required
regionErrorprop, and its exact UI-chat test-typecheck leaf passes locally.No appearance changes are intended: the render structure, classes, content, and controls are preserved. The changed behavior is the owner-release contract, proven by the failing/passing lifecycle test; no screenshots of a new visual state apply.
The root build emitted and validated all 3,960 sidecars, then stalled in SSD filesystem
renameduring artifact publication. That process was cancelled and its stale lock recovered after verifying all owned processes had exited. The repaired candidate then built successfully through the UI package build into a separate proof directory; the strict check below used that completed output. PR CI supplies the normal root build and same-toolchain base comparison.The unchanged base already exceeds the current startup ratchet (325,166 B). The final candidate adds only 18 gzip bytes with identical raw startup bytes; chat boot changes from 1,491,304 to 1,491,327 B gzip (+23 B). The budget file is not changed. The Lit codemod was retired on main in #174213; these are existing Solid renderers. The installed rc.14 cheatsheet, Solid skill/references, and upstream actions RFC were read.
Solid 2 audit counts and retained contracts
Checklist counts include the four touched rendering modules (
chat-page,chat-pane-sidebar-view,route-view, andsession-diff-panel), with unchanged panel state counted explicitly. The plain TypeScript owners and inventory add no listed Solid patterns.onCleanupcreateComponentEffects, untrack, direct native listeners, DOM queries, flush, and owner-escape calls remain zero in these modules. Test LOC grows by 125 across the lifecycle and freshness regressions (including removal of one redundant call-shape assertion); no test-only production seams were added.
Across the top-level lane, 15
onCleanupcalls become 14 and its solecreateComponentcall is removed. Survivors protect synchronous pane registration, boot/prefetch, owner retirement/commit cancellation, or binding-specific icon requests. Deferring their registration would lose disposal-before-settlement or startup ordering guarantees.Retained cleanup contracts (14 calls across 11 top-level files):
chat-page-state.tschat-pane-lifecycle.tschat-pane-mcp-app.tschat-pane-runtime-view.tsxchat-pane-session-panel-toggle.tschat-pane.tsxchat-provider-review-controller.tsxchat-tool-icon-controller.tschat-viewer-presence.tssession-prefetch.tssolid-render-lifecycle.tsThe sidebar's 13 imports are shared custom-element registration authority: ordered panel intent delivery awaits the pending registrations. Outbox refresh retires delivered recovery records and prepares durable recovery storage; it is not a pure async read. Provider continuation retains captured authority, synchronous admission, idempotency/ACK/receipt state, and explicit retry. Tool icons retain miss batching, per-binding abort, and blob revocation. The clipboard process flag is handled in focused follow-up #179256 using the shared runtime split from #179084. The follow-up adopts the native action as a separate change. Their snapshots are already owner-scoped; no competing stores, speculative
Loadingregions, orRevealbehavior were added.Main independently landed the CI planner type fix, dashboard selector repair, and pane-activation repair. This PR keeps main’s exact ancillary repair files. The lifecycle/JSX change is 16 files, +100/−41; the coupled freshness repair adds five files, +87/−15. The combined production change is six net lines. Current-head proof is recorded below; preceding-run results above remain historical evidence.
Pre-refresh CI
39577656621passes performance and security. The pre-repair run has four root failures:Control UI Markdown table interactions > contains content-sized tables after restoring a percentage reading width39578067192CI changed Node test plan > retains leaf-config owners and their execution metadata5e4a348cd24c: expected undefined, receivedOPENCLAW_VITEST_MAX_WORKERS: "2"Control UI cross-channel automation management with a real Gateway > configured owners and admin chat manage a Telegram-created job while a non-owner cannotcreate:reply timeout at line 308 fail on then-latest completed scheduled main39578067192manual code folding through a real Gateway > folds actual sessions.diff source without concealing edits in expanded files39578067192(26.1 s), so it is not waived as inherited. The explicit-refresh defect is repaired below; replacement-head CI must re-exercise this original testThe freshness regression mounts the actual workspace diff owner and panel, holds an older Uncommitted polling read, clicks Refresh, and requires updated visible text. It failed before the repair with the original snapshot still shown (41.39 s invocation). The repaired two-file run passed 56 cases; its sole failure was an obsolete one-argument call-shape assertion. Removing that redundant assertion preserves every stale-gap behavior assertion. The two affected cases then passed (40.10 s invocation, 55 nonmatching cases skipped), including proof that the late poll cannot replace the fresh owner result. Production UI and UI-chat test tsrs checks pass. No sleeps, timeouts, Gateway cache policy, or visible-behavior assertions are changed.
The directly coupled panel retains its existing pending/error flow and collapse-state store; this repair changes only its read intent. W-S2-CHAT-D owns broader panel adoption and its lifecycle work has independently landed in #179115. The table includes that coupled panel’s unchanged read flow (result, pending, computing, and error signals), six structured signals, and the component cleanup already converted independently on main by #179115. The freshness interface adds no action, signal, effect, or lifecycle registration. Top-level renderers alone shrink from 852 to 847 lines.
Replacement head
7be766ca2198adds the reviewed freshness repair. Independent Codex review is validated scoped-clean through P2. UI and UI-chat test types, targeted full type-aware lint usingconfig/tsconfig/oxlint.core.json, formatting, and the two affected test cases pass. The first lint-wrapper attempt timed out preparing plugin SDK declarations before linting; the supported source-based core/UI configuration then completed successfully. Production Knip passed on this unchanged production tree (15m 45.2s). Replacement-headci:fullhas completed; its results are recorded below.Final candidate CI 39586084167 (
7be766ca2198) explicitly passes the original real-Gateway folding case in 14.866 s. All three UI-unit shards, eight of nine UI E2E shards, performance, and security-fast pass. The remaining E2E shard and real-Gateway shard fail only the two exact tests also failing on latest completed scheduled main 39585413125: Markdown containment at line 214, and cross-channel automation at its firstcreate:wait at line 308. The complete run contains 52 successful, 23 intentionally skipped, and exactly those two failed jobs plus their aggregate gate; no cancellation or timeout is omitted.Current-head performance: 330,985 B startup JS gzip, 990,059 raw bytes, 8 JS / 1 CSS request. Chat boot is 1,499,590 → 1,499,632 B gzip (+42 B) and remains below its 1,500,000 B cap. The normal CI performance check passes; the original local absolute ratchet failures above remain explicitly historical.
Native inherited-failure evidence pins tested merge
a1576d890aafwith ordered parents01dfb1dca0c8and this exact head, verifies unchanged named failure inputs, and retains hashed PR/main logs. The confirmed-cancelled auto request remains retired; landing uses explicit replacement recovery with this evidence. No failing CI is relabeled green.Named current-head runtime proof:
chat-loading-performance.real-gateway.e2e.test.tspasses (30.795 s case). Retention cases pass: chat-pane-retention.test.ts (2), chat-thread-retention.test.ts (1), chat-page-retained-sessions.test.ts (37), chat-pane-retained-presentation.test.ts (22). The named test logs are retained with the CI evidence.Before recovery, the newer completed scheduled main run
39585413125independently reproduces both exact failure names and assertions. The native evidence now hashes that newer baseline’s logs.