Skip to content

fix(ui): correct chat attachment lifetimes and diff refresh - #179073

Merged
steipete merged 12 commits into
mainfrom
solid2/w-s2-chat-a
Oct 21, 2026
Merged

steipete merged 12 commits into
mainfrom
solid2/w-s2-chat-a

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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 native poll: false contract. Initial/background/computing reads keep polling; the cache and Gateway owners are unchanged.

Evidence

Proof Result
Mobile Details regression Base failed at release of the replaced host; the expanded real-owner test also exposed unstable attachment identity before the producer fix. Both runs retained the four original passing cases
Focused UI tests (Bun, one worker) Repaired sidebar: 5 passed again on Solid rc.16 (101.70 s); unchanged page conversion: 31 passed in the earlier bounded run
UI typecheck Production UI and tooling leaf passed again after conflict resolution on rc.16; the UI-chat test leaf passed after its fixture repair (all tsrs)
Controller guard with baseline pruning Passed; no baseline changes
Production Knip Passed on the unchanged production candidate committed as 7be766ca2198 (15m 45.2s)
Targeted lint/format Passed; existing viewport-subscription warning only; test snapshot-read warnings removed
Independent Codex review Lifecycle repair and all subsequent test/type repairs reviewed through P2; no actionable findings remain
Base/head production builds and strict performance Bundle emission and sidecar validation passed; startup 329,055 → 329,073 B gzip (+18 B, within the 64 B build-variance allowance), identical 990,214 raw bytes, 7 JS requests and 1 CSS request; strict ratchet fails on both sides
CI performance before the refresh repair (fc13def7723c) Run 39577656621 passed: startup 330,969 B gzip, 989,994 raw bytes, 8 JS requests and 1 CSS request; chat boot 1,499,526 → 1,499,555 B gzip (+29 B)
Broad UI, E2E, chat perf and retention suites PR CI with ci:full

The real-owner regression fixture supplies the required regionError prop, 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 rename during 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, and session-diff-panel), with unchanged panel state counted explicitly. The plain TypeScript owners and inventory add no listed Solid patterns.

Checklist item Before After
1. Conditional intrinsic handler bindings 0 0
2. Component onCleanup 2 1
3. Hand-written async read flows 1 1
4. Manual mutation process flags 0 0
5. Manual component import loaders 0 0
6. Structured local signals, including retained panel state 6 6
7. Hand-written createComponent 1 0
8. Missing-provider context wrappers 0 0
9. Uncoordinated sibling Loading regions 0 0
10. Solid root/owner escape calls 0 0
Production renderer LOC 1,564 1,559
All touched production code, including coupled freshness owners and CI inventory 4,889 4,895

Effects, 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 onCleanup calls become 14 and its sole createComponent call 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):

File Calls Contract
chat-page-state.ts 4 Synchronously installed listeners, snapshot storage, retained sessions, and pending focus work
chat-pane-lifecycle.ts 1 Synchronously assigned panel-action handle
chat-pane-mcp-app.ts 1 Pane listeners and outstanding attachment work
chat-pane-runtime-view.tsx 1 Runtime disposal and commit promises, including disposal before first settlement
chat-pane-session-panel-toggle.ts 1 Window subscriptions and queued panel intents
chat-pane.tsx 1 Pane registration before parent commit discovery and its runtime mapping
chat-provider-review-controller.tsx 1 Disposal authority for asynchronous continuation and refresh work
chat-tool-icon-controller.ts 1 Computation cleanup when connection/session binding changes
chat-viewer-presence.ts 1 Viewer declaration installed synchronously by page boot
session-prefetch.ts 1 Listeners and prefetch work started before first commit
solid-render-lifecycle.ts 1 Commit-task cancellation in the primitive used by detail panels and transcript layout

The 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 Loading regions, or Reveal behavior 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 39577656621 passes performance and security. The pre-repair run has four root failures:

