fix(control-ui): retry bundle fetch and improve restart diagnosis (#99092)#99172
fix(control-ui): retry bundle fetch and improve restart diagnosis (#99092)#99172jtcole wants to merge 1 commit into
Conversation
…9092) When the gateway restarts, the Control UI's JS bundle fails to load. The 'Keep waiting' button only re-armed a 12s timer without retrying the fetch, and the error message blamed browser extensions instead of 'gateway is restarting.' Only a full page reload could fix it. Changes to ui/index.html inline fallback script: - Add gateway reachability probe (fetch location.href) to distinguish 'gateway restarting' from 'module blocked by extension' - Make 'Keep waiting' re-fetch the JS bundle with exponential backoff (5 retries: 2s, 4s, 8s, 16s, 32s) instead of just re-arming the timer - Branch the fallback dialog text based on probe result: - Unreachable gateway: 'Control UI is starting up' with restart guidance - Reachable gateway: original 'Control UI did not start' with extension guidance - Add retry status indicator below the action buttons - Keep 'Try again' (full reload) as a manual escape hatch - Reset probe state on each retry sequence so re-probe works Tests (ui/src/ui/mount-fallback.test.ts): - Original test updated to install fetch mock for probe compatibility - New: re-fetches bundle when 'Keep waiting' is clicked - New: shows 'starting up' message when gateway probe is unreachable - New: shows 'did not start' message when gateway is reachable - New: attempts bundle fetch at least once during retry sequence Fixes #99092
|
Codex review: needs real behavior proof before merge. Reviewed July 2, 2026, 1:05 PM ET / 17:05 UTC. Summary PR surface: Source +158, Tests +234. Total +392 across 2 files. Reproducibility: yes. Source inspection shows current main's Keep waiting only re-arms the fallback timer, and the PR's new retry only fetches a URL without executing the module that defines openclaw-app. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Revise this PR so Keep waiting loads the actual built module script and proves recovery in a real built Control UI, while keeping the linked issue open until a corrected fix lands. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main's Keep waiting only re-arms the fallback timer, and the PR's new retry only fetches a URL without executing the module that defines openclaw-app. Is this the best way to solve the issue? No. The narrow fallback-recovery direction is right, but this implementation should load the actual built module script and prove real recovery instead of only fetching /src/main.ts. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3f289fdb4042. Label changesLabel justifications:
Evidence reviewedPR surface: Source +158, Tests +234. Total +392 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
|
Superseded by #99111, landed as f36f3f3. The landed fix uses one bounded canonical recovery path: probe a cache-busted current document, then replace the unmounted page once the Gateway is reachable. That recovers both transient restart failures and stale app/Gateway asset hashes without repeatedly injecting a module graph into a partially initialized page. Focused unit/CSP coverage and a real Chromium run proved first-module 503 → one fresh-document navigation → full chat mount, with no reload loop. Thanks @jtcole for the diagnosis and proposal. |
Summary
When the gateway restarts, the Control UI's JS bundle fails to load. The "Keep waiting" button only re-armed a 12s timer without retrying the fetch. The error message blamed browser extensions instead of "gateway is restarting." Only a full page reload could fix it.
Changes
ui/index.html— inline fallback scriptwindow.location.hrefto distinguish "gateway restarting" from "module blocked by extension"/src/main.ts) with exponential backoff — 5 retries at 2s, 4s, 8s, 16s, 32s — instead of just re-arming the timerui/src/ui/mount-fallback.test.tsTest
All 6 tests pass.
Fixes #99092