Repository navigation
refactor(ui): split oversized page responsibilities - #180868
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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR extracts model-catalog, preference, session-command, and session-menu responsibilities from oversized Control UI page modules. Example: Reset an overridden appearance theme to the server default.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: the maintainer-approved extraction preserves existing ownership contracts, and review found no actionable correctness or security defect. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherControl UI page owners translate routes, Gateway snapshots, and user actions into view properties and operations on existing catalog, preference, and session capabilities. flowchart TD
A[Routes and user actions] --> B[Page coordination]
B --> C[Catalog and preference presenters]
B --> D[Session commands and menu]
C --> E[Existing domain owners]
D --> E
E --> F[Gateway and preference storage]
Technical reviewBest possible solution: Retain the focused extraction with page-owned scope authority and existing domain owners, subject to the ordinary exact-head CI gates. Do we have a high-confidence way to reproduce the issue? This PR addresses oversized modules rather than a reported runtime bug; source comparison confirms the responsibility extraction and suppression removal. Is this the best way to solve the issue? The extraction follows existing responsibility boundaries, retains synchronous state and scope ownership, and removes the replaced inline implementations without introducing competing storage or policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e986481fc31e. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +193, Other -4. Total +189 across 8 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 Reviewed October 22, 2026, 2:30 PM ET / 18:30 UTC. |
|
Merged via explicitly authorized admin squash with prior CI and scoped validation.
|
* refactor(ui): split oversized page responsibilities * test(ui): allow Inspector waits to outlive CLI defaults
What Problem This Solves
The Agents, Settings, and Sessions page owners still combined unrelated responsibilities beyond the production max-lines budget. The baseline also retained three paths that had already moved or shrunk.
User Impact
No user-visible behavior changes. Routes, markup, styles, request timing, confirmation flows, and lazy boundaries stay the same.
Why This Change Was Made
Agents now delegates its selected-agent model-catalog receipt and suspension recovery to a dedicated owner. Settings delegates preference provenance, resets, and preference commands to one presenter over the existing canonical preference owners. Sessions keeps roster/route coordination while separate command and menu owners retain mutation settlement and menu lifetime respectively. The page still owns connection epochs and selected/deep-linked state; the extracted owners consume that authority.
Remove all four production
ui/srcentries fromconfig/max-lines-baseline.txt. Config and Sessions also lose the suppressions in their current state modules. Test-file baseline entries remain out of scope.Raw production LOC: 2,900 → 3,093 (+193). The growth is explicit host/state types, imports, and factory interfaces at the responsibility boundaries; the command algorithms and authority checks remain intact. Every resulting file is below the 700-line lint limit, which excludes blank lines and comments. The original production refactor changed no tests; the later CI fixture correction is described below.
Evidence
Acceptance rule: same-host builds with identical build identity; preserve startup and immediate
/chatand/newraw bytes and request counts; gzip deltas must stay within the existing 64 B build variance. No new effects/listeners/queries/owner APIs.--maxWorkers=1agents-model-catalog-recovery,sessions-page.command-outcomes, andconfig-pagepnpm tsgo:uipnpm check:control-ui-controllerschat-message.test.tsx, reproduced on basepnpm ui:buildbase and headui:check-performance --base-dist …pnpm deadcode:knippassed; full export audit reports existing exports outside this change, none in the touched ownersAll three JS surfaces have identical raw bytes. Comparison base:
0e89b35a8a6; Node 26.12.1, same installed Vite/Pako toolchain, fixed build identity. Renderers and CSS are unchanged, so there is no visual delta to capture.Current CI attribution
Initial run 39829729498 passed every job except real-Gateway 2/2 and its aggregate gate. The sole failure waited for the Model Providers catalog-banner Retry button; the exact same case failed on that run’s main parent
071ce2302f9. Main’s #174904 had moved failed discovery feedback to provider rows while retaining header Refresh.Reviewed refactor head
8670e09586c196bc37de99fa4dfc2d65aade5a84integrates main, including #180742’s corrected recovery test. The eight-file refactor patch is byte-identical to the reviewed original patch (SHA-256883bfb9bb366ceabab95a20853a02d363714817c4587eed1728ff779f6a79ff1); UI typecheck passes again. The 44 focused tests and paired local build measurements above apply to that unchanged patch. Current-head broad CI is required and will supply the final integrated proof.Follow-up CI fixture repair
Replacement CI 39836334349 passes the prior catalog case. Its only failing test is
Run Inspector with real browser pairing > pairs each Inspector page independently and retains identity across reload, during the initialagent.waitCLI call before any browser page opens.The fixture requests a 30-second server wait but gives the CLI only its default 10-second transport deadline and 30-second outer process deadline. The test-only repair gives that wait 40-second transport / 50-second process limits, keeps every other call at its existing defaults, and includes JSON stdout in failed-exit diagnostics. The actual server wait and all Inspector assertions remain unchanged. This is a diagnosed fixture deadline mismatch; the old CI omitted the JSON error body, so its exact runtime error is not claimed proven.
Current head
8ca64bf79404d670c8000f405b04e39e2f856fd5adds only the Inspector fixture correction above. Its targeted type/lint/format checks and independent P0–P2 review pass. Production LOC and boot measurements remain unchanged; the fixture grows by three lines. Fresh full CI is required for this exact head.The unchanged Inspector test passed once on exact base
df27c0c72d668515f397c2251914c1e9c0fc8f46after rebuilding its private-QA runtime. This does not reproduce or waive the intermittent CI failure. The corrected fixture also passed once against that same rebuilt base runtime (fixture-only patch; 53.11 seconds including transforms). Exact-head full CI remains the merge gate.Final exact-head CI
Full CI run 39839972853 passed on
8ca64bf79404d670c8000f405b04e39e2f856fd5, including every full UI, browser E2E, and real-Gateway shard. The confirmed-cancelled auto request will be completed through native replacement recovery using this successful same-head evidence, with an empty CI-to-prepared delta. No inherited-failure exception is needed.