Repository navigation
refactor(ui): deslop Control UI pages - #156436
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: needs real behavior proof before merge. Reviewed September 23, 2026, 1:47 PM ET / 17:47 UTC (Revision 7). ClawSweeper reviewWhat this changesConsolidates repeated Control UI request handling, rendering, media lifecycle, and response types, with focused regression and fixture updates. Merge readiness⛔ Blocked before merge - 3 items remain The cleanup remains useful, and the previous model-catalog blocker is resolved. No blocking correctness or security finding remains. Priority: P3 Review scores
Verification
How this fits togetherControl UI is OpenClaw’s browser interface. Its page controllers translate user actions into Gateway requests and update chat, settings, channel setup, and task views from the responses. flowchart LR
A[User actions] --> B[UI page controllers]
B --> C[Shared UI helpers]
C --> D[Gateway requests]
D --> E[Current context checks]
E --> F[Updated views]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep shared UI helpers as the single implementation while preserving Gateway contracts, settings, and request ownership. Do we have a high-confidence way to reproduce the issue? Not applicable: this is primarily a refactor, and source inspection found no remaining introduced failure to reproduce. Is this the best way to solve the issue? Yes: the patch consolidates existing owners and equivalent helpers without adding competing configuration or public APIs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5ada5d15a4f3. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
6bce208 to
d95bed6
Compare
11beba9 to
cbbb1c7
Compare
cbbb1c7 to
bd9d41c
Compare
|
Merged via squash.
|
* refactor(ui): deslop Control UI pages * refactor(ui): complete workspace update cutover * refactor(ui): consolidate page and component helpers * refactor(ui): complete agent model catalog cutover
What Problem This Solves
Control UI pages repeat request lifecycles, rendering decisions, and local copies of shared contracts, increasing the cost of keeping behavior consistent.
User Impact
No intended behavior or visual change. CSS, displayed copy, translations, Gateway protocol, configuration, persisted state, and plugin SDK exports are unchanged. Connection, generation, and authority checks remain with their existing owners.
Why This Change Was Made
The PR removes 1,158 net lines of production code. The requested exclusion command reports 1,163 net lines, including three removed test-support lines and two retired assertion-ratchet entries. No size, lint, or test budget was increased.
Evidence
Final validation base:
05996479d8184c8c8e802448a7ef774590e30a9b. The original three refactor patches are unchanged by rebase. The added integration fix completes the new main-side model-catalog caller's cutover toagentsSelectedId.pnpm build— passed on the final candidate, 390.260s.Codex autoreview through P2 — scoped-clean, no accepted/actionable findings.
git diff --check— passed.node scripts/check-changed.mjs --base 05996479d8184c8c8e802448a7ef774590e30a9b --timed— passed, 2,013.959s: formatting, all 25 core test-type lanes, UI production types, lint/style/script checks, i18n, ratchets, and all three dead-export scans with zero entries.node scripts/run-vitest.mjs run --config ui/vitest.config.ts --configLoader runner <661 explicit owner/import-dependent files>— 661 files passed; 12,415 tests passed, three existing skips, 203.192s. Includes Chromium browser tests and the new main-side browser dashboard, board widget, app-host title, composer-sizing, and message-copy coverage.node scripts/run-vitest.mjs src/config/schema-control-ui-contract.test.ts src/gateway/talk/handlers/client-native-actions.test.ts src/gateway/server.talk-consult-history.test.ts src/gateway/chat-auth-readiness.integration.test.ts src/gateway/server-methods/system-agent-setup-control-ui.test.ts— 5 files / 53 tests passed, 100.386s.node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner <17 explicit files>— 17 files / 117 tests passed, zero skips/failures, 158.897s. Covers model providers/defaults, settings/native embedding, browser routes and width, metadata, session diffs, plugin schemas, WhatsApp logout, and skill installation.pnpm ui:check-performance:base 05996479d8184c8c8e802448a7ef774590e30a9b— passed, 30.016s: startup JavaScript 370,850 / 371,332 bytes; startup/largest CSS 51,144 bytes, zero growth against base.Final head:
bd9d41c1b6fc927fcc47ef2132ea343d9537a97a. Isolated Linux proof run: native wrapper exit 0; candidate tree6cc483cc9713697d52292a79d28fcaec1936529aand all 92 source/routing hashes verified before each phase. The task-owned Testbox was stopped and verified completed. Hosted CI passed on this exact head;node scripts/watch-pr-ci.mjs 156436 bd9d41c1b6fc927fcc47ef2132ea343d9537a97a --repo openclaw/openclaw --timeout 3600 --interval 120returnedGREEN. All three UI shards and all nine UI E2E shards passed.Earlier validation exposed two existing fixture readiness assumptions: Models layout queried its independently lazy sidebar before attachment, and the HTML preview test polled for first CodeMirror admission before its asynchronous loading completed. The fixtures now await the actual sidebar attachment or browser textbox interaction, following existing owners. All original assertions and timeout settings remain. Each corrected file passed 20 standalone runs, and each owning selection passed three complete runs across the local and isolated proof.
Earlier contended Mac runs also hit native Talk and source-Vite timing failures. Isolated Linux proof passed with unchanged limits; the exact Mac runtime cause remains unproven. Details are retained below.
Regression, test cost, and retained failure evidence
pnpm test ui/src/components/config-form-composition-integrity.browser.test.ts ui/src/lib/channels/index.test.ts --maxWorkers=1— 45 passed, 10.28s combined wrapper wall time. The new boolean-schema preservation case first failed with{}instead of{ blocked: false }, then passed after the repair. The two isolated Vitest shards took 1.64s and 5.18s respectively.pnpm test ui/src/e2e/model-providers-layout.e2e.test.ts --maxWorkers=1— 20/20 full runs passed, five widths each; first run 18.26s test time and 144.81s wrapper wall, including a cold bundled app build.pnpm test ui/src/pages/chat/components/chat-html-file.browser.test.ts --maxWorkers=1— 20/20 full runs passed, nine cases each; first wrapper wall 9.76s. Preserves editability, editor identity, draft persistence, preview, and undo assertions.SESSION_MUTATION_AUTHORIZATION_CHANGEDduring initial creation. These occur before the changed helper can execute; the suite imports only the unchangedextractTextimplementation. All 53 cross-shard tests passed on isolated Linux with unchanged timeouts/assertions. Their original Mac runtime cause remains unproven; no native Talk repair is claimed.Final-head hosted durations: config-form composition 0.024s, HTML preview 2.995s, and Models layout 3.924s for all five widths. The first published CI run also recorded passing channel helpers at 0.079s, Usage query at 0.008s, and byte encoding at 0.031s. The final-head results above supersede that run's overall failing verdict.
Requested measurement:
The prior published CI run exposed one integration issue: newer main added a model-catalog getter that called the removed
resolveSelectedAgentId()wrapper. Its canonical-state replacement passed the four affected files (51 tests) and the two routed E2E files (four tests). The intervening full changed-check attempt then found an unrelated missingpolicyConfigfixture field on main; this branch incorporates its owning repair,09012603235, by rebase. No Gateway source or test is changed by this PR.Additional SDK/export and broad-extension gates are not applicable; those surfaces were not changed.
ui/src/pages/chat/route-loader.tsandCHANGELOG.mdare untouched. This PR has not been merged; it awaits coordinator review before landing.