Repository navigation
refactor(ui): use Solid lifetimes, actions, and stores in chat - #179115
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 67b5b27078
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -1,4 +1,4 @@ | |||
| import { For, Loading, Show, createMemo, createSignal, lazy } from "solid-js"; | |||
| import { For, Loading, Show, action, createMemo, createOptimistic, lazy } from "solid-js"; | |||
There was a problem hiding this comment.
Keep chat-only actions out of the shared boot graph
This first action import is used only by the lazy Chat Details panel, but it pulls core/action.js and core/lanes.js into the manifest's shared set, so even New Session now downloads an additional request and roughly 2.6 KB gzip before the panel is opened. Preserve the previous local signal/finally implementation or isolate the action runtime behind the chat interaction boundary so this refactor does not increase every Control UI startup.
AGENTS.md reference: ui/AGENTS.md:L76-L79
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c54eff5d65
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const [failedImages, setFailedImages] = createStore<Record<string, boolean>>((draft) => { | ||
| if (pageTarget()) { | ||
| for (const url of Object.keys(draft)) { | ||
| delete draft[url]; | ||
| } | ||
| } |
There was a problem hiding this comment.
Preserve failed images after store writes
When an image emits error while pageTarget() is available, setFailedImages writes the URL and this writable createStore derivation immediately reruns with that mutated draft; because the condition remains truthy, it deletes the URL that was just recorded. The failure therefore never stays latched, so broken thumbnails and favicons remain or reappear instead of falling back; clear the store only when the page-target identity actually changes. .agents/skills/solid/references/lessons.mdL21-L23
Useful? React with 👍 / 👎.
|
Codex review: needs maintainer review before merge. What this changesThis PR moves chat presentation state, mutation indicators, renderer loading, and cleanup into existing Solid primitives. Example: A user confirms Stop worker twice while the first request is pending.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this is a maintainer-directed refactor with no confirmed introduced defect; neither existing review finding remains supported by the current evidence. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherControl UI chat components consume session and Gateway owner snapshots, render controls and previews, and delegate mutations to existing domain owners. flowchart LR
A[Gateway and session owners] --> B[Reactive projections]
B --> C[Chat components]
C --> D[Solid stores and lifetimes]
C --> E[User actions]
E --> A
C --> F[Lazy preview renderers]
Technical reviewBest possible solution: Retain this focused conversion with synchronous mutation admission, existing domain owners, and the justified retained async-result pipelines. Do we have a high-confidence way to reproduce the issue? This is a behavior-preserving refactor; source inspection found no confirmed introduced failure, and no target code was executed during this read-only review. Is this the best way to solve the issue? The change follows the existing Solid ownership model, removes superseded renderer paths, and preserves synchronous admission separately from optimistic presentation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7a0342f55f96. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -12, Tests +229. Total +217 across 37 files. Added test files: 1. 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 21, 2026, 4:34 AM ET / 08:34 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…law#179115) * refactor(ui): adopt Solid lifetimes and actions in chat panels * build(ui): refresh chat boot module manifest * test(ui): return void from widget cleanup * refactor(ui): complete chat actions and lazy JSX renderers * fix(ui): isolate dialog actions from chat owner writes * test(ui): capture native update dialog failure state
Related: #168114
Problem and solution
Chat components still separate teardown from setup, copy local presentation records, maintain mutation pending flags manually, and construct or load renderers imperatively.
Pair teardown with settled lifetimes; use draft stores for disclosure choices and failed images; use actions with optimistic pending indicators for compaction, goal editing, worker stopping, and learned-skill Undo. YouTube uses
lazy/Loading/Erroredat its existing boundary. The recovery-dialog launcher is consolidated with its JSX renderer, and the subagent-activity lazy wrapper now uses JSX.Existing owners retain request admission, target and connection identity, cancellation, and durable outcomes. Worker-stop and goal-submit callbacks run outside the held dialog action so synchronous owner publications remain free to advance navigation while requests are pending. Synchronous duplicate-admission guards remain separate from optimistic presentation. Browser-card failures remain latched across screenshot refreshes and unavailable targets; a new valid page target permits retry.
Tags, CSS classes, routes, selectors, focus ownership, playback identity, and lazy boundaries remain intact. No intended appearance change, dependency change, or budget/baseline exception. The native-update E2E now records bounded scalar dialog facts only on failure; its assertions and waits are unchanged.
Proof
chat-loading-performance.real-gateway.e2e.test.tspassed.The paired builds use actual current-CI main parent
0f737e5c89e5and tested merge4cfd26bdbe7f, whose other parent is43b5473357a5. Both ran in the same checkout on the same machine with identical installed Solid rc.16 dependencies and fixed build metadata. Both strict checks report the existing 325,476 B startup-cap violation; the PR's +4 B is within the 64 B build-variance allowance. The older campaign ceiling is not used to qualify growth.CI investigation and limits
Current run 39576241570 attempt 1 has two inherited failing names. Both match scheduled main 39578067192 attempt 1 at
94e1fbf31a137. The native inherited-failure recovery route is used; these checks are not represented as green:Control UI Markdown table interactions > contains content-sized tables after restoring a percentage reading width: the same false-containment assertion at line 214 also fails on latest completed scheduled main 39578067192, confirmed by exact check annotation title and assertion. Shard numbers differ; attribution uses test names.Control UI cross-channel automation management with a real Gateway > configured owners and admin chat manage a Telegram-created job while a non-owner cannot: timeout awaiting the initial Telegramcreate:response at line 308, before browser navigation. The exact name, 60-second timeout, bus-event kinds, and source line also fail on latest completed scheduled main 39578067192. The targeted local base attempt was stopped during private-QA setup once this matching evidence became available; it supplies no test verdict. Its standard Playwright/real-Gateway config usedOPENCLAW_VITEST_RUNTIME=node.The prior native-update timeout did not recur in current CI. Its exact case also passed on actual prior main parent
c13eaeedc6c1and in one instrumented run of tested merge2786c2677689. No product fix or inherited claim is inferred from those passes; bounded failure diagnostics remain in the test.The earlier placement failure was ours: an imperative owner callback synchronously published shared state inside a held dialog action, allowing the URL to change while the visible pane remained held. The existing browser case reproduces that defect before callback isolation and passes afterward. Goal submission received the same correction; state-based waits replace fixed-microtask assumptions in its test.
Earlier local Details waits remain recorded:
uses the current PR renderer and preserves CI session identity and branch dismissalandprojects direct active children through the live observer with stable rounded-avatar seeds. Their exact-name base attempt timed out without assertions, so no inherited claim was made. Mobile-menu and learned-skill local watchdog limits also remain in native review evidence. Subsequent complete UI unit shards passed; passing replays are not claimed as fixes for those local observations.Solid 2 checklist, counts, and deliberate survivors
createComponentcallscreateRoot/getOwner/runWithOwnerSettled setups: 19 → 30. Ordinary signals: 58 → 52. Effects: 3 → 3. Intentional initial snapshots (
untrack): 3 → 3. Counts include generic calls; Solid action counts exclude the existing branch accessor namedaction.Production LOC: 9,240 → 9,226 (-14). Tests: 2,833 → 3,085 (+252). Scope: 38 files; the added E2E file contributes existing lines to both counts. The generated boot manifest adds the shared runtime entries, removes the retired launcher, retains a currently reached Markdown module, and renames the lazy-wrapper entry.
The remaining favicon cleanup retires work begun synchronously during rendering. Across the lane, cleanup tied to reactive runs, primitives, synchronous media/ref registration, keyed DOM handoff, and foreign-DOM adapters remains justified;
FrameBodyretains its intentional owner APIs.The diff panel retains accepted raw sources, progress, and error slots. Persistent mobile chrome reads data and progress outside the result region; native async reads there would hold the changed scope and suppress its loading fallback. Moving the boundary around the panel would alter the persistent rail. Raw source/fold identity, accepted-result publication, and stale-gap result reuse stay intact.
Tool output retains one combined state slot so the same visible native input disclosure and raw-output controls survive loading, errors, and retries. A fallback renderer would expose independent disclosure state; preserving continuity would require a broader boundary design and another accepted-value bridge.
Clipboard feedback retains its primitive-owned signal: reset participates synchronously in the retained foreign-DOM renderer, and installed store options do not support that signal's
ownedWriteintegration contract. No adapter or dependency change was added to force this conversion.