Repository navigation
fix(ui): Control UI blank page behind Cloudflare Rocket Loader - #136129
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 4, 2026, 9:59 AM ET / 13:59 UTC. ClawSweeper reviewWhat this changesThe PR marks Control UI boot scripts to bypass Cloudflare Rocket Loader and makes the production Vite build retain that marker on every emitted script. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 3 items remain Keep open: the focused repair appears correct and has supplied browser proof, but the exact-head Priority: P1 Review scores
Verification
How this fits togetherThe Control UI is a Vite-built browser client served with the Gateway. Its HTML boot scripts must run so the browser can load the application and connect chat to the Gateway. flowchart LR
A[Control UI HTML] --> B[Vite production build]
B --> C[Built script tags]
C --> D[CDN script optimizer]
D --> E[Browser boot]
E --> F[Gateway chat interface]
B --> G[Build regression test]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +9, Tests +11. Total +20 across 3 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain one build-only output transform that preserves the CDN opt-out on all emitted boot scripts, keep the emitted-HTML regression test, and merge only after exact-head CI is green. Do we have a high-confidence way to reproduce the issue? Yes: the supplied current-main production-build and Rocket Loader transform/browser scenario is concrete, and current source confirms the three boot scripts remain unmarked; this read-only review did not repeat the deployment. Is this the best way to solve the issue? Yes: placing the final HTML marking in the existing build-output owner covers both authored inline scripts and Vite-emitted module scripts without adding a runtime fallback or configuration surface. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 20c870265f14. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
efbc9a8 to
36cc735
Compare
Rocket Loader defers and rewrites every script it is not told to skip, so the Control UI boot scripts never evaluate when the gateway is served through a Cloudflare tunnel on a zone with Rocket Loader enabled. The page returns 200, the shell paints, the mount fallback appears, and nothing throws — a silent failure with no path from symptom to cause. Marks all three boot scripts in ui/index.html with the documented data-cfasync="false" opt-out, and adds a build-only, post-order transformIndexHtml plugin so the attribute survives the production build: vite:build-html discards the authored module entry tag and synthesizes a new one from a fixed attribute set, which would have dropped the opt-out silently while dev kept working. Fixes openclaw#135683
36cc735 to
6eb9de2
Compare
Follow-up proof: Control UI boot behind Rocket LoaderThe primary proof is the emitted production <!-- main baseline -->
<script>
<script type="module" crossorigin src="./assets/index-C07oPoOm.js">
<script>
<!-- PR -->
<script data-cfasync="false">
<script data-cfasync="false" type="module" crossorigin src="./assets/index-DG1SfJJa.js">
<script data-cfasync="false">The PR's build-only, post-order transform in CapturesBoth builds were served through the same deterministic Rocket Loader transform and the same mocked Gateway at desktop 1440×900 and mobile 390×844. The PR and Gateway build IDs matched, the optional community invitation was disabled, and every frame was opened at original resolution. No capture contains an authentication, server-update, refresh, connection-error, or disconnected banner. Main baseline, desktop 1440×900: all three unmarked scripts are deferred, so the application does not mount. PR, desktop 1440×900: the connected chat, assistant message, navigation, and composer are visible without a banner. Main baseline, mobile 390×844: all three unmarked scripts are deferred, so the application does not mount. PR, mobile 390×844: the connected chat, assistant message, and composer are visible with the drawer closed and no banner. The accessibility rerun produced byte-identical PNGs: Request tracesBoth PR viewports reached Accessibility dumpsThe baseline body's accessibility snapshot is empty at both 1440×900 and 390×844. The PR's mounted main region produced these snapshots. Desktop 1440×900: - main:
- button "Rename session Main": Main
- group:
- button "Show background tasks":
- img
- button "Side panel":
- img
- button "Open split view":
- img
- button "Actions for Main":
- img
- log:
- status
- paragraph: Control UI boot verified through the mock Gateway.
- text: OpenClaw
- time: 2h ago
- button "Reply to message":
- img
- button "Copy as markdown"
- textbox "Chat composer":
- /placeholder: Message OpenClaw
- status
- status
- button "Add attachment":
- img
- 'button "Permissions: Default"': Default
- group: gpt-5.5
- group: "Off"
- button "Start voice input":
- img
- button "Microphone input":
- img
- button "Write a message to send." [disabled]:
- imgMobile 390×844: - main:
- button "Expand sidebar":
- img
- button "Rename session Main": Main
- group:
- button "Actions for Main":
- img
- log:
- status
- paragraph: Control UI boot verified through the mock Gateway.
- text: OpenClaw
- time: 2h ago
- button "Reply to message":
- img
- button "Copy as markdown"
- textbox "Chat composer":
- /placeholder: Message OpenClaw
- status
- status
- button "Add attachment":
- img
- 'button "Permissions: Default"'
- group: gpt-5.5
- group
- button "Dictation":
- img
- button "Tap to talk":
- imgVerification and LOC
The positive production delta is the final-output invariant that cannot be expressed in the authored HTML alone: Vite discards the authored module tag. The repair is absorbed into the existing Control UI build-output owner, which already stamps the built HTML and assets; it adds no runtime branch, configuration, environment variable, compatibility path, or separate production module. Risk and coverage
Provenance
|
|
Merged via squash.
|
…law#136129) * fix(ui): Control UI blank page behind Cloudflare Rocket Loader Rocket Loader defers and rewrites every script it is not told to skip, so the Control UI boot scripts never evaluate when the gateway is served through a Cloudflare tunnel on a zone with Rocket Loader enabled. The page returns 200, the shell paints, the mount fallback appears, and nothing throws — a silent failure with no path from symptom to cause. Marks all three boot scripts in ui/index.html with the documented data-cfasync="false" opt-out, and adds a build-only, post-order transformIndexHtml plugin so the attribute survives the production build: vite:build-html discards the authored module entry tag and synthesizes a new one from a fixed attribute set, which would have dropped the opt-out silently while dev kept working. Fixes openclaw#135683 * refactor(ui): consolidate Control UI build output transforms --------- Co-authored-by: Grynn <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]>




Fixes #135683
What Problem This Solves
Operators serving the Control UI through Cloudflare with Rocket Loader enabled can receive HTTP 200 and still see a blank page. Rocket Loader defers unmarked scripts, so the module entry never evaluates, the app does not mount, and the browser has no useful application error. This is a silent failure on the default Control UI boot path.
Why This Change Was Made
Cloudflare's documented per-script opt-out is
data-cfasync="false". The three authored boot scripts now carry that marker.Authored markup alone is insufficient: pinned Vite 8.2.2 replaces the module entry with a synthesized
<script type="module">tag duringvite:build-html, dropping attributes from the source node. The existingcontrol-ui-build-outputplugin now finalizes every emitted script tag in a post-ordertransformIndexHtmlhook, after Vite has synthesized the entry tag. The same owner continues to stamp the public-asset build ID, avoiding a second output-rewrite plugin and test-only export.This uses Cloudflare's standard, free opt-out and Vite's native HTML-transform contract. It adds no config, environment variable, runtime fallback, gateway rewrite, or Cloudflare dashboard step.
User Impact
The built Control UI boots normally when Rocket Loader is active. Outside Cloudflare,
data-cfasyncis inert. Existing public-asset build-ID stamping, precompression, service-worker output, and dev-server behavior remain owned by their existing paths.Evidence
Primary artifact proof: built
index.htmlCurrent
mainemits three unmarked script tags:This PR emits the opt-out on all three, including Vite's synthesized module entry:
The build regression test uses both an inline classic script and a module entry, then requires
data-cfasync="false"to be the first attribute on every emitted opening tag. This preserves Cloudflare's requirement that the marker precedesrc.Before and after through the built UI
The same deterministic Rocket Loader transform was applied to production builds from current
mainand this PR. It rewrites every unmarked script totype="text/rocketscript", matching the documented defer boundary. Chromium then loads/chatwith the repository mock Gateway. The after captures are taken only afterconnectandchat.startup, a rendered assistant message, and a visible composer; they contain no update, auth, connection-error, or promotional banner.Before at 1440×900, current

mainhas all three scripts deferred, no Gateway traffic, and a blank body.In this PR at 1440×900, no script is deferred and the connected chat view visibly renders its mock Gateway message and composer.

Before at 390×844, current

mainhas all three scripts deferred, no Gateway traffic, and a blank body.In this PR at 390×844, no script is deferred and the connected mobile chat view visibly renders its mock Gateway message and composer with the drawer closed.

Verification
OPENCLAW_VITEST_MAX_WORKERS=2 pnpm check:changedpassed every selected lane: conflict markers, suppression ratchets, dependency and patch guards, formatting, temp-file policy, i18n, core-test and UI typechecks, coercion declarations, all dead-export scans, core lint, and changed UI style lint. The linked worktree used the canonical checkout's existing binaries onPATH; no dependency install or reconciliation was performed.Uncommitted review over the full PR range found no accepted P0/P1 findings.
Risk and coverage
Production LOC: +19/−10 (net +9); tests: +12/−1. The production growth is the smallest owner-level expression found after folding the repair into the existing output transform; the earlier standalone plugin and its test-only seam were removed.
Provenance
Reported in #135683 and originally implemented in this PR by @Grynn. The contributor commit and authorship are preserved; the maintainer follow-up rebases it onto current
mainand consolidates the output transform.