Repository navigation
refactor(ui): load MCP apps through Solid lazy boundaries - #179434
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 changes before merge. What this changesThis 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.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete 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 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +13, Tests +1. Total +14 across 2 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 21, 2026, 8:02 AM ET / 12:02 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…79434) * refactor(ui): load MCP apps through Solid lazy boundaries * test(ui): retain PR popup handoff failure facts
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 canonicalasync-and-actions.mdis 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).
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.
onCleanupLoadingand 6ErroredoccurrencesLoading, 4ErroredoccurrencesLoading, 1Erroredoccurrence; 3 otherLoadingtags are the local meetings spinneractioncallsactioncallsactioncalls; domain methods namedactionare excluded. Missing-action debt remains owner-specific and is not exhaustively quantified.import()occurrencescreateComponentcallslogs/route.tsuseContext; 0 wrapper candidatesReveal, 0 confirmed candidatesReveal, 0 confirmed candidatesReveal, 0 confirmed candidates; absence alone does not establish debtoptions.getOwner()domain-method false positivesApp/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/**.onCleanupcalls / component candidatescreateComponentcalls / unexcepted candidatesRetained 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
lazycomponent and await.preload()at the existing import point. Preserve the live-target check after that await. Render accepted view IDs underLoadinginside the existing retirement owner and register the panel guard's cleanup throughonSettled.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
onCleanup/onSettledaction/ optimistic primitiveslazy/LoadinguntrackflushProduction 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
pnpm tsgo:ui)--maxWorkers=1pnpm deadcode:knip)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.ci:fullrequested for the shared panel and its retirement behaviorNo 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.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 at7d732724b77369bc8627001a1cad3a5a9a49c4b2, 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
43c99e871f38b2ddb7c6fd0bcc275086887e5226could not reach the first popup: initialpage.gotoexceeded 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
b0d5acb33fc8a52e03784a4e0f8c2264f6b17781adds failure-only facts to this one test using the existing publicscenarioFactsrecorder. 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.tsrsbinary; the first invocation stopped before compilation/tmpbefore reviewer launch; the same diff passed using the macOS per-user temporary directory with isolation enabled.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-performancefailure (job 119247112165). It built mergec357a885f1dd34a7446b3c22f37de972ba4194c6, containing the PR head and current CI baseb394c808166c34025161660fdc5ed6449433a14d. Both builds completed; the strict checker reported exactlystartup JS gzipandchat boot JS gzipabove their absolute caps.43c99e871f38startup JS gzipchat boot JS gzipThe 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.control-ui-performance(119247112165)startup JS gzip;chat boot JS gzipchecks-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 Gatewayagents.defaults.heartbeatfixtureschecks-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 Gatewayopenclaw/ci-gate(119254525038)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 baseb394c808166c34025161660fdc5ed6449433a14dand tested mergec357a885f1dd34a7446b3c22f37de972ba4194c6. This PR has not changed or relaxed those tests. Fixture repair remains a separate coordinated follow-up.