Skip to content

refactor(ui): own shell lifetimes and native host references - #176574

Merged
steipete merged 7 commits into
mainfrom
solid2/w-zero-overlay-surfaces
Oct 19, 2026
Merged

steipete merged 7 commits into
mainfrom
solid2/w-zero-overlay-surfaces

Conversation

@steipete

@steipete steipete commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem and change

The shell and native conversation integration rediscover owned DOM and mirror runtime lifetimes through rendering effects. This change gives each application runtime one keyed shell lifetime and makes the existing presentation owner acknowledge committed state, including connection recovery and avatar feedback timers. Runtime replacement retires old lazy intent; disconnect settles outstanding waiters.

Mounted shell, outlet, composer, and debug-frame references come from their owners. Native navigation, favicon status, session-menu actions, and composer focus consume those references. The progress projection owns source changes, retains its store cache during same-store handoffs, and cannot reopen subscriptions after disposal. Tags, routes, selectors, keyboard behavior, and lazy boundaries stay intact.

The managed-image test retains exact order, dimensions, duplicate checks, and strict frame capture. It polls the existing six-entry order after capture while history reconciliation settles and records presentation/DOM-identity diagnostics on failure.

Rebase and current proof

Base: e28bad4c02d62da562d935a81c1e65856123b498. Pushed head: 63898b33423a305a27b575569f632b0627bd8458. The last commit only formats control-ui-favicon.browser.test.ts; the measured runtime diff is unchanged.

Six authored commits were replayed onto this base. Four are patch-identical; two include conflict reconciliation. The three resolved files preserve current main behavior: control-ui-favicon-status.test.ts keeps main's fixture lifecycle while receiving the owner-supplied activity query; control-ui-favicon.browser.test.ts keeps main's flattened suite, cleanup, and added coverage while receiving the new query argument; the managed-image test keeps main's ChatState import and wait for final history reconciliation alongside the presentation diagnostics. No main commits are included in the authored diff.

Check Result and scope
Rebased dependency install Pass, frozen lockfile; no dependency/version change
pnpm tsgo:ui Pass on rebased candidate, default repository compiler
Favicon unit and browser tests 15/15 pass across two files, one worker; 6.63 s test-run duration
E2E-chat test typecheck Pass with corrected repository config path. The first invocation used a nonexistent config path and failed before checking code (TS5058); it was not a product failure.
Current independent review Canonical formatting review exited 0, scoped-clean with no findings. Independent full rebase reconciliation review also reports no findings.
Current production Knip Pass on final pushed head 63898b33423a, exit 0 with no findings; no new ignores
Current CI performance Pass at merge 50c377ed37f7: startup 336,824 B gzip, 7 JS requests, CSS 38,500 B / 1 request. Chat 1,483,855 → 1,484,388 B; New 1,049,298 → 1,049,699 B. The CI log does not print paired base startup bytes.
Current ci:full Run 39203848798 completed on pushed head 63898b33423a: 42 passing jobs; Gateway1/Gateway2 and aggregate fail. Both failed test names and diagnostics also fail in latest completed scheduled main run 39205204421; qualified for the native inherited-failure route; CI remains failed.

Historical proof and remaining gaps

Full CI 39192624648 tested old head 0980cddbbe40, merge bf2848f14efd, against actual base d8ff48313fcb; it finished with 38 passing, 7 failing, and 24 skipped jobs. Six underlying failures were reproduced by exact name/diagnostic on that actual base; the seventh was the aggregate gate. That attribution remains useful history, but does not establish inheritance or pass status for the new e28bad4c02d6 candidate.

Historical failure Recorded old-base evidence
Command palette: finds a grouped spawned conversation beyond the roster and treats a full result page as success Same unexpected ifRowsRevision: "" request on untouched d8ff48313fcb
Session list: refetches instead of showing a row excluded by configured-agent filtering Same allAgentsQuery containment failure on that base
Session list: keeps the Sessions page query stable when the startup roster completes Same expected-query versus empty-list failure on that base
Models help: explains the utility model with accessible pointer, keyboard, and narrow-layout behavior Same stale tooltip-copy expectation on that base
Mock-export ratchet in ci-node-test-plan.test.ts:3285 Same missing mock export for ci-test-timings.mts on that base
Extension typecheck Same TS2353 for completionDeliveryRetryDelaysMs in native-subagent-monitor.parent-retention.test.ts:37 on that base
Chat boot gzip ceiling Old actual base 1,491,409 → tested merge 1,491,875 B, against 1,490,000 B

The managed-image case passed on old head 0980cddbbe40 in 11,343 ms and the preceding head in 11,923 ms. An older failure at 2c2f19d6d814 happened inside strict frame capture before the ordering assertion and remains unexplained intermittent behavior; it is neither claimed fixed nor inherited. One earlier bounded local head attempt failed during pairing, and a separate old-base attempt failed before the assistant bubble. Neither reached capture, so neither proves repair or inheritance. Current-head run 39203848798 passes the managed-image case in 13,746 ms. The earlier strict-capture failure remains a recorded intermittent gap; the current pass does not prove its cause repaired.

