Skip to content

refactor(ui): load MCP apps through Solid lazy boundaries - #179434

Merged
steipete merged 2 commits into
mainfrom
solid2/w-s2-comp-c-mcp
Oct 21, 2026
Merged

steipete merged 2 commits into
mainfrom
solid2/w-s2-comp-c-mcp

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Wave-ten whole-scope census

Baseline 43c99e871f38, Solid rc.16. Counts below cover the assigned area and distinguish source-reviewed opportunities from raw syntax. Other open lanes retain their files; an inventory entry does not claim their work. The canonical async-and-actions.md is absent at this baseline, so new item 3–4 conversions remain queued.

Components: 581 production files, 112,227 → 112,240 LOC. Families are Solid generic (58), config forms (23), menus/pickers/dialogs/settings (77), and rest (423).

Checklist item Solid Config Menus Rest Total before → after
1. Confirmed native handler binding bugs 0 0 0 0 0 → 0
2. Component-lifetime cleanup candidates 4 → 3 0 1 4 9 → 8
3. Named local async-read flows 1 0 2 4 7 → 7
4. Named legacy mutation-feedback flows 4 0 1 5 10 → 10
5. Manual renderer loaders 1 → 0 0 1 4 6 → 5
6. Named structured-state candidates 0 0 2 6 8 → 8
7. Manual component factories 1 0 3 0 4 → 4
8. Throw-only context wrappers 0 0 0 0 0 → 0
9. Demonstrated sibling reveal needs 0 0 0 0 0 → 0
10. Unjustified owner API calls 0 0 0 0 0 → 0

Pages: A=agents/config/sessions; B=new-session/model-providers/model-setup/channels/cron/skills; C=other non-chat pages. Raw named-signal and structured-seed counts are partial indicators, not a claim that every occurrence needs conversion. #179118 has landed; its 17 native binding candidates are gone. Dashboard filters are externally claimed.

Item PAGES-A (111 files) PAGES-B (197 files) PAGES-C (271 files)
1. Native reactive callback values 0 0 0; #179118 removed all 17 prior raw occurrences
2. Lifecycle 3 raw onCleanup 13 raw 38 raw; across all groups 34 unclaimed named permitted lifetimes, 0 confirmed component-only changes
3. Async reads 4 raw loading/error-named signals; 6 native Loading and 6 Errored occurrences 5 named signals; 3 native Loading, 4 Errored occurrences 9 named signals; 2 native Loading, 1 Errored occurrence; 3 other Loading tags are the local meetings spinner
4. Mutations 0 imported Solid action calls 0 imported Solid action calls 0 imported Solid action calls; domain methods named action are excluded. Missing-action debt remains owner-specific and is not exhaustively quantified.
5. Code splitting 10 raw import() occurrences 24 raw 46 raw; includes route loaders, type queries and non-render resources; debug overlay now uses native lazy rendering, Logbook loader remains externally reserved
6. Structured signal literal seeds 0 raw 2 raw 12 raw; dashboard local filters are externally claimed by active dashboards-filter-proof review
7. JSX 0 createComponent calls 0 20 calls: 18 owned by saved PRs, 2 unclaimed in logs/route.ts
8. Context 0 wrappers/candidates 1 context, already default-less/direct useContext; 0 wrapper candidates 0
9. Sibling loading 0 Reveal, 0 confirmed candidates 0 Reveal, 0 confirmed candidates 0 Reveal, 0 confirmed candidates; absence alone does not establish debt
10. Owner API escapes 0 0 actual Solid calls; 2 raw options.getOwner() domain-method false positives 0

