Repository navigation
refactor(ui): own shell lifetimes and native host references - #176574
Conversation
|
🦞👀 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. |
There was a problem hiding this comment.
💡 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 { |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +175, Tests +301. Total +476 across 39 files. Added test files: 0. View PR surface stats
Review metrics
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 HistoryReview history (1 earlier review cycle)
Reviewed October 19, 2026, 12:11 AM ET / 04:11 UTC (Revision 2). |
2aa4ac9 to
0980cdd
Compare
|
The earlier import-cycle and bootstrap-fixture findings are resolved. Full CI 39192624648 on The production LOC tradeoff remains documented; a net-positive count alone is not a behavioral P1 finding. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
0980cdd to
63898b3
Compare
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…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
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 formatscontrol-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.tskeeps main's fixture lifecycle while receiving the owner-supplied activity query;control-ui-favicon.browser.test.tskeeps main's flattened suite, cleanup, and added coverage while receiving the new query argument; the managed-image test keeps main'sChatStateimport and wait for final history reconciliation alongside the presentation diagnostics. No main commits are included in the authored diff.pnpm tsgo:ui63898b33423a, exit 0 with no findings; no new ignores50c377ed37f7: 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.ci:full63898b33423a: 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, mergebf2848f14efd, against actual based8ff48313fcb; 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 newe28bad4c02d6candidate.finds a grouped spawned conversation beyond the roster and treats a full result page as successifRowsRevision: ""request on untouchedd8ff48313fcbrefetches instead of showing a row excluded by configured-agent filteringallAgentsQuerycontainment failure on that basekeeps the Sessions page query stable when the startup roster completesexplains the utility model with accessible pointer, keyboard, and narrow-layout behaviorci-node-test-plan.test.ts:3285ci-test-timings.mtson that basecompletionDeliveryRetryDelaysMsinnative-subagent-monitor.parent-retention.test.ts:37on that baseThe managed-image case passed on old head
0980cddbbe40in 11,343 ms and the preceding head in 11,923 ms. An older failure at2c2f19d6d814happened 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
a9e5f4e3b7b2and head2aa4ac9ec404, 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):After (
2aa4ac9ec404):Refactor measurements
The authored diff against exact base
e28bad4c02d62da562d935a81c1e65856123b498changes 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.createEffectcreateRenderEffectuntrackflush/ rendering controllerThe +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, andlib/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) andControl 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, heade3cc361b27cb48b494708891fee8df83e6811946: PR reader job 117906667153 has the same 120,000 ms timeout and readiness diagnostics; media job 117906667214 has the same null.messageaccess 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 base2a49c621e7f7e1dc8103f44b927c89726cfcf49dand the tested merge. The CI merge is50c377ed37f75548bb603920190a193238383c67.