The earlier same-host production build comparison used exact base a9e5f4e3b7b2 and head 2aa4ac9ec404, Node 24.22.0, and matching build timestamp. Startup gzip was 338,157 → 338,159 B, with 7 JS requests and 38,500 B / 1 CSS request unchanged. Chat was 1,492,975 → 1,493,394 B; New was 1,050,926 → 1,051,251 B; both route caps already failed on that measured base. Those are historical measurements, not a fresh measurement of the rebased merge tree. No budget was changed.

Visual evidence

Historical exact-base/head synthetic captures at 1440 × 1000 are byte-identical. The composer keeps focus and its draft; the captures report no page error or message send. Both full images were inspected and contain only synthetic data. These images document the original runtime patch at the measured checkpoints; they are not represented as fresh screenshots of the rebased candidate.

Before (a9e5f4e3b7b2):

Before: focused shell and composer

After (2aa4ac9ec404):

After: focused shell and composer

Refactor measurements

The authored diff against exact base e28bad4c02d62da562d935a81c1e65856123b498 changes 39 files: 24 production and 15 test/support files, with 749 insertions / 273 deletions including the final formatting commit. Main's unrelated changes are excluded.

Metric across the 24 changed production files Base Candidate
createEffect 8 3
createRenderEffect 1 1
untrack 5 4
Direct event registrations 1 1
DOM queries, including typed calls 13 1
Owner capture/restoration 6 7
flush / rendering controller 0 / 0 0 / 0
Production LOC 7,245 7,420

The +175 production lines supply explicit lifecycle retirement, registered native references, and connection timer ownership while removing five effect-driven paths. The remaining query is the sidebar active-rail lookup (app-shell-chrome.ts:233), addressed by the separate navigation-reference follow-up. The listener is paired AbortSignal cancellation (native-session-menu.runtime.ts:34). The shell keeps two explicit initial prop snapshots (app-host.tsx:709,720). The coupled chat renderer and shared projection retain the other counted effects/snapshots: chat-pane-runtime-view.tsx:130,282, chat-pane.tsx:66, control-ui-session-summary.tsx:206, and lib/reactive/domain-keyed.ts:16,38. Owner restoration is recorded in the measurement artifact; it retains framework ownership for shell acknowledgements and existing child mounts. This focused PR is a wave-zero checkpoint, not completion of every survivor.

No Testbox or Crabbox lease was used. Changelog updates remain release-owned.

Current failing cases in run 39203848798 are Session PR readers through a real Gateway > keeps session PR and CI results with the current workspace and reader (120,000 ms timeout) and Control UI media transcript replay with a real Gateway > delivers PowerPoint and keeps persisted attachment failures replay-safe (null transcript event reader at line 138). Both exact names and diagnostics also fail on latest completed scheduled main run 39205204421, head e3cc361b27cb48b494708891fee8df83e6811946: PR reader job 117906667153 has the same 120,000 ms timeout and readiness diagnostics; media job 117906667214 has the same null .message access at line 138. The whole main run is completed. The prepared actual-base reproduction was not started because this supplies the required matching-name evidence. Both test blobs are unchanged between actual CI base 2a49c621e7f7e1dc8103f44b927c89726cfcf49d and the tested merge. The CI merge is 50c377ed37f75548bb603920190a193238383c67.

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

clawsweeper Bot commented Oct 18, 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 18, 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-19T05:23:08.625076Z 63898b3 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.

@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: aba3a46cdc

ℹ️ 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".


protected abstract afterCommit(): void;

private scheduleCommit(): void {

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.

P1 Badge Keep this Solid refactor net-negative

This behavior-preserving Solid refactor adds 261 and removes 117 production lines (+144 net across the 22 changed non-test files), while the scoped refactor checklist linked from ui/AGENTS.md requires net production LOC to go down. The added scheduling and host-reference machinery therefore leaves more lifecycle surface to maintain; simplify or split the change so the refactor is net-negative before landing.

AGENTS.md reference: ui/AGENTS.md:L3-L5

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Declining the net-negative request. The final change reports +149 production lines, removes three effects and twelve owned-DOM queries, and gives keyed shell lifetimes, committed-DOM acknowledgements, and native host references one owner each. The added code preserves retirement and pending-commit behavior; its tradeoff and proof are recorded in the PR body. Net-positive LOC alone does not establish a P1 behavioral defect, and no concrete defect is identified in this finding.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR gives each UI runtime an explicit shell lifetime and replaces DOM discovery with owner-held references.

Example: Replace the application runtime while the command palette is loading.

  • Before: One shell owner switches runtimes through an effect.
  • After: The previous shell retires its pending intent and a new shell owner mounts.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful ownership work with both prior findings resolved; evidence supports visual parity and focused lifecycle coverage, while red CI still requires native admission.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; inspected captures support built-shell parity, while lifecycle replacement and native actions have reported in-process coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Shell replacement, native focus, and lazy actions depend on rendering effects and rediscovered DOM lifetimes.
Reason: Maintainer direction is established, and the implementation continues the existing ownership migration while preserving user-facing contracts.

Merge readiness

✅ Ready for maintainer review

Keep open: this useful maintainer-directed refactor resolves both prior findings, and no new actionable defect was established; required CI remains red.

Priority: P3
Reviewed head: 0980cddbbe402b21f335aa394105fb3df50dee7f

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied captures demonstrate built-shell appearance and draft parity, but do not show runtime replacement or native actions; red-on-base execution of the added lifecycle regressions is not supplied.
Agent review details

How this fits together

The Control UI shell connects application and route state to rendered chat panes, browser chrome, lazy overlays, and native conversation commands.

flowchart TD
  Runtime[Application runtime] --> Shell[Keyed shell owner]
  Shell --> Presentation[Presentation commits and timers]
  Shell --> Registry[Registered host references]
  Registry --> Chat[Chat panes and composer]
  Registry --> Native[Native conversation actions]
  Presentation --> Chrome[Sidebar and browser chrome]
Loading

Technical review

Best possible solution:

Retain the existing-owner cutover and use the native inherited-failure route once every remaining failed check is accounted for.

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

This refactor establishes no separate current-main bug reproduction; source and supplied tests expose the lifecycle boundaries, and no target code was executed during review.

Is this the best way to solve the issue?

The change uses the existing shell presentation, route registry, composer state, and progress projection owners, with no concrete smaller replacement established.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Shell runtime lifetime keeps the original intent (7c06f39: The Solid shell migration preserved retained routes, drafts, lazy loading, and connection retirement.)
  • Registered shell and native hosts keeps the original intent (7310bf1: Replace cross-page DOM discovery with explicit host registration and leave further native-reference cutovers to focused follow-ups.)
  • Connection recovery feedback keeps the original intent (406772b: Expose connection state without layout shifts and retain brief recovery and avatar feedback.)
  • Progress source handoff keeps the original intent (3c53daf: Keep the synchronous progress store authoritative, preserve same-store caches, and retire hidden card lifetimes.)
  • Browser chrome keeps the original intent (3f1175b: Avoid repeated style reads while preserving theme, route, and responsive chrome updates.)
  • Native conversation actions keeps the original intent (3780784: Expose the web conversation to the native host with document-bound commands and owned navigation.)
  • Native update fallback keeps the original intent (3fc755e: Bind update confirmation and fallback to the original Gateway target and live authority.)
  • Pending debug overlay keeps the original intent (99bc045: Complete portable Solid rendering while retaining overlay actions and lazy loading.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +175, Tests +301. Total +476 across 39 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 24 365 190 +175
Tests 15 384 83 +301
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 39 749 273 +476

Review metrics

Metric Value Why it matters
Production versus test growth Production +365/-190; tests and support +384/-83 Production growth funds explicit retirement, commit settlement, host references, and feedback timers; test growth covers lifecycle boundaries and managed-image diagnostics.

Labels

Label changes:

  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • 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.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is behavior-preserving UI ownership cleanup without a demonstrated shipped user outage.
  • 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.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-18T22:55:05.096Z sha aba3a46cdcddf7d6410b61a4a6cd545991cce8f3 :: needs changes before merge. :: [P2] Move the shell contract out of the readiness adapter | [P2] Update the bootstrap chrome test for explicit shell publication

Reviewed October 19, 2026, 12:11 AM ET / 04:11 UTC (Revision 2).

@steipete
steipete force-pushed the solid2/w-zero-overlay-surfaces branch 5 times, most recently from 2aa4ac9 to 0980cdd Compare October 19, 2026 03:00
@steipete

Copy link
Copy Markdown
Contributor Author

The earlier import-cycle and bootstrap-fixture findings are resolved. MountedApplicationShell lives in the leaf context-types.ts contract, and the bootstrap fixture publishes committed shell state through the new owner contract. The bootstrap tests pass in current CI; the recorded architecture check reports zero cycles.

Full CI 39192624648 on 0980cddbbe40 is fully attributed in the PR body: all six underlying failed jobs have matching exact-name/diagnostic proof on scheduled main or the actual CI base. The managed-image case passes on this head in 11.343 seconds. CI remains explicitly failed, with the documented inherited-failure route requested.

The production LOC tradeoff remains documented; a net-positive count alone is not a behavioral P1 finding.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. 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 19, 2026
@steipete
steipete force-pushed the solid2/w-zero-overlay-surfaces branch from 0980cdd to 63898b3 Compare October 19, 2026 05:18
@steipete
steipete merged commit 9548737 into main Oct 19, 2026
110 of 118 checks passed
@steipete
steipete deleted the solid2/w-zero-overlay-surfaces branch October 19, 2026 06:20
@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 20, 2026
…w#176574)

* refactor(ui): own shell lifetimes and native host references

* fix(ui): complete shell host registration cutover

* test(ui): await settled geometry and managed images

* refactor(ui): own shell connection feedback in presentation

* test(ui): retain managed image presentation diagnostics

* test(ui): use complete contexts for native shell commits

* style(ui): format rebased favicon fixture
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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL 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