Skip to content

refactor(ui): own Models rendering with Solid factories - #173902

Merged
steipete merged 3 commits into
mainfrom
solid2/w-idiom-pages-models
Oct 16, 2026
Merged

steipete merged 3 commits into
mainfrom
solid2/w-idiom-pages-models

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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

Check Result
Models login / page / ordering 21 / 34 / 10 cases passed before the final test-interface migration
Shared sign-in disposal regression Passed once after the final cleanup change (1 passed, 4 filtered out)
Production and UI-pages test types Passed after cleanup, before final main integration
Final pnpm tsgo:ui after CI repair Fails only on untouched pages/chat/chat-view.tsx:16: unused LitContent; base/head blob is identical
Focused lint Two local max-lines errors: Models 742 and Setup 740, cap 700. GitHub Actions makes these limits advisory via scripts/lib/check-limits.mts and scripts/run-oxlint.mts; no suppression/baseline change
Formatting / diff whitespace Passed
Final production Knip Passed
Independent final cleanup and CI repair reviews Both scoped-clean, no actionable P0–P2 findings
Final base and head UI builds Passed
Strict startup performance Passed on both; 347,504 → 347,491 B gzip (−13 B, within 64 B build variance)
Startup requests 8 JS / 1 CSS on both; CSS 38,777 B gzip
Synthetic visual captures Four original states plus final provider search and API-key disclosure on each side; inspected, no page or console errors
CI-owned repair proof 41 cases passed across Gateway source replacement, MCP server card, and MCP settings integration; no unhandled errors
Replacement full PR CI Run 38865525262, attempt 1: 44 successful jobs, 24 deliberately skipped, one unrelated dashboard shard and downstream gate failed; all UI unit, static, browser-extension and real-Gateway jobs passed

Comparable 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 through ci: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).

Metric Before After
Production LOC 7,012 6,951
Controller / host lifecycle / requestUpdate references 166 44
createEffect 6 15
untrack 6 3
addEventListener 6 6
Test LOC 5,871 6,034

Production 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 before

Models providers — after

Models providers after

Sign-in account picker — before

Sign-in account picker before

Sign-in account picker — after

Sign-in account picker after

Active sign-in — before

Active sign-in before

Active sign-in — after

Active sign-in after

Installed-agent wizard — before

Installed-agent wizard before

Installed-agent wizard — after

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 createRenderEffect caused 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 Chat LitContent lint/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 before

Provider search — after

Provider search after

API-key disclosure — before

API-key disclosure before

API-key disclosure — after

API-key disclosure after

Remaining CI attribution

Full PR run 38865525262 tested 4c8c88fad45b22dc5ba26160f28d6797b4950303, whose ordered parents are main cbfea5efc8bbac7580306ef928a56426b10faaf0 and reviewed head fb17af354fc0f0679e0200373ee8a6c2a4dd256d. The actual main-parent-to-tested-merge diff contains exactly these 29 intended files. The only failed non-aggregate job is checks-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, at dashboard-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, at dashboard-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.

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
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 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 16, 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-16T07:16:14.593793Z fb17af3 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 P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This 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.

  • Before: The configured-server card initializes without a reactive-write error.
  • After: Its initial sign-in reset rejects with REACTIVE_WRITE_IN_OWNED_SCOPE.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The direction and visual parity are supported, but a concrete lifecycle regression prevents a clean correctness verdict.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored presentation refactor is outside the ordinary contributor proof gate; inspected browser screenshots show provider-list and picker parity, and a mocked-client regression exercises sign-in disposal.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: The Models settings experience should preserve its controls, drafts, focus, and sign-in behavior as rendering ownership moves to Solid.
Reason: The maintainer-authored direction removes obsolete host adapters and migrates shared consumers together without adding configuration or changing the intended user experience.

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
Reviewed head: becc84464ca42bb4953a5e1de8457c577668cd56

Before merge

  • Run the MCP reset outside synchronous component construction (P2) - Opening MCP settings immediately executes McpServersCard’s createRenderEffect callback, which calls login.reset(). runner.cancel() synchronously invokes onChange with an idle state, so these new ordinary signal setters run while the component owner is active and Solid throws REACTIVE_WRITE_IN_OWNED_SCOPE. The discarded cancellation promise becomes an unhandled rejection even when no sign-in session exists. This matches the exact-head failures in mcp-servers-card.test.ts and config/mcp.test.tsx. Move the initialization reset to an imperative lifecycle phase while retaining connection and selection invalidation.

Findings

  • [P2] Run the MCP reset outside synchronous component construction — ui/src/components/wizard-login-controller.tsx:42-45
Agent review details

How this fits together

Control 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]
Loading

Technical review

Best 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:

  • [P2] Run the MCP reset outside synchronous component construction — ui/src/components/wizard-login-controller.tsx:42-45
    Opening MCP settings immediately executes McpServersCard’s createRenderEffect callback, which calls login.reset(). runner.cancel() synchronously invokes onChange with an idle state, so these new ordinary signal setters run while the component owner is active and Solid throws REACTIVE_WRITE_IN_OWNED_SCOPE. The discarded cancellation promise becomes an unhandled rejection even when no sign-in session exists. This matches the exact-head failures in mcp-servers-card.test.ts and config/mcp.test.tsx. Move the initialization reset to an imperative lifecycle phase while retaining connection and selection invalidation.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/components/mcp-servers-card.test.ts src/pages/config/mcp.test.tsx src/components/wizard-login-controller.test.tsx --maxWorkers=1
  • pnpm tsgo:ui
  • git diff --check

What I checked:

PR surface

Source -60, Tests +173. Total +113 across 29 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 19 1321 1381 -60
Tests 10 493 320 +173
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 29 1814 1701 +113

Labels

Label changes:

  • add P2: The introduced MCP initialization error breaks development-runtime validation and both MCP UI test lanes; no production outage is established.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The introduced MCP initialization error breaks development-runtime validation and both MCP UI test lanes; no production outage is established.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • 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 16, 2026, 2:32 AM ET / 06:32 UTC.

@steipete
steipete merged commit 18cd308 into main Oct 16, 2026
98 of 101 checks passed
@steipete
steipete deleted the solid2/w-idiom-pages-models branch October 16, 2026 07:38
@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 17, 2026
)

* 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
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. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant