Skip to content

refactor(ui): retire the chat pane host lifecycle - #174538

Merged
steipete merged 6 commits into
mainfrom
solid2/w-idiom3-pane-owner
Oct 16, 2026
Merged

steipete merged 6 commits into
mainfrom
solid2/w-idiom3-pane-owner

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Solid rendered chat while ChatPaneBase still simulated a Lit host with a controller registry, decorated fields, a changed-properties map, and DOM forwarding methods. That left two rendering lifecycles around the same synchronous chat owners.

createChatPane now owns readiness, coalesced publication, and the commit-completion fence. ChatPaneStateOwner keeps synchronous facts and resources with explicit start/dispose operations. The generic ControllerHost and viewState exports are deleted; chat has no remaining host-adapter dependency.

User Impact

Session switching, reconnect, retained reader position, Board leases, realtime/media teardown, composer focus, tags, classes, and layouts retain their existing contracts. The existing hovercard provider and lazy page boundary are preserved.

The guest-session fixture waits for the effort picker to become enabled after model selection. Capturing sessions.patch is not completion of model reconciliation; clicking the disabled summary could silently do nothing. Product picker behavior is unchanged.

Ownership And Cutover

Startup attaches the synchronous domain owners and drains publication before mounting children. Four explicit input transitions replace the generic changed-properties map. Board subscriptions refresh outside parked rendering. Session replacement retires old state effects before attaching the next state. Reconnect starts the retained transcript owner. Disposal releases Board/media/realtime custody and settles commit waiters. Commit still clears the current fence before post-render work, commits chat effects, then resolves the captured waiter.

All 41 former decorated fields were audited. The state constructor receives the runtime's session identity explicitly, independently of custom-element properties. This preserves each split pane's initial layout and the prior absence of width-based fitting at that boundary.

The shared solid-controller-host.ts type contract remains for six non-chat production consumers in sidebar, dock layout, session-data, session-organizer types, and subscriptions. By the final main census another lane had removed its last runtime user, so the module is now type-only. Chat has no production import of that contract. The landed controller guard rejects new consumers; remaining chat lifecycle aliases are test fixtures.

Evidence

Check Result
pnpm tsgo:ui Passed on the integrated candidate
Lifecycle and frame-update suites, --maxWorkers=1 26 tests passed on the integrated candidate
CI-repair suites: startup, warm reload, snapshot hydration, retained presentation, probe adapter, geometry 62 existing cases verified across scoped runs; failed cases passed after repair
Affected UI-chat/UI-other test type projects and core lint Passed after fixture migration
Pane bridge suite 3 tests passed before the final transcript dependency merge
Guest first-turn/model controls case Updated case passed once before the final transcript dependency merge; alternate case skipped
pnpm ui:build and strict performance Passed on final source: 339,632 B startup JS gzip, 7 JS requests, 1 CSS request / 38,786 B; chat boot 30 requests
Production Knip Passed on final source
Controller guard, formatting, diff check Passed
Independent P0–P2 review No actionable findings, including final owner contracts, fixture repair, and provider restoration
Same-runner base/head performance Final CI 38960070918 passed: startup 340,053 B gzip / 7 JS / 1 CSS; chat boot 1,653,791 → 1,652,806 B (−985 B), 31 → 30 requests
Full UI, retention, E2E, browser-extension, real-Gateway ci:full on this PR; final production-head CI 38952923970 passed all UI units, types, lint, performance and 8/9 UI E2E shards. Remaining failures are detailed below. A test-only diagnostic update gets fresh CI.

The first integrated lifecycle run caught a lost constructor session key: passing only the element selected another split pane's saved layout. Both existing regression cases passed after supplying explicit identity, and both pass in the final 26-test run. A separate audit preserved the old width behavior. Host tags, markup, and styles are unchanged.

Size And Idiom Census

Across 25 touched production files: 11,656 → 11,623 LOC (−33). Controller-pattern references 96 → 16; the remaining references are synchronous domain publication callbacks. createEffect 2 → 2; untrack 2 → 3 (one documented lifetime-stable runtime identity); native listeners 8 → 8. Literal DOM-query references 8 → 9 because the constructor's explicit query callback replaces the former bound host facade; it adds no query to the user flow.

The 50 changed paths include mechanical test adaptations and the generated boot manifest. The production cut removes the registry, decorators, facade, and duplicated lifecycle ownership without flattening the synchronous domain hierarchy or introducing another store.

CI Follow-through

The first full run exposed missed test-only consumers of the removed host lifecycle: obsolete performUpdate stubs, a commitRender spy, retained-presentation assertions against removed changed-property arguments, and a private probe adapter still looking up requestUpdate on the domain runtime. These now exercise the explicit owner operations; geometry retains its before-paint and render-count assertions. The fixture proxy also uses local mapped keys instead of reassigning parameters. Independent review of the repair found no actionable P0–P2 findings. No production behavior or production LOC changed in this repair.