Failing test Evidence / status
Control UI Markdown table interactions > contains content-sized tables after restoring a percentage reading width Same line-214 containment assertion fails on then-latest completed scheduled main 39578067192
CI changed Node test plan > retains leaf-config owners and their execution metadata Same line-859 assertion reproduced on clean merge base 5e4a348cd24c: expected undefined, received OPENCLAW_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 cannot Same named test and first create: reply timeout at line 308 fail on then-latest completed scheduled main 39578067192
manual code folding through a real Gateway > folds actual sessions.diff source without concealing edits in expanded files Reopened source text times out at line 300. This named case passed on then-latest completed scheduled main 39578067192 (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 test

The 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 7be766ca2198 adds the reviewed freshness repair. Independent Codex review is validated scoped-clean through P2. UI and UI-chat test types, targeted full type-aware lint using config/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-head ci:full has 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 first create: 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 a1576d890aaf with ordered parents 01dfb1dca0c8 and 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.ts passes (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 39585413125 independently reproduces both exact failure names and assertions. The native evidence now hashes that newer baseline’s logs.

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.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T11:00:34.027160Z 7be766c New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts size: S labels Oct 21, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

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

  • Before: Host A retains its mounted-element reference until the containing view is disposed.
  • After: Host A releases its reference when replaced, and host B releases its reference when removed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch appears correct and has meaningful lifecycle coverage; shipped-entry-point evidence and attribution of failed CI checks remain limited.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor-proof gate; its supplied evidence exercises the changed renderer in a lifecycle test rather than through the shipped Control UI.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Replacing or removing a mobile Details host leaves the previous attachment retained beyond its rendering lifetime.
Reason: The small repair restores balanced attachment cleanup, and the maintainer-authored rendering audit supplies direction for the accompanying JSX cutover.

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
Reviewed head: 8d56e0bcac0630e1af7c793e545b50681dddd54f

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied shipped Control UI run exercises host replacement and removal; the reported base-red/head-green renderer test covers the lifecycle contract.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Mobile Details attachment lifetime keeps the original intent (fb0ad93: The mobile panel navigation feature kept presentation with the pane and attached Details content to its mobile container.)
  • Chat page component rendering keeps the original intent (5dd456a: The retained-chat Solid cutover preserved native hosts, plain TypeScript state ownership, retained panes, and lazy loading.)
  • Boot manifest and source-path consumers keeps the original intent (2077fb5: Measured boot groups separate shared startup modules from chat-only modules to avoid loading chat resources on New Session.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vyctor H. Brzezowski: Raw commit fb0ad93 adds ui/src/pages/chat/chat-pane-side-panels.ts:123 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: fb0ad93d0143; files: ui/src/pages/chat/chat-pane-side-panels.ts)

PR surface

Source 0, Tests +68, Other 0. Total +68 across 15 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 20 20 0
Tests 10 78 10 +68
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 8 8 0
Total 15 106 38 +68

Labels

Label changes:

  • add P2: The change repairs a bounded mobile Details lifecycle defect without evidence of lost data, broken authentication, or a blocked core workflow.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The change repairs a bounded mobile Details lifecycle defect without evidence of lost data, broken authentication, or a blocked core workflow.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 21, 2026, 1:59 AM ET / 05:59 UTC.

@steipete
steipete enabled auto-merge (squash) October 21, 2026 06:13
@steipete
steipete disabled auto-merge October 21, 2026 06:25

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@steipete steipete changed the title fix(ui): release replaced mobile chat details hosts fix(ui): correct chat attachment lifetimes and diff refresh Oct 21, 2026
@steipete
steipete merged commit 4ee4606 into main Oct 21, 2026
162 of 168 checks passed
@steipete
steipete deleted the solid2/w-s2-chat-a branch October 21, 2026 11:24
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

steipete added a commit that referenced this pull request Oct 21, 2026
Include the landed #179073 correction for the session-diff CI failure. The authored dashboard filter patch is unchanged.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
…#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
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 ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M 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