Skip to content

fix: reduce Control UI startup download for device controls - #164735

Merged
shakkernerd merged 1 commit into
mainfrom
fix/devices-english-loading
Oct 4, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
fix/devices-english-loading

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Related: #121497

What Problem This Solves

The Control UI initial JavaScript payload exceeds its startup budget while including device inventory, binding and execution-policy copy needed only by lazy Devices views.

User Impact

The initial download is 1,993 gzip bytes smaller in matched builds, bringing it below the existing limit. Devices controls, translated fallback text and pairing error messages keep their existing behavior. No user action is required.

Why This Change Was Made

Move device-only English copy into the existing lazy Devices catalog and register it synchronously in its consumers. Keep the four pairing-trigger and load-failure strings eager, preserve the shared catalog objects and leave anchors in the original key positions. This uses the existing loading boundary without changing budgets, preload hints or translation text.

The resulting startup margin is 857 bytes. Total gzip JavaScript across all routes grows by 390 bytes because of the different compression boundary; the improvement is in when bytes load. This is a focused reduction related to #121497, not a resolution of that issue's broader budget-policy question.

Evidence

Matched builds with fixed identity measured initial JS at 374,590 → 372,597 bytes against a 373,454-byte limit. Ready /new and /chat payloads also decreased, with unchanged request counts and CSS. The standalone performance check changed from failing to passing.

The fully composed English catalog is byte-identical. All 133 existing tests across nine Devices and pairing files passed on the Cloud Mac in 6.97 seconds. The i18n verifier passed; a focused fallback check covered all 161 moved strings, eager pairing text, selected-locale preservation and idempotent registration. Cold and authorized warm route captures produced identical before/after module manifests.

This changes download composition rather than visible UI behavior; byte accounting, route captures and rendering tests provide the relevant before/after evidence.

Focused Cloud Mac validation also passed formatting, changed-source lint, style checks and the UI type graph (30.2 seconds). Hosted CI passed all three UI unit shards, both real-Gateway UI suites, the mocked UI suite, performance, lint, types, dependency and architecture checks.

The exact PR head also passed hosted performance validation at 372,600 startup gzip bytes. A fresh production build of this patch composed with main b72a95e3 passed the strict checker at 372,594 bytes (860 bytes below the limit), preserving 8 initial requests and 25/30 ready New/Chat requests.

CI also exposed two inherited failures: the suppression inventory omitted two existing assertions, and the mock-export baseline reader hit ENOBUFS. Both were reproduced on unmodified main. The inventory repair is already on main and passes its eight relevant tests with this patch; the buffer repair is tracked separately in #164743. The CI aggregate and its mirrored status reflect those failures. Landing uses the documented inherited-failure exception, preserving the failed results.

@clawsweeper

clawsweeper Bot commented Oct 4, 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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 11:26 PM ET / October 4, 2026, 03:26 UTC.

ClawSweeper review

What this changes

The PR moves device-control English text into the existing lazy Devices catalog and registers it before its consumers render, reducing the Control UI startup download.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful, focused performance fix absent from current main. No actionable introduced defect was found, and the member-authored PR is protected from automatic closure.

Likely related people: Peter Steinberger and Nehanth Narendrula, both unverified routing candidates.

Priority: P2
Reviewed head: 5a9b73f4ecabfd0e9c1ac01957bf3cea0c69f153

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused extension of an established loading pattern with useful reported validation and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored PR. Its body reports matched production builds and cold/warm route captures for the changed catalog-loading boundary; this review did not independently execute them. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored PR. Its body reports matched production builds and cold/warm route captures for the changed catalog-loading boundary; this review did not independently execute them. No stored-data contract changes.
Evidence reviewed 8 items Pinned introduced change: Reviewed the merge-base-to-head delta. It relocates existing English copy and adds synchronous registration to eight Devices consumers; it does not alter permissions, action dispatch, dependencies, or performance budgets.
Lazy loading and fallback boundary: The Devices route dynamically imports its page. Registration preserves the shared devices and pairing objects, while translation lookup reads the shared English fallback. Production references to the moved namespaces are confined to Devices consumers; eager pairing labels remain available to sidebar, configuration, and loading-shell consumers.
Current main still needs this extraction: At fetched main, the Devices registrar contains pairing and capability copy, while inventory, bindings, read-only notices, and execution-approval copy remain eager in en.ts. The relevant paths have no base-to-fetched-main changes, so the proposed extraction is not already implemented there.
Findings None None.
Security None None.

How this fits together

The Control UI loads shared English text at startup and additional catalogs when optional pages open. Devices views use those catalogs to label inventory, bindings, approval controls, and dialogs.