The optional-hovercard cleanup was removed from this PR after full E2E found cold-upgrade regressions. The final code preserves the merge base’s LinkReaderHovercard component and bindings. Its existing optional-chunk failure remains a separately reproduced main issue, outside this lifecycle cutover.

Final production-head failure attribution and diagnostics

CI 38952923970 tested 0c7f095a708625c460e0863da9888327367ec859 merged into base 746a52a3618edfaf6890262ceaf23593b5470c7f (edf8bd35697cd840964dd134b79c7724ed5867dd).

  • Inherited optional hover: keeps title hints when the optional hover runtime cannot load also fails with the identical line-238 missing-link signature in scheduled main 38948575054. Original provider and bindings remain intact.
  • Inherited usage cleanup: keeps same-id owners separate with an empty current session leaves two Gateway work roots during browser cleanup; later variants cascade. The exact base reproduced expected 0/actual 2 at the same cleanup boundary. Its first cold-start case also timed out locally; that separate timeout is not claimed as the CI failure. This path visits /usage, not chat.
  • Unresolved collaborator occurrence: preserves reader intent through remote queue, stream, and persistence once left the writer's Stop button visible in reading-typed; both exact-base and production-head local runs subsequently passed all four modes. No missed-publication path was found in the independent lifecycle audit. Passing replays are not claimed as a fix or proof of inheritance. Ordinary PR CI omitted the raw protocol artifact needed to distinguish terminal delivery from stale state. The test-only follow-up now writes synthetic send IDs and terminal state/sequence metadata to logs before teardown, retaining all existing assertions. Its changed-file run passed all four modes, with typecheck, lint and independent review clean.

No production source changed in the diagnostic follow-up.

Landing evidence

Final run 38960070918 on d16011a1c0d45423bbb287fd232c7e9b5b375963 completed. Both real-Gateway shards (including collaborator scroll and usage), all UI unit shards, types/lint, performance, and the other eight UI E2E shards passed. The only failing test is the inherited optional-hover fallback named above; the aggregate CI gate is downstream of that one job. Native recovery uses the authorized inherited-failure exception and does not mark that failed check green.

Verified closeout

Merged as e4f73867c4eb39fd8b5e00bba23cd43ac96fb647. Verified reachable from main b8bea44d143f2af90ddb6f81cd0af517b4e6e2d8; reconstructing the merge from its actual final parent and the reviewed head yields the exact landed tree. Native recovery completed and posted its receipt. The final main census using the Solid checklist filters reports controller refs 231, effects 329, render effects 15, untrack 303, native listeners 547, and DOM-query lines 167. The checklist includes test-support files; excluding those leaves six non-chat production consumers of the type-only legacy host contract.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 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 16, 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-16T20:12:15.424300Z d16011a 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.

@steipete
steipete enabled auto-merge (squash) October 16, 2026 18:50
@steipete
steipete disabled auto-merge October 16, 2026 18:54
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR replaces chat’s simulated host lifecycle with a Solid-owned publication and commit lifecycle.

Example: Open /chat when the optional link-preview module cannot load.

  • Before: The pane imports the hovercard runtime eagerly, allowing its load failure to prevent chat mounting.
  • After: The pane uses the lazy provider boundary so chat can mount independently.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The direction and production ownership split are coherent, but confirmed test-cutover defects prevent a clean validation result.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; supplied validation and inspected CI exercise lifecycle harnesses, with no current-PR live artifact supplied.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Refactor · Worth it: Yes
User problem: No visible behavior change is intended; existing session switching, focus, reader position, and cleanup must remain intact.
Reason: The maintainer-authored direction removes a transitional lifecycle after its consumers have moved toward explicit owners.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep open: this maintainer-directed refactor is useful, but the lifecycle cutover leaves test consumers broken.

Priority: P3
Reviewed head: ffc12ffecf621f4c7419fbd60a497e1a3a0fe65c

Before merge

  • Migrate the remaining consumers of retired runtime methods (P2) - Removing requestUpdate, performUpdate, and disconnectedCallback leaves existing consumers calling absent methods. Exact-head CI confirms failures in control-ui-pane-runtime.test.ts and chat-history-warm-startup.test.ts; the browser adapter also still forwards requestUpdate, causing chat-composer-catalog.e2e.test.ts to throw before its assertions. The retained-presentation test additionally expects arguments that invalidate no longer carries. Migrate these consumers and assertions to the new owner contracts without restoring the production host facade.
  • Move the geometry probe onto the actual commit boundary (P2) - The new commitRender getter returns a synthetic function, but getOwnPropertyDescriptor and has do not expose it, so the existing geometry browser test fails when vi.spyOn(host, "commitRender") runs. Exposing a descriptor alone would still leave the probe disconnected: production now calls pane.commitRender directly. Update the committed-phase measurement scenario to observe a real invoked boundary, such as chatState.commitRender, so it continues exercising a measurement during commit.

