Repository navigation
refactor(ui): own Models rendering with Solid factories - #173902
Conversation
Remove the page controller and host revision adapters while keeping request, mutation, cancellation, and profile-order authority synchronous. Share owner-scoped login presentation across Models, Model Setup, MCP, and Plugins. Retire active sign-in work without publishing during teardown, and exercise public renderer callbacks and owner events in tests.
…models # Conflicts: # ui/src/pages/model-providers/model-providers-controller.ts
|
🦞👀 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 changes before merge. What this changesThis PR replaces Models rendering controllers with Solid factories and migrates shared sign-in presentation across Models, Model Setup, MCP, and Plugins. Example: Open MCP settings in a development build.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: the maintainer-directed refactor is useful, but the new shared sign-in signals introduce an MCP initialization error that matches failing CI. Priority: P2 Before merge
Findings
Agent review detailsHow this fits togetherControl UI page factories consume Gateway and configuration owners, render settings and sign-in dialogs, and delegate authentication and cancellation to the existing wizard runner. flowchart TD
A[Browser settings] --> B[Models and Model Setup]
A --> C[MCP and Plugins]
B --> D[Solid sign-in factory]
C --> D
D --> E[Wizard runner]
E --> F[Gateway authentication owners]
Technical reviewBest possible solution: Retain the factory cutover and move MCP initialization resets into an imperative lifecycle phase where the new presentation signals can be written safely. Do we have a high-confidence way to reproduce the issue? The initial MCP render-effect reset reaches the new signal setters synchronously, and exact-head CI reports the matching runtime error; no target code was executed during this review. Is this the best way to solve the issue? Owner-scoped factories fit the repository’s Solid migration and preserve the existing domain owners, but the MCP caller must adopt the new presentation lifecycle correctly. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2e62f4d9d7d5. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource -60, Tests +173. Total +113 across 29 files. Added test files: 0. View PR surface stats
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 16, 2026, 2:32 AM ET / 06:32 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
) * refactor(ui): own Models rendering with Solid factories Remove the page controller and host revision adapters while keeping request, mutation, cancellation, and profile-order authority synchronous. Share owner-scoped login presentation across Models, Model Setup, MCP, and Plugins. Retire active sign-in work without publishing during teardown, and exercise public renderer callbacks and owner events in tests. * fix(ui): settle Models presentation outside render
What Problem This Solves
Models already rendered in Solid but still used Lit controller hosts and manual revision invalidation. Replace those rendering adapters with owner-scoped factories, including login, discovery, installed agents, profile actions, and the shared sign-in presentation. Remove the obsolete page controller. Routes, tags, selectors, domain authority, cancellation, focus restoration, and lazy loading retain their contracts.
User Impact
No intended user-visible behavior change or migration.
Why This Change Was Made
The shared sign-in factory owns presentation signals and cleanup. Models, Model Setup, MCP cards, and Plugins adopt it together; disposing an owner retires pending work without resetting live presentation. A public regression covers abort, exact-session cancellation, and ignored late completion after unmount. Account-usage children register refs with cleanup rather than being found by a page query. Provider search and Add Provider disclosure use local Solid signals. Request admission, epochs, credential/configuration drafts, and queues remain synchronous plain TypeScript: dispatch captures them immediately, and completion clears only the same draft. Same-provider revalidation preserves edited search. The synchronous publication projection is retained for those domain facts, not local interaction state.
Evidence
pnpm tsgo:uiafter CI repairpages/chat/chat-view.tsx:16: unusedLitContent; base/head blob is identicalscripts/lib/check-limits.mtsandscripts/run-oxlint.mts; no suppression/baseline changeComparable build/visual base:
3dc6e49c07fb138c0029a411c1745974f23d144c. Reviewed head includes the expected awaitable Usage activation callback adjustment from main. Full UI, browser-extension, and real-Gateway proof is requested throughci:full. No local full suite or E2E battery was run.Size and idiom metrics
Counts cover touched production files (line matching for idiom metrics; controller metric excludes
AbortController).createEffectuntrackaddEventListenerProduction shrinks by 61 lines. Remaining broad controller references are in coupled legacy Plugins code reserved for its own lane. Actual effect calls are 4 → 9, while render effects are 1 → 0. Added effects retire agent scopes, hand off DOM focus, dispatch pending transport work, subscribe to the client-scoped model catalog, and retire MCP sign-in when transport hello changes. Retained route/setup effects synchronize route authority and external subscriptions; derived rendering state uses memos. Actual Models and Model Setup host/controller/requestUpdate lifecycle references are zero. The broad count includes legacy Plugins names; actual remaining lifecycle-pattern lines are 11, all in the coupled Plugins path reserved for its cutover.
Screenshots
Synthetic provider/accounts fixtures only. Each pair retains the existing layout; differences are limited to the build footer.
Models providers — before
Models providers — after
Sign-in account picker — before
Sign-in account picker — after
Active sign-in — before
Active sign-in — after
Installed-agent wizard — before
Installed-agent wizard — after
CI repair
The first full run (38860115181) exposed a real MCP render-phase reset: shared wizard presentation now uses signals, so resetting it from
createRenderEffectcaused owned-scope writes. Transport reset now runs in the apply phase of a split effect, preserving initiating-client cancellation and silent disposal. The two reconnect test migrations had introduced credential-free provider rows that the existing model-card policy deliberately hides; OAuth-backed fixtures retain visible fresh/retired assertions. Those failures are repaired and locally proven, not classified as inherited. The first run also reported unchanged ChatLitContentlint/types failures and dashboard, New Session, and sidebar E2E failures. The replacement run passes all of those jobs except the two dashboard cases documented below.Provider search — before
Provider search — after
API-key disclosure — before
API-key disclosure — after
Remaining CI attribution
Full PR run 38865525262 tested
4c8c88fad45b22dc5ba26160f28d6797b4950303, whose ordered parents are maincbfea5efc8bbac7580306ef928a56426b10faaf0and reviewed headfb17af354fc0f0679e0200373ee8a6c2a4dd256d. The actual main-parent-to-tested-merge diff contains exactly these 29 intended files. The only failed non-aggregate job ischecks-ui-e2e (1/9)(116857759901):dashboard fullscreen modes > makes dashboard main and restores chat after focus: the border remains 0px instead of 1px after Restore split, atdashboard-fullscreen.e2e.test.ts:584.website dashboards > runs a website with its own storage and refresh, preserving it through dashboard focus: the retained iframe's Status note textbox times out after mobile Restore split, atdashboard-website.e2e.test.ts:185.The dashboard, shell, chat, styles, fixtures, and relevant lazy route owners are byte-identical between the actual CI main parent and tested merge. Neither flow mounts Models, Model Setup, Plugins, or MCP settings; the website's Agents link visits
/agents(agents-home). The changed MCP/shared sign-in consumers are explicitly accounted for and remain behind those settings flows. They are not claimed unchanged.The latest scheduled main run (38863277510 at
6effd9dbb0e46ed95dea5af23981b90df1cecb67) also has this shard red, but its bounded log download failed with a peer-cancelled stream. This is therefore source-unrelated attribution, not a claim of signature-confirmed same-test inheritance or a proven flake fix. The documented native admin route is used under the migration's explicit standing authorization. Failed CI remains failed; security and review gates remain enforced.