flowchart TD
  A[Control UI startup] --> B[Shared English catalog]
  B --> C[Pairing trigger and loading messages]
  D[Open Devices page] --> E[Load Devices catalog]
  E --> F[Register English fallback text]
  F --> G[Render device controls]
  B --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +29. Total +29 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 10 210 181 +29
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 210 181 +29

Review metrics

Metric Value Why it matters
Reported startup headroom 1,993 gzip bytes saved; 857 bytes below the existing limit The matched-build result restores startup margin without changing budget policy.

Technical review

Best possible solution:

Keep device-only copy behind the existing lazy loading boundary while preserving eager pairing feedback and the complete ordered translation catalog.

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

No independent runtime reproduction was performed. The PR records a concrete matched-build performance failure and improvement, and source inspection confirms the eager-copy loading path.

Is this the best way to solve the issue?

Yes: extending the existing lazy Devices catalog is a focused solution that preserves shared fallback lookup, pairing startup feedback, and catalog composition.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 47206579b8e2.

Labels

Label changes:

  • add P2: This is a bounded startup-performance improvement with preserved device-control behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored PR. Its body reports matched production builds and cold/warm route captures for the changed catalog-loading boundary; this review did not independently execute them. No stored-data contract changes.

Label justifications:

  • P2: This is a bounded startup-performance improvement with preserved device-control behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored PR. Its body reports matched production builds and cold/warm route captures for the changed catalog-loading boundary; this review did not independently execute them. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: Reviewed the merge-base-to-head delta. It relocates existing English copy and adds synchronous registration to eight Devices consumers; it does not alter permissions, action dispatch, dependencies, or performance budgets. (ui/src/i18n/locales/en-devices.ts:268, 5a9b73f4ecab)
  • Lazy loading and fallback boundary: The Devices route dynamically imports its page. Registration preserves the shared devices and pairing objects, while translation lookup reads the shared English fallback. Production references to the moved namespaces are confined to Devices consumers; eager pairing labels remain available to sidebar, configuration, and loading-shell consumers. (ui/src/pages/devices/route.ts:38, 5a9b73f4ecab)
  • Current main still needs this extraction: At fetched main, the Devices registrar contains pairing and capability copy, while inventory, bindings, read-only notices, and execution-approval copy remain eager in en.ts. The relevant paths have no base-to-fetched-main changes, so the proposed extraction is not already implemented there. (ui/src/i18n/locales/en.ts:714, 47206579b8e2)
  • Ordered catalog composition: The existing host-side catalog owner already composes registerDevicesEnglish.catalog recursively. Empty anchors retain subtree positions, and the patch keeps the four eager pairing strings and their namespace intact. (scripts/lib/control-ui-i18n-catalog.ts:194, 5a9b73f4ecab)
  • Reported performance evidence and tradeoff: The complete supplied PR body reports matched-build startup gzip of 374,590 to 372,597 bytes against a 373,454-byte enforcement limit, unchanged route request counts and CSS, identical cold/warm module manifests, byte-identical composed English, and 133 passing existing tests. It explicitly discloses a 390-byte increase across all routes. These are contributor-reported results, not checks executed by this review. (5a9b73f4ecab)
  • Related work remains broader: Control UI startup JS gzip budget is saturated (0 headroom) — needs deliberate re-baseline or startup-chunk diet #121497 remains open and asks for a deliberate startup-budget policy or loading decision. The supplied PR body explicitly describes this as a focused reduction rather than resolution of that broader question.

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Nehanth Narendrula: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@shakkernerd shakkernerd self-assigned this Oct 4, 2026
@shakkernerd
shakkernerd merged commit 8bae5df into main Oct 4, 2026
121 of 147 checks passed
@shakkernerd
shakkernerd deleted the fix/devices-english-loading branch October 4, 2026 03:41
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Improved: Control UI startup downloads less device-only English copy while preserving Devices and pairing behavior.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
Load device-only English copy with the existing lazy Devices views while preserving pairing messages and translation fallback behavior.

Refs openclaw#121497.
RomneyDa pushed a commit that referenced this pull request Oct 8, 2026
Load device-only English copy with the existing lazy Devices views while
preserving pairing messages and translation fallback behavior.

Backport to 2026.10.1 to repair the unchanged startup gzip ceiling:
374776 B before, 372781 B after, 373454 B limit; 8 requests unchanged.
The complete ordered English catalog retains all 10315 key/text entries.
113 existing Devices and i18n tests pass; fresh P0-P2 review is clean.

(cherry picked from commit 8bae5df)
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 P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant