Repository navigation
fix: keep retry controls when lazy recovery views fail - #180646
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e2c3d99f6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <button class="btn" onClick={dismiss}> | ||
| {t("connection.browserSignIn.dismiss")} | ||
| </button> | ||
| <button class="btn" onClick={() => reset()}> |
There was a problem hiding this comment.
Route stale module retries through the reload owner
When RecoveryDialog fails with the production dynamic-import errors caused by a Gateway update or module-fetch outage, this calls reset() and retries the same module URL. Chromium and WebKit can pin that failed import for the document, which is why stale-chunk-reload.ts routes other lazy surfaces through retryStaleChunkReloadWhenReachable; here the button can repeatedly return to the same error until the user manually reloads. The same omission exists in toast-host.tsx:38, while the new vi.doUnmock tests replace the loader and therefore do not exercise the browser module map. Classify error() and use the guarded reload owner before falling back to reset().
AGENTS.md reference: AGENTS.md:L79-L81
Useful? React with 👍 / 👎.
| </openclaw-modal-dialog> | ||
| )} | ||
| > | ||
| <Loading> |
There was a problem hiding this comment.
Retain recovery controls while the retry is pending
When a retry remains pending—for example while the server restarts or a slow module request is in flight—reset() clears the Errored fallback and this Loading boundary renders nothing, so the browser-auth view loses Retry, Sign in, and Not now until the request settles; toast-host.tsx:52 similarly loses Retry and Dismiss. Existing lazy-dialog patterns observe the lazy child so the error fallback remains mounted during retry, but these tests immediately resolve after doUnmock and never hold the retry promise. Keep the recovery fallback visible throughout the pending attempt.
AGENTS.md reference: AGENTS.md:L79-L81
Useful? React with 👍 / 👎.
|
Codex review: needs maintainer review before merge. What this changesThis PR adds local error fallbacks with Retry, dismissal, and sign-in controls when notification or browser-authentication views fail to load. Example: The browser sign-in dialog module fails to download while an existing conversation is open.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a current recovery failure with focused error boundaries; no actionable introduced defect was established. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI's document-authentication and toast owners supply state and actions to lazy renderers; the new eager fallbacks present recovery controls without taking ownership of that state. flowchart TD
A[HTTP failure or notification] --> B[Existing recovery owner]
B --> C[Lazy renderer]
C --> D[Normal view]
C --> E[Local error fallback]
E --> F[Retry or owner action]
F --> B
Technical reviewBest possible solution: Keep the two local fallbacks around the existing lazy renderers, preserving their current state, dismissal, authentication, and global reload owners. Do we have a high-confidence way to reproduce the issue? Current-main source shows both missing local error boundaries, and the supplied before/after browser fixtures illustrate the resulting missing controls; no target code was executed during this review. Is this the best way to solve the issue? Local error boundaries are the smallest complete containment fix: they retain lazy loading and reuse existing owners without adding state, dependencies, or a parallel recovery manager. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8e6990a1820f. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +59, Tests +95. Total +154 across 4 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 22, 2026, 9:58 AM ET / 13:58 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* fix(ui): keep retry controls when lazy recovery views fail * test(ui): explain isolated lazy-load failure mocks
What Problem This Solves
Fixes notifications and browser sign-in recovery losing their controls when a lazy UI chunk fails to download.
User Impact
The affected surface now offers Retry and dismissal after a load failure; sign-in remains available, and retry preserves the original notice or sign-in progress.
Why This Change Was Made
The two lazy renderers had loading boundaries but no local error boundary, so a rejected import halted their reactive render. Local
Erroredfallbacks keep the existing toast and sign-in owners authoritative. The original renderers remain lazy, and the toast fallback preserves hover/focus dismissal timing.The small eager fallback markup adds 613 B gzip to startup. Both builds remain below the current strict 325,657 B limit, and no additional renderer or library enters startup. Keeping recovery available when a chunk fails requires the fallback to be available before that chunk loads.
Evidence
REACTIVITY_HALTED; both pass with the fixpnpm tsgo:uigit diff --checkpnpm ui:buildand strict performance checksrc/infra/heartbeat-active-hours.tsandsrc/infra/heartbeat-wake-policy.ts(exit 1); no new findingsThe baseline is
f4e384450c45656b76ce9f8831117a5bd94b9bcc. Browser captures use only synthetic content and locally aborted module downloads.Recipe counts in the two production files:
Errored0 → 2;Loading2 → 2; action, optimistic state,affects,refresh,isPending,latest, async memos/projections, and inline error signals all 0 → 0. No outside loading reads or new lifecycle subscriptions were added.Production LOC: 293 → 352 (+59 recovery markup). Test LOC: 0 → 95. No new state owner, abstraction, dependency, translation copy, or compatibility path.
CI correction and attribution
The first full CI run (39786500544) required explicit
mock-isolationexplanations for the two intentionally throwing lazy-module mocks. Commitb4bc21f7568adds those comments; the mock-exports guard passes, and independent review found no actionable issue. Production behavior is unchanged from the tested head.The same run failed
Control UI session management mocked Gateway E2E > nests spawned sessions (personal pin: false)and(personal pin: true). Both reproduce on exact basef4e384450c4, timing out on the same first child “Active run” indicator. The focused baseline command isnode scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/session-management.sidebar.e2e.test.ts --maxWorkers=1 -t 'nests spawned sessions'(2 failures, 83.92s).The forced-colors keyboard-focus case also failed in the first run but passed the focused exact-base and head checks. All three UI unit shards pass in replacement full run 39788863226, resolving it without a production change. Both real-Gateway shards pass. The complete job inventory has two failed root jobs: the two sidebar nesting cases listed above and
Control UI Workboard routing > routes, pins, persists, and normalizes Workboard boards. The Workboard case also reproduces on exact basef4e384450c4, at line 156 waiting for the Workboard title after missing-board normalization (27.41 seconds, one case, one worker). Its test and route inputs match the actual CI baseline and merge. All other jobs passed or were skipped, including every UI unit and both real-Gateway shards.The actual replacement CI checkout is merge
aa2b856eb5250fbfa449eac8b8bace6eb60a621c, with parents09ff7b2adcbc8cce1a11d664c7701d400086039eandb4bc21f7568adf657f59cdb1db78faf1f2e3b453. The sidebar E2E test and child-ordering source blobs match the reproduced exact base, that CI baseline, and the tested merge. Native replacement recovery retains these checkout/failure artifacts and performs the final full-inventory check.Refactor checklist in the touched production files: controller hooks, effects, render effects,
untrack, direct listeners, DOM queries, manual class strings,flush, owner APIs, and componentonCleanupare all 0 → 0;onSettledis 1 → 1 andlazyis 2 → 2. No manual component loader was introduced.Screenshots
Before/after images below show the two failed-download states at 900×650. Successful retry is also exercised in each capture and regression test.