Findings

  • [P2] Migrate the remaining consumers of retired runtime methods — ui/src/pages/chat/chat-pane-state-owner.ts:88-94
  • [P2] Move the geometry probe onto the actual commit boundary — ui/src/pages/chat/chat-pane-runtime.test-support.ts:131-135
Agent review details

How this fits together

The Control UI chat pane combines synchronous session and resource owners with Solid rendering; bridge properties and domain notifications enter it, and rendered content, commit completion, and resource cleanup leave it.

flowchart TD
  A[Pane bridge properties] --> B[Synchronous chat runtime]
  C[Gateway and Board events] --> B
  B --> D[Solid pane lifecycle]
  D --> E[Parked render projection]
  E --> F[Chat DOM]
  F --> G[Commit effects and completion]
Loading

Technical review

Best possible solution:

Complete the test-consumer cutover while keeping publication in Solid and synchronous session resources in their existing owners.

Do we have a high-confidence way to reproduce the issue?

No current-main user bug is claimed; exact-head CI annotations independently confirm the introduced test-consumer failures.

Is this the best way to solve the issue?

The ownership split follows the established Solid migration direction, but its test callers must migrate with the removed host methods.

Full review comments:

  • [P2] Migrate the remaining consumers of retired runtime methods — ui/src/pages/chat/chat-pane-state-owner.ts:88-94
    Removing requestUpdate, performUpdate, and disconnectedCallback leaves existing consumers calling absent methods. Exact-head CI confirms failures in control-ui-pane-runtime.test.ts and chat-history-warm-startup.test.ts; the browser adapter also still forwards requestUpdate, causing chat-composer-catalog.e2e.test.ts to throw before its assertions. The retained-presentation test additionally expects arguments that invalidate no longer carries. Migrate these consumers and assertions to the new owner contracts without restoring the production host facade.
    Confidence: 1
  • [P2] Move the geometry probe onto the actual commit boundary — ui/src/pages/chat/chat-pane-runtime.test-support.ts:131-135
    The new commitRender getter returns a synthetic function, but getOwnPropertyDescriptor and has do not expose it, so the existing geometry browser test fails when vi.spyOn(host, "commitRender") runs. Exposing a descriptor alone would still leave the probe disconnected: production now calls pane.commitRender directly. Update the committed-phase measurement scenario to observe a real invoked boundary, such as chatState.commitRender, so it continues exercising a measurement during commit.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against fdc6a76b835c.

Provenance checked

  • Retained chat host adapter changes intended behavior with a stated reason (5dd456a: The retained-chat Solid migration preserved synchronous domain owners behind a transitional host adapter.)
  • Synchronous chat-state lifecycle keeps the original intent (6385bae: The state-owner migration retained persistence, attachment custody, cancellation, commit completion, and diagnostic identity while leaving other host consumers in place.)
  • Shared subscription infrastructure keeps the original intent (fdac1bc: The subscription migration removed Lit types while preserving synchronous source replacement and publication ordering.)
  • Pane-scoped link readers keeps the original intent (8e95a76: Preview and detail reads need the originating pane session while authorization remains with the receiving Gateway method.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test ui/src/test-helpers/control-ui-pane-runtime.test.ts ui/src/pages/chat/chat-history-warm-startup.test.ts ui/src/pages/chat/chat-pane-retained-presentation.test.ts --maxWorkers=1
  • pnpm test ui/src/pages/chat/components/chat-transcript-geometry-updates.browser.test.tsx --maxWorkers=1
  • pnpm test:ui:e2e ui/src/e2e/chat-composer-catalog.e2e.test.ts --maxWorkers=1
  • pnpm tsgo:test:ui
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit e841ac7 adds ui/src/pages/chat/chat-pane-runtime-view.tsx:18 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e841ac7c592b; files: ui/src/pages/chat/chat-pane-runtime-view.tsx)
  • Galin Iliev: Raw commit 8e95a76 adds ui/src/pages/chat/chat-pane-runtime-view.tsx:121 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 8e95a76d9174; files: ui/src/pages/chat/chat-pane-runtime-view.tsx)

PR surface

Source -30, Tests +80. Total +50 across 46 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 26 401 431 -30
Tests 20 128 48 +80
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 46 529 479 +50

Labels

Label changes:

  • add P3: The item is an internal lifecycle refactor with no established current-main user outage.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: The item is an internal lifecycle refactor with no established current-main user outage.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 16, 2026, 2:54 PM ET / 18:54 UTC.

@steipete
steipete merged commit e4f7386 into main Oct 16, 2026
114 of 118 checks passed
@steipete
steipete deleted the solid2/w-idiom3-pane-owner branch October 16, 2026 20:50
@steipete

Copy link
Copy Markdown
Contributor Author

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

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
* refactor(ui): own chat pane publication in Solid

* test(ui): adapt pane lifecycle fixtures to owner methods

* refactor(ui): preserve the existing chat preview provider

* test(ui): retain collaborator terminal diagnostics
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. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant