Skip to content

refactor(ui): use native lifetimes for app setup - #179375

Merged
steipete merged 4 commits into
mainfrom
solid2/w-s2-app-owners
Oct 21, 2026
Merged

steipete merged 4 commits into
mainfrom
solid2/w-s2-app-owners

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Automation readiness and shell connection setup capture and restore Solid owners manually. Mount the existing lazy readiness factory under a keyed Show, and connect plain domain-owner subscriptions through the shell's native onSettled lifetime. This removes a nested root and five owner-API calls while preserving synchronous connection handling, disposal, and the first-read lazy readiness boundary.

The existing translation singleton exposes subscribeI18n so the plain shell owner still observes locale changes and lazy English catalog registration. No new owner abstraction, dependency, tag, route, or lazy boundary is introduced.

ShellPresentation retains its original detached onSettled registration. Deferring that registration to a microtask let the sidebar's commit receipt settle before shell property publication and lost keyboard focus after reordering. The unchanged sidebar E2E test passes the base, fails the initial candidate, and passes the repaired candidate. The original scheduling and both bare-flush() test expectations are restored; this one owner-API survivor has an observed ordering contract.

Evidence

Current head: d7725adf93bd761ede50b8bbfd3970dbe8da99b5. The final commit only removes retired heartbeat fields from four Gateway fixtures.

Refreshed build proof compares integrated main 60361b195afff010fb76c111b3b49d5353ab8fff with head 2a98a03be65a6c7b129b414f8e133ef7c4b20cfb. Current-main integration is conflict-free; the seven-file cutover and its production/test blobs are unchanged. Fresh typecheck, production Knip, and independent P0–P2 review passed on this integrated production candidate. The subsequent fixture-only correction reuses those unchanged-production results and paired builds; formatting and a fresh independent P0–P2 correction review pass for all four corrected fixtures. Replacement-head CI tests their startup against the current strict schema.

Proof Result
Frozen install Passed
pnpm tsgo:ui (tsrs) Passed on integrated candidate
Focused lint and controller guard Prior pass retained for unchanged cutover blobs; no ratchet waiver
Readiness tests 15 passed; source unchanged by correction
Shell lifetime cases Replay/disconnect and disposed-caller receipt cases passed with original assertions
Sidebar keyboard reorder E2E Base passed → initial candidate failed → repaired build passed
Paired production builds Passed, fixed build identity and cache disabled
Strict performance Same two absolute-cap failures; head smaller on both surfaces
Synthetic browser capture Original corrected build passed; both screenshot pairs byte-identical, retained unchanged-cutover evidence
Production Knip Passed on integrated candidate
Independent review Fresh integrated candidate scoped clean (P0–P2); prior cutover and full-context correction also clean

The focused sidebar E2E uses the original test and fixtures with retained base/head builds served through the normal shared-preview helper, Chromium preflight and isolated forks. Node is used for this Playwright configuration; unit tests use the pinned Bun runtime. No local full suite or parity run was used. ci:full is enabled for every UI unit, Control UI E2E, browser-extension, and real-Gateway shard.

Built surface Base gzip Head gzip Delta Requests base → head
Startup JS 331,341 B 331,315 B -26 B 8 → 8
Startup CSS 40,439 B 40,439 B 0 B 1 → 1
Chat boot JS 1,501,009 B 1,500,968 B -41 B 25 → 25
New Session boot JS 1,018,375 B 1,018,303 B -72 B 20 → 20

Both strict checks exit 1 for startup JS (325,476 B cap) and Chat boot JS (1,500,000 B cap). The integrated head is smaller by 26 B and 41 B respectively; no growth is being attributed to an inherited budget violation, and the absolute check is not claimed green. No new violations or warnings. All 42 locale assets retain their raw sizes; gzip differences range from -3 B to +3 B. Both builds ran sequentially in the same checkout with cache disabled and identical build identity metadata; the PR branch was restored.

Wave-ten checklist in final touched production Before After
Conditional native handler selection 0 0
Component-level cleanup 0 0
Manual async read presentation 1 1
Manual saving mutation presentation 0 0
Manual renderer loaders 0 0
Copied local collection signals 0 0
Manual createComponent calls 0 0
Throw-only context wrappers 0 0
Sibling loading coordination candidates 0 0
Owner API calls outside island mounts 5 0

Removed in touched files: createRoot 1→0, getOwner 2→0, runWithOwner 2→0. Across the three audited app-owner modules, owner-API calls are 6→1 because commit settlement remains unchanged. One unchanged onCleanup remains inside the palette custody primitive, and two unchanged untrack calls capture lifetime-stable shell props. The focus-document result remains an imperative bootstrap/route outcome: its shared loader records guarded navigation handoff, the wrapper conditionally canonicalizes the URL, and readiness must observe the result without suspending.

Final touched production LOC: 1,810 → 1,809. Test LOC: 2,286 → 2,292. Eleven files, +56/−55. The only cross-scope interface change is the existing translation singleton's subscription export.

Initial CI run 39585314259 exposed the repaired sidebar regression. Corrected run 39592189078, on 0f9a94c, passed every UI unit and Control UI E2E shard. Its sole non-aggregate failure was 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: the first Telegram reply timed out at line 308, before opening the browser UI. Scheduled main 39592709539 passed that case. The failure remains unexplained and is not claimed inherited or fixed. The integrated run 39603337399 passed that case and every UI unit and Control UI E2E shard; this is a passing replay, not a diagnosed fix. Its current-main merge exposed four fresh-fixture startup failures because agents.defaults.heartbeat was retired by #179387. The agent-file, profile-page, command-palette search, and session-diff folding fixtures now omit that obsolete field. Their explicit agent owners, existing cron setting, and browser assertions remain unchanged. Fresh isolated state provisions no automation jobs on startup, so no replacement suppression flag is needed. The correction passes replacement-head CI 39610696760: all 3 UI unit shards,all 9 Control UI E2E shards, and both real-Gateway shards. The four corrected fixture assertion names explicitly pass; no inherited claim is made for those failures. The only remaining non-aggregate failure is control-ui-performance (startup and Chat absolute caps); the native inherited-failure route uses the paired base/head evidence above. CI separately reports Chat 1,500,382→1,500,272 B(-110),New Session 1,018,356→1,018,294 B(-62),startup 331,160 B,and unchanged startup CSS 40,439 B/one request.

The original bounded capture, retained from before current-main integration because the affected cutover blobs are unchanged, uses synthetic Demo data, a fixed date, and a 1174×900 viewport. It verifies New Session renders before readiness is requested, the first getter returns undefined, exactly one readiness chunk loads, navigation reaches Appearance through the real hook, and a simulated Gateway reconnect retains the connected shell. Both sides report no page errors. All full-frame captures were inspected; the corrected images match the published attachments byte for byte.

State Before After
New Session New Session before New Session after
Appearance Appearance before Appearance after

@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-21T13:51:35.629894Z d7725ad 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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. 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 replaces manual Solid owner restoration with native readiness, subscription, and settlement lifetimes.

Example: Open New Session, then navigate to Appearance through automation readiness.

  • Before: Both pages render while readiness and shell setup restore captured Solid owners.
  • After: The same pages render with readiness owned by keyed Show and shell subscriptions explicitly cleaned up.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-consistent refactor with inspected browser evidence and useful lifetime coverage; CI completion remains separate from patch correctness.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): The pinned-head body records built-browser lazy readiness, navigation, and simulated reconnect; inspected New Session and Appearance screenshots corroborate rendered parity, with focused lifetime tests supporting disposal and commit settlement.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No user-visible malfunction is claimed; the goal is to preserve shell behavior with simpler lifecycle ownership.
Reason: The maintainer-authored direction aligns with the established Solid migration and removes manual ownership without changing settings, dependencies, or public contracts.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-directed refactor removes manual Solid owner management while preserving the existing lifecycle contracts; no actionable correctness or security defect was found.

Priority: P3
Reviewed head: cb343e8ded770d84474735321c473fd3031093a5

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI application root connects Gateway, router, theme, and translation state to the shell, rendered pages, and the lazy browser automation readiness hook.

flowchart TD
  A[Gateway and domain owners] --> B[Shell subscriptions]
  B --> C[Shell presentation]
  C --> D[Rendered Control UI]
  E[Automation getter] --> F[Keyed readiness lifetime]
  F --> C
  F --> D
Loading

Technical review

Best possible solution:

Retain the focused refactor with lazy readiness, synchronous subscription cleanup, and caller-independent commit receipts intact.

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

This is a behavior-preserving refactor rather than a reported bug; source and supplied evidence were inspected without executing target code.

Is this the best way to solve the issue?

The change uses existing lifecycle and domain owners, removes the replaced restoration paths, and retains the prior ordering and disposal safeguards without additional machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Lazy readiness and shell connection ownership changes intended behavior with a stated reason (7c06f39: The Solid shell migration restored owners so asynchronously installed readiness and connection-created projections had disposal lifetimes.)
  • Shell domain subscriptions changes intended behavior with a stated reason (fc9f6f7: Reuse owner projections while retaining synchronous application subscriptions and immediate lifecycle retirement.)
  • Commit settlement keeps the original intent (9548737: A shell commit must settle even when its invalidating router computation retires before settlement.)
  • Owner-call baselines keeps the original intent (be00d75: Shrink-only baselines prevent growth in manual Solid owner operations.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 9548737 adds ui/src/app/app-shell-presentation.ts:154 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 95487377bde8; files: ui/src/app/app-shell-presentation.ts)

PR surface

Source -1, Tests +11, Other -5. Total +5 across 9 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 49 50 -1
Tests 2 11 0 +11
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 0 5 -5
Total 9 60 55 +5

Labels

Label changes:

  • add P3: This is focused lifecycle cleanup with no intended user-visible behavior change or demonstrated urgent failure.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is focused lifecycle cleanup with no intended user-visible behavior change or demonstrated urgent failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • 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.

Reviewed October 21, 2026, 6:48 AM ET / 10:48 UTC.

Validate the focused app-owner cutover in the current shared context. The prior initial Telegram fixture reply timeout remains unexplained; no inherited-failure claim is made.
@steipete
steipete merged commit f4f4dec into main Oct 21, 2026
96 of 99 checks passed
@steipete
steipete deleted the solid2/w-s2-app-owners branch October 21, 2026 14: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 22, 2026
* refactor(ui): use native lifetimes for app setup

* fix(ui): preserve synchronous shell settlement

* test(ui): remove retired heartbeat fixture config
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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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