App/lib/plugins/API: 190/346/19/12 production files. Counts are unchanged from the previous source audit because the baseline delta only touches excluded tests and lib/reactive/**.

Item App Lib excluding reactive Plugins API
1. Native conditional/dynamic handler defects 0 0 0 0
2. onCleanup calls / component candidates 3 / 0 5 / 0 4 / 1 covered (#179352) 0 / 0
3. Hand-managed asynchronous read flows 1 (focus dashboard; active worker) 2 (MCP discovery, browser inspection) 1 (session history) 0
4. Mutation recipe follow-ups 0 1 (browser open/resume/stop) 2 (contribution dispatch; reload error presentation) 0
5. Manual component-loader candidates 0 0 1 (dashboard; #179352 family) 0
6. Structured local-signal candidates 0 1 (tab focus; #179359) 1 (dashboard presentation; #179352) 0
7. Manual createComponent calls / unexcepted candidates 0 / 0 3 / 0 (documented renderer exception) 0 / 0 0 / 0
8. Throw-only context wrappers 0 0 0 0
9. Uncoordinated sibling Loading candidates 0 0 0 0
10. Owner API calls / non-adapter candidates 6 / 6 (active worker) 4 / 0 7 / 0 0 / 0

Retained exceptions preserve synchronous subscription/registration retirement, mutation admission, keyed publication custody, and foreign-DOM roots. The bridge's three manual calls implement the native-element renderer and optional provider boundaries; the installed rc.16 API explicitly permits custom-renderer invocation. Optional contexts support standalone consumers. No demonstrated sibling reveal need was found. Remaining MCP reads/mutations, dialog JSX and local structured drafts are follow-up work, with externally owned route, sidebar, dashboard, catalog, and app-owner files reserved.

What Problem This Solves

The MCP panel stores a manually imported renderer in a mutable component slot and registers separate component teardown.

User Impact

No visible behavior change. Renderer loading still finishes before any launch/tool RPC. Retiring app content keeps its original launch target until teardown is acknowledged.

Why This Change Was Made

Use a named-export lazy component and await .preload() at the existing import point. Preserve the live-target check after that await. Render accepted view IDs under Loading inside the existing retirement owner and register the panel guard's cleanup through onSettled.

The old mutable renderer slot disappears. The Gateway/launch owner retains synchronous admission, generation, target identity and publication authority. The settings read and three mutation flows remain unchanged until the shared async/action recipe lands. The existing test now also asserts that loading the renderer cannot dispatch a tool request early. No dependency, eager bridge registration, new state, helper, CSS, tag or selector is added.

Touched-file counts

Checklist / metric Before After
Production files / LOC 1 / 284 1 / 297
1. Native bindings / confirmed reactive-binding defects 2 / 0 2 / 0
2. onCleanup / onSettled 1 / 0 0 / 1
3. Async functions / async memos / local read flows 6 / 0 / 1 6 / 0 / 1
4. Legacy mutation flows / action / optimistic primitives 3 / 0 / 0 3 / 0 / 0
5. Manual renderer slots / runtime imports / lazy / Loading 1 / 1 / 0 / 0 0 / 1 / 1 / 1
6. Signals / structured seeds / stores / projections 5 / 0 / 0 / 0 5 / 0 / 0 / 0
7. Manual component factories 0 0
8. Context wrappers 0 0
9. Sibling reveal needs 0 0
10. Owner API calls 0 0
Effects / memos / untrack 1 / 2 / 2 1 / 2 / 2
Rendering controllers / render effects / flush 0 / 0 / 0 0 / 0 / 0
Native listeners / DOM queries / class concatenation 0 / 0 / 0 0 / 0 / 0

Production LOC: 284 → 297 (+13), primarily the expanded import, named lazy declaration and Loading wrapper. Test LOC: 101 → 102 (+1). Simplification pass removes the manual mutable renderer slot without introducing an abstraction.

Evidence

Check Result
UI typecheck Passed (pnpm tsgo:ui)
MCP panel retirement contract 1 passed, existing file, pinned Bun, --maxWorkers=1
Formatting Passed, both touched files
Targeted lint Passed (UI tsconfig, both touched files). Initial extension declaration preparation timed out before lint; the supported UI-scoped invocation completed successfully.
Production Knip Passed (pnpm deadcode:knip)
Independent review Independent Codex P0–P2 review: scoped-clean; supplied patch and retirement context
Matched production build / strict budgets Passed (pnpm ui:build), including precompressed-asset validation and final publication. Both strict checks retain only existing startup/chat absolute-cap violations; every over-budget delta is ≤64 B. Seven packaged plugin inputs verified byte-for-byte.
Visual proof No visual change; host markup, styles and retained renderer are unchanged
Broad behavior ci:full requested for the shared panel and its retirement behavior

No local E2E/parity suite was run for the MCP refactor. The single exact-base popup reproduction below was inconclusive; no remote lease was used for it.

Matched bundle proof

Base 43c99e871f38; head compiled on the same host with the same seven packaged plugin distributions. Head numbers are from its finalized staging directory, after native asset validation.

Surface Base gzip Head gzip Delta
Startup JS 331,698 B 331,684 B -14 B
Startup CSS 40,439 B 40,439 B +0 B
Chat boot JS 1,501,267 B 1,501,291 B +24 B
New Session boot JS 1,018,676 B 1,018,677 B +1 B
All locale assets 3,311,035 B 3,311,070 B +35 B

Startup uses eight JS requests and one CSS request; chat/new use 25/20 JS requests. All request counts and raw startup/chat/new bytes are unchanged. Individual locale growth is at most 5 B; no locale exceeds its cap. On this recorded base, startup and chat exceeded the existing absolute caps; the PR changes are −14 B and +24 B, within the campaign's no-growth tolerance. Newer main measurements are separate evidence.

Popup investigation and bounded diagnostics

Original head 9f306fcd81176b4ae77a1ac458e11128ff1c82c6, CI 39593204360, failed exactly one UI E2E case: chat CI job and step details > creates auto-merge only for the PR whose popup was opened. The second PR's monitoring page did not become visible within the original 30-second wait. The latest completed scheduled main run checked, 39592709539 at 7d732724b77369bc8627001a1cad3a5a9a49c4b2, did not fail that test. The original failure remains unexplained and has no established inherited-failure exemption. The diagnostic-head run below passes this test; the instrumentation is not a claimed repair.

One unmodified, exact-base replay at 43c99e871f38b2ddb7c6fd0bcc275086887e5226 could not reach the first popup: initial page.goto exceeded its existing ten-second timeout under severe host contention. Its screenshot showed only the boot skeleton, initial loopback assets took about six seconds, and load exceeded 159. That attempt establishes neither a passing baseline nor the original popup failure. No local replay was repeated. The Node runtime matched the failed Playwright CI job, which explicitly disables Bun.

Diagnostic head b0d5acb33fc8a52e03784a4e0f8c2264f6b17781 adds failure-only facts to this one test using the existing public scenarioFacts recorder. It captures fixed booleans/counts for the selected and second popup, trigger expansion, focus, inertness, navigation visibility and visible page count. The evaluation has its own one-second bound, ignores diagnostic failure, and rethrows the original error. It changes no production path, action, assertion, timeout, retry, markup or screenshot behavior, and records no text, URL or identifier. It is diagnostic instrumentation, not a claimed popup repair.

Investigation check Result
Original exact-head broad CI 455 tests passed in the failing shard; the named cross-popup case failed
Exact-base single-case replay Inconclusive setup timeout before popup interaction
Diagnostic UI typecheck Passed after frozen install restored the missing pinned tsrs binary; the first invocation stopped before compilation
Diagnostic format / targeted lint Passed, one E2E file, UI tsconfig
Diagnostic independent review Codex P0–P2 scoped-clean; no accepted/actionable findings. The initial preflight rejected shared /tmp before reviewer launch; the same diff passed using the macOS per-user temporary directory with isolation enabled.
Diagnostic local E2E rerun Not run: host contention makes the attempted baseline unqualified

The diagnostic adds no production LOC. The MCP test remains 101 → 102 LOC; the E2E file is 536 → 582 LOC, solely failure instrumentation.

Exact-head performance CI attribution

Completed diagnostic-head CI 39607208086 had a completed control-ui-performance failure (job 119247112165). It built merge c357a885f1dd34a7446b3c22f37de972ba4194c6, containing the PR head and current CI base b394c808166c34025161660fdc5ed6449433a14d. Both builds completed; the strict checker reported exactly startup JS gzip and chat boot JS gzip above their absolute caps.

Exact failure metric Recorded PR merge-base 43c99e871f38 Current CI candidate Limit
startup JS gzip 331,698 B 331,163 B 325,476 B
chat boot JS gzip 1,501,267 B 1,500,407 B 1,500,000 B

The merge-base column is the existing exact-base local strict-check result, using the same cap values and metric names; it is not a same-host delta against this Linux CI candidate. In the current CI job's own matched pair, chat is 1,500,374 → 1,500,407 B (+33 B), with 25 JS requests unchanged. New Session is +8 B; startup CSS remains 40,439 B and one request. The original same-host MCP comparison above remains the production-input proof; the diagnostic commit changes only an E2E test.

Completed scheduled main 39608923095, attempt 1 at bedbf6761e085133eb03badab3d116e0e33343de, also fails these exact two metric names and limits: startup 331,088 B, chat 1,500,308 B. The receipt contains no pending jobs. These frozen baseline results supplement the original exact merge-base evidence; they do not describe newer main, whose separately measured budget recovery is not part of this PR's tested pair. No original popup-failure exemption is inferred.

Completed diagnostic-head CI

Run 39607208086 completed on b0d5acb33fc8a52e03784a4e0f8c2264f6b17781. All nine UI E2E shards passed, including the original popup test in shard 1/9. The production change is unchanged; this is passing execution evidence, not a demonstrated repair of the earlier intermittent failure.

Remaining failed job Exact failing cases / result Attribution
control-ui-performance (119247112165) startup JS gzip; chat boot JS gzip Matching exact PR merge-base failures and caps recorded above
checks-ui-e2e-real-gateway (1/2) (119247113170) chat-session-diff-folding.real-gateway.e2e.test.ts > manual code folding through a real Gateway; command-palette-search.real-gateway.e2e.test.ts > Control UI command palette search with a real Gateway Suite setup rejects retired agents.defaults.heartbeat fixtures
checks-ui-e2e-real-gateway (2/2) (119247113347) Control UI agent file lifecycle with a real Gateway > reads and saves the selected agent workspace through an isolated Gateway; Control UI profile page real Gateway E2E > shows the authenticated user instead of the default agent through a real Gateway Gateway setup/config validation rejects the same retired fixture
openclaw/ci-gate (119254525038) Aggregate of the three failed jobs above Downstream aggregate

Completed scheduled main 39608923095, attempt 1 at bedbf6761e085133eb03badab3d116e0e33343de, fails all four exact Gateway names and the same retired-heartbeat fixture errors, in jobs 119252566698 and 119252566828. Its performance job fails the same two metrics. All remaining current-head failures therefore have matching-name completed-baseline evidence for the native inherited-failure route; the CI result remains failed. The eight relevant fixture, migration and budget/build-policy source blobs are identical between actual PR CI base b394c808166c34025161660fdc5ed6449433a14d and tested merge c357a885f1dd34a7446b3c22f37de972ba4194c6. This PR has not changed or relaxed those tests. Fixture repair remains a separate coordinated follow-up.

@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:24:50.215503Z b0d5acb 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR replaces the MCP panel’s mutable renderer slot with Solid lazy loading and component lifecycle cleanup.

Example: Open the MCP app for agent a, then switch to agent b.

  • Before: A manually imported renderer displays a’s app until its teardown finishes.
  • After: A Solid lazy renderer preserves the same launch ordering and awaited replacement.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-consistent, with supporting unit coverage but no supplied shipped MCP demonstration and one unattributed E2E failure.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate and does not materially change authority. The focused test supports preload ordering and retirement; the four inspected prepared images show the Agents catalog, not the changed MCP panel.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No visible behavior change is requested; the maintenance goal is to remove manual renderer loading while preserving app launch and retirement.
Reason: The maintainer-authored direction replaces manual component storage with the framework primitive without expanding public configuration, APIs, or state ownership.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This PR is a focused, maintainer-directed refactor with no actionable introduced defect found; the failed UI E2E check still needs attribution before landing.

Priority: P3
Reviewed head: 9f306fcd81176b4ae77a1ac458e11128ff1c82c6

Before merge

  • Complete next step - Determine whether the failed chat PR-popup E2E scenario is diff-caused or inherited using a matching base failure or a head-versus-revert comparison.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped MCP launch-and-retirement scenario is supplied; the focused test uses a mocked renderer and Gateway client.
Agent review details

How this fits together

The Control UI MCP panel consumes an accepted launch target, loads its renderer, requests a Gateway launch, and renders the returned view under the existing iframe retirement owner.

flowchart LR
  A[Accepted launch target] --> B[MCP panel]
  B --> C[Lazy renderer preload]
  C --> D[Live target check]
  D --> E[Gateway launch request]
  E --> F[Retirement owner]
  F --> G[MCP app iframe]
Loading

Technical review

Best possible solution:

Use Solid’s existing lazy primitive while retaining the current launch admission checks and awaited retirement owner.

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

This PR claims a behavior-preserving refactor rather than a current user bug; no target code or tests were executed during this read-only review.

Is this the best way to solve the issue?

The change uses the existing renderer and retirement owners, removes the superseded mutable slot, and preserves the preload-before-RPC invariant without unnecessary production machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Renderer loading and post-await admission keeps the original intent (c5b1c31: Consolidate presentation paths while preserving synchronous authority and live operation targets.)
  • Transport scheduling keeps the original intent (d7d72c5: Start external MCP work in the effect apply phase rather than rendering.)
  • Accepted launch identity and iframe retirement keeps the original intent (91fd61d: Preserve app frame identity and await retirement before replacing rendered content during the Solid migration.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit c5b1c31 adds ui/src/components/solid/mcp-app-panel.tsx:90 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c5b1c315d052; files: ui/src/components/solid/mcp-app-panel.tsx)

PR surface

Source +13, Tests +1. Total +14 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 28 15 +13
Tests 1 1 0 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 29 15 +14

Labels

Label changes:

  • add P3: This is an internal UI refactor with no intended user-visible behavior change or established urgent regression.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is an internal UI refactor with no intended user-visible behavior change or established urgent regression.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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, 8:02 AM ET / 12:02 UTC.

@steipete
steipete merged commit 7b4fdfb into main Oct 21, 2026
118 of 126 checks passed
@steipete
steipete deleted the solid2/w-s2-comp-c-mcp branch October 21, 2026 14:47
@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
…79434)

* refactor(ui): load MCP apps through Solid lazy boundaries

* test(ui): retain PR popup handoff failure facts
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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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