Repository navigation
perf(ui): defer Settings English until needed - #135131
Conversation
Keep optional Settings copy out of Control UI startup while preserving cold settings search, the Updates introduction, translation fallbacks, and shared startup/update guidance. Move 263 strings unchanged through the existing lazy catalog registration boundary. Unify complete source-catalog composition and source-hash dependencies for Vite, verification, and locale generation. Preserve source ordering and translation-memory aliases; no budget or baseline changes. Related: #121497 Separate startup-headroom follow-up to #134490.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 8:32 AM ET / 12:32 UTC. ClawSweeper reviewWhat this changesThe branch defers Settings-only English UI text to lazy Settings paths, centralizes complete build-time locale catalog composition, and relocates an OpenRouter integration suite to the plugin-boundary test area. Merge readinessNo actionable correctness or security finding was identified. This maintainer-authored, maintainer-labeled PR remains useful and should await completion of exact-head CI before normal maintainer landing review. Priority: P3 Review scores
Verification
How this fits togetherThe Control UI starts with an English locale object, then loads the Settings sidebar and config page only after entering Settings. Build-time catalog tooling composes eager and lazy English fragments so generated non-English locale adapters retain complete source text. flowchart LR
Boot[Control UI startup]
English[Startup English catalog]
Settings[Enter Settings]
Sidebar[Lazy Settings sidebar]
Registrar[Settings English registrar]
Build[Locale build and verification]
FullCatalog[Complete source catalog]
Boot --> English
Settings --> Sidebar
Sidebar --> Registrar
Registrar --> English
Build --> FullCatalog
FullCatalog --> English
Before merge
Agent review detailsSecurityNone. PR surfaceSource +48, Tests +208, Docs +1, Other -75. Total +182 across 20 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the existing lazy Settings boundary, host-only complete catalog owner, and plugin-boundary integration coverage; land after exact-head CI confirms the current head. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a startup-performance refinement rather than a report of broken shipped behavior. The PR body nevertheless supplies before/after isolated browser evidence for the affected loading path. Is this the best way to solve the issue? Yes. The existing lazy Settings sidebar and config-page boundaries load the registrar before any moved key is read, while the host-only catalog keeps generation and Vite input complete without importing that owner into runtime code. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 570815775a2a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
Keep locale loading assertions independent of English source fragments. The Settings registrar is not an operator-selectable foreign locale. Use the canonical registry instead of a growing English filename list.
Replace cold inactive-registry warm-up with existing public plugin loading and request-scoped registration. Keep HTTP/SSE composition and add a billing case that proves the real provider hook participates. Remove the 300-second setup override; no production behavior changes.
… boundary Move the real-provider/core-classifier suite out of core source. Preserve all six HTTP/SSE cases, registry scope and automatic unit-fast/CI coverage. The explicit extension boundary suite and canonical root types/lint pass.
Land-ready verificationReviewed head: The canonical fix moves 263 unchanged Settings strings into the existing lazy registrar, including registration before cold Settings search, and gives Vite/verification/generation one host-only complete-catalog owner. All 6,016 ordered English entries and placeholders are preserved. The PR body contains inspected, synthetic before/after screenshots and the real isolated-Gateway proof: default boot, cold search and page navigation, Updates introduction, locale switching, partial-translation English fallback and readable rejected-page recovery. Settings copy is absent from default-boot requests. No CI findings were fixed rather than retried away: the locale E2E now counts registered foreign adapters, not arbitrary English fragment files; the OpenRouter integration now installs the real provider in request scope and lives under the existing Representative local commands (full earlier ledger in the PR body): pnpm buildpnpm ui:i18n:verifynode scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/locale-offline-retry.e2e.test.tsOPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs test/extension-test-boundary.test.ts test/plugins/openrouter-error-classification.integration.test.ts src/agents/failover-error.test.ts src/agents/failover/provider-structured-signals.test.ts src/agents/embedded-agent-helpers/provider-runtime-failure.test.ts extensions/openrouter/failover.test.ts test/plugins/clawrouter-responses-discovery.test.tsnode scripts/run-oxlint.mjs --type-aware --tsconfig test/tsconfig/tsconfig.test.root.json test/plugins/openrouter-error-classification.integration.test.tsClawSweeper disposition: proceed through native preparation/merge now that exact-head CI is green, as recommended by the latest completed review. Full-source main comparison was independently completed; no equivalent extraction is already on main. The generic stored-data-model flag is inapplicable because serialized formats and runtime stores are unchanged. Later commits only repair test fixtures/ownership, with independent reviews and green CI. Automatic root-test lint is already covered by merged #135123; no policy exemption was added here. Final judged delta: production/tooling −27, tests +208 after discounting the move, guide +1. Broader startup-budget issue #121497 stays open; upgrade/recovery PR #134490 remains separate and untouched. |
|
Merged via squash.
|
* perf(ui): defer Settings English until needed Keep optional Settings copy out of Control UI startup while preserving cold settings search, the Updates introduction, translation fallbacks, and shared startup/update guidance. Move 263 strings unchanged through the existing lazy catalog registration boundary. Unify complete source-catalog composition and source-hash dependencies for Vite, verification, and locale generation. Preserve source ordering and translation-memory aliases; no budget or baseline changes. Related: openclaw#121497 Separate startup-headroom follow-up to openclaw#134490. * test(ui): count only registered locale adapters Keep locale loading assertions independent of English source fragments. The Settings registrar is not an operator-selectable foreign locale. Use the canonical registry instead of a growing English filename list. * test(agents): scope real OpenRouter hooks in error integration Replace cold inactive-registry warm-up with existing public plugin loading and request-scoped registration. Keep HTTP/SSE composition and add a billing case that proves the real provider hook participates. Remove the 300-second setup override; no production behavior changes. * test(plugins): own OpenRouter composition coverage at the integration boundary Move the real-provider/core-classifier suite out of core source. Preserve all six HTTP/SSE cases, registry scope and automatic unit-fast/CI coverage. The explicit extension boundary suite and canonical root types/lint pass.
Related: #121497 — Control UI startup headroom.
Separate follow-up to #134490 — upgrade configuration and recovery. This PR does not modify that branch or its upgrade/recovery decisions, and does not settle the broader budget-policy question.
Additional instructions
This is a same-repository maintainer branch and remains takeover-ready.
What Problem This Solves
Resolves a problem where every Control UI startup downloads English copy needed only after opening Settings or Settings search. The measured main baseline had only 1,080 bytes left under the existing startup gate, making ordinary UI work vulnerable to another round of byte shaving.
This moves 263 unchanged strings out of the initial graph rather than deleting guidance, changing compression accounting, or increasing a budget.
Why This Change Was Made
The existing lazy English registrar pattern now owns whole Settings subtrees. Both the config page and cold Settings search register the copy before reading it, preserving the config-page header's
updates.page.intro; shared save/update errors, navigation, login, and startup recovery copy remain eager.Generation, verification, and Vite now consume one host-only source-catalog owner. Empty namespace anchors retain the original flattened ordering and translation-memory aliases, and the source hash includes the previously omitted static
en-agents.tsdependency. Required object namespaces are represented in the English catalog's type instead of asserted by the registrar.User Impact
Startup JavaScript is 3,034 gzip bytes smaller, with the same eight initial JS requests. Settings text, translation fallback, and error behavior are unchanged; there is no new option or operator action. Existing non-English adapters and the post-merge generated-locale workflow remain the translation owners.
No budget, baseline, generated translation memory/metadata, dependency, product config/environment option, protocol, database schema, version, or changelog is changed.
Evidence
Canonical builds used baseline
7fd30e6bb574and exact candidate60f6575a1e8b1af9d9071b79d656f515959d5b95with Node 24.20.0 and pnpm 12.1.0.A second candidate UI build reproduced 345,130 B. Both canonical builds passed with no ineffective-dynamic-import warning. Full ordered key/value equality, all 263 moved strings and placeholders, shared namespace identity, and idempotent registration were verified against an independently captured pre-change catalog.
The new cold-search regression failed before because startup eagerly resolved
configPage.themeImported, then passed after. 356 tests across 18 files passed; two single-worker ordering runs passed 121 tests each. The final type-only cleanup also passed 88 catalog/search cases and five type graphs. These repeated/subset counts are not an aggregate unique-test total. The complete changed-check plan, keyless i18n verification, formatting, typed lint, and stylelint passed. Independent Codex autoreview was scoped-clean at its configured P0 threshold.Real-Gateway browser proof: the same six cases passed before and after against an isolated loopback Gateway, with synthetic state and no provider/channel credentials: English precondition; default New Session startup; cold search before config-page import followed by Updates and English→French→English; direct Updates navigation; English fallback under a deliberately partial foreign-locale response; and readable recovery under a deliberately rejected page module. The two fault cases altered only browser responses, not source or generated files. The after network trace contains no Settings-copy asset during default boot; the copy arrives with the existing lazy Settings graph. Screenshots and recordings were inspected.
This proves the catalog/loading change, not installed-upgrade recovery. The isolated source checkout's unavailable upstream status is visible in some screenshots; no
update.runrequest was sent. Early recording setup retries corrected HTTP readiness and two locator assumptions; the final complete before/after runs passed. Owned Gateways were stopped after capture.Production/tooling: +428/-455 (net -27); tests: +240/-32 (net +208, discounting the integration-test move); guide: +2/-1. The 263-string relocation is a move, not new copy. Duplicated source-path lists, wrapper loaders, and the obsolete dynamic English-loader helper were removed.
CI follow-up: run 33500266070 passed the build, catalog, and all three UI unit shards, but UI E2E shard 4/14 exposed an outdated test classifier: it counted
en-settings.tsas a foreign locale because onlyen.tsanden-agents.tswere excluded. Commitd925b8f71ae01a0429384e11021ecc91e054fcc9changes only that test to use the existing locale registry. It preserves the zero-before-selection and one-request-per-selected-locale assertions; there is no production change after the measured/live-tested commit. The failure reproduced locally, then both locale E2E cases and the classified changed checks passed. The test-only correction also passed a fresh scoped P0 Codex autoreview.Core CI follow-up: run 33501871081 cleared the UI failure but timed out in the pre-existing OpenRouter integration setup, before its five tests. That setup cold-loaded an inactive plugin registry and discarded the provider; it also failed to supply the real hook to the loaded-only classifier. Commit
12b5ace4d76e0ad4ebd2759a82981d5eec4941adrepairs only the test fixture using existing public plugin loading, real registration and request-scoped registry helpers. It removes the 300-second warm-up override, preserves the HTTP/SSE assertions and unit-fast lane, and adds a key-limit billing case that fails with the old setup (auth) and passes with the real hook (billing). No production code changes. Node 24.20.0 affected/sibling proof passed 163 tests in five files; the changed-file gate and a fresh scoped P0 Codex review passed. The complete core CI shard still runs on the new head before landing.Integration ownership correction: run 33504931713 passed the classification tests but caught the new fixture's wrong location with the extension-boundary guard. The suite now lives at
test/plugins/openrouter-error-classification.integration.test.ts, beside existing cross-plugin/core integration tests. Its six HTTP/SSE bodies and scoped real-provider setup are unchanged; there is no guard exemption, alias, duplicated suite or lost CI selection. The explicit boundary test reproduced the failure before the move and passed afterward. Final Node 24 boundary/sibling/scope proof passed 180 tests; staged changed checks, root types, explicit type-aware lint and a fresh scoped P0 review passed. Executed local/full/compact/changed CI planners each select the new test once. Automatic root-test lint on current main is already owned by #135123 — lint changed root tests, so no lint-policy change is added here.ClawSweeper disposition: the completed review found no code/security findings. Its missing-current-main evidence was supplied from a full, non-promisor checkout at
ebd3f9a7a9ce39007570a48e99850528e959d4ea: the only drift within changed source paths was unrelated eager attention/Mermaid copy; no Settings subtree or catalog-owner change was already present. The generic stored-data-model flag does not apply: this is host-side catalog composition, with no runtime store/schema or serialized-format change; ordered source and translation-memory alias contracts were independently checked. Maintainer review is complete; exact-head green CI and native prepare/merge remain required.Representative exact local validation commands
node scripts/run-vitest.mjs ui/src/pages/config/settings-search.test.ts -t 'loads Settings English only'Inspected before/after screenshots — synthetic local Gateway
Cold Settings search, before loading the destination page:
Preserved Updates introduction and copy (runtime timestamps/status are not a visual redesign):