Skip to content

fix(ui): stop dismissed lazy retries from reloading the page - #130988

Merged
steipete merged 2 commits into
mainfrom
codex/sweep-lazy-shell-retry-20260827
Aug 27, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/sweep-lazy-shell-retry-20260827

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #127733 (the separate storage-denied handoff gap remains unresolved).

What Problem This Solves

Fixes an issue where users who pressed Retry on a failed lazy-loaded panel could close the dialog or choose another action, then unexpectedly have the entire page reload when the earlier reachability probe finished. The retired request could also replay an obsolete saved action.

Why This Change Was Made

The lazy request controller now carries its current-request check through the asynchronous document probe. The shell action owner permits navigation only while the same request and pending event still own recovery and the exact event was successfully saved for replay. The URL-owned standalone document paths retain their existing recovery behavior.

The saved-action writer reports actual persistence success and clears an obsolete record after a failed replacement. This removes the separate raw-presence predicate that treated unavailable storage as a saved action, reuses the shared guarded storage accessor, and derives the event type from its existing canonical list. Production is +44/-54 (net -10); tests are +286/-6.

User Impact

Close and replacement actions remain authoritative while Retry waits for the Gateway. A dismissed request cannot later navigate the page or replay an old panel action. With working storage, an active action still reloads into the fresh UI and replays once.

When the action cannot be saved, recovery retains the visible error and in-memory intent rather than navigating without it. This is an explicit change to degraded behavior. It does not solve permanently retired assets when session storage is denied: two real Retry clicks in that case still show the error; Close clears the pending action. #127733 remains the named follow-up for an action-preserving cross-document handoff. No new URL, cookie, storage format or alternate handoff is introduced here.

Evidence

  • Before the repair, the owner regression selection had 11 failures and 80 passes. The real browser Retry-then-Close scenario made a second document request. The final candidate passes 91 owner tests and all five fresh-bundle browser cases; that dismissed Retry makes only one document request.
  • Browser cases exercise real Chromium, HTTP asset requests and reachability probes with the canonical synthetic Gateway fixture. They cover cancellation and replacement as well as working recovery paths. They do not claim native WebKit or a live provider.
  • An additional permanent-old-hash check keeps the old module URL at 404. With working storage, a fresh document serves a different module hash, opens the command palette once and clears saved intent. With denied storage, it preserves the exact pending object and visible error without reloading; this is limitation proof, not successful recovery proof.
  • Both production builds pass unchanged startup budgets with eight startup requests. The actual-identity build measures 342,591 gzip bytes against the existing 344,620-byte enforcement limit. No payload reduction is claimed; the controlled comparison adds 162 raw startup bytes and 959 total-JavaScript gzip bytes.
  • All 21 selected changed checks pass. Fresh cumulative Codex autoreview has no P0 findings; independent ownership and storage-failure review found no actionable issue in the cancellation fix. The broader handoff limitation above is retained explicitly.

Baseline stale-module dialog before the interaction (synthetic test data):

Baseline stale-module dialog

Candidate after Retry then Close: the original document remains visible; the request count, rather than the still image alone, proves no later reload:

Candidate retains the document after Retry then Close

@steipete steipete self-assigned this Aug 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 27, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. 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 Aug 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 11:02 AM ET / 15:02 UTC.

ClawSweeper review

What this changes

The PR prevents a dismissed or replaced lazy-panel retry from later reloading the Control UI and replaying an obsolete action.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open: current main still reloads after a successful stale-retry probe without checking whether the lazy request was dismissed, while this branch carries that ownership check through the probe and persistence boundary. No concrete patch defect was found; exact-head CI is still running and the protected maintainer item must remain open for normal landing review.

Priority: P1
Reviewed head: 05a426bb691eecd3b3567428db46bd68beb8b40b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative owner-boundary repair with substantial targeted coverage; completion of exact-head browser and CI checks remains the material merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the contributor proof gate; its body nevertheless reports real Chromium and HTTP-asset scenarios, with linked screenshots unavailable to this review environment.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the contributor proof gate; its body nevertheless reports real Chromium and HTTP-asset scenarios, with linked screenshots unavailable to this review environment.
Evidence reviewed 7 items Current-main defect: The current-main controller invokes stale recovery without a request-ownership predicate, and the helper reloads after any successful eventual probe; a Close or replacement during that await cannot prevent the reload.
Owner-boundary repair: The branch makes the lazy controller retain the retry request identity, then has the shell owner require both that identity and successful persistence of the exact pending action before navigation.
Late reload guard: The shared recovery helper rejects a retired request both before probing and immediately before its only reload side effect, covering a Close or replacement that occurs while the probe is pending.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs ui/src/app/lazy-shell-action.test.ts ui/src/app/lazy-custom-element.test.ts ui/src/app/stale-chunk-reload.test.ts

Result: PASS (completed)

[test] starting test/vitest/vitest.ui.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130988-SEG2lY/target

 ✓  ui  ui/src/app/lazy-custom-element.test.ts (11 tests) 44ms
 ✓  ui  ui/src/app/stale-chunk-reload.test.ts (31 tests) 93ms
stderr | ui/src/app/lazy-shell-action.test.ts › shell lazy events › does not reload a retired retry after new-request while the document probe is pending
Element openclaw-app-shell scheduled an update (generally because a property was set) after an update completed, causing a new update to be scheduled. This is i
nefficient and should be avoided unless the next update can only be scheduled as a side effect of the previous update. See https://lit.dev/msg/change-in-update
for more information.

 ✓  ui  ui/src/app/lazy-shell-action.test.ts (15 tests) 888ms

 Test Files  3 passed (3)
      Tests  57 passed (57)
   Start at  15:03:26
   Duration  4.67s (transform 3.49s, setup 404ms, import 2.96s, tests 1.02s, environment 2.54s)

[test] passed 1 Vitest shard in 5.22s

Assertions:

  • PASS expect_output: Tests

How this fits together

The Control UI lazily loads optional panels and recovers from stale deployed bundles. A retry probes Gateway reachability, persists the pending panel action when possible, and reloads only while that same action still owns recovery.

flowchart LR
  A[Lazy panel load fails] --> B[Recovery dialog]
  B --> C[Retry request]
  C --> D[Gateway reachability probe]
  D --> E{Request still owns recovery}
  E -->|Yes| F[Persist pending action]
  F --> G[Reload and replay action]
  E -->|No| H[Keep current document]
Loading

Before merge

  • Resolve merge risk (P1) - In storage-denied or quota-failed browsers, Retry now deliberately stays in the current document and retries in place rather than reloading; exact-head Chromium coverage should confirm this degraded-mode contract before merge.
  • Resolve merge risk (P1) - The review environment could not resolve GitHub to inspect linked screenshots or the latest bot comment, although the PR body reports Chromium evidence; this is reviewer-side uncertainty, not a contributor proof request.
  • Resolve merge risk (P1) - Required UI and exact-head checks were still in progress in the supplied PR state.
  • Complete next step (P2) - This is an active maintainer-owned PR with a coherent implementation; the remaining action is normal exact-head CI and merge review, not an automated repair job.
Agent review details

Security

None.

PR surface

Source -10, Tests +280. Total +270 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 5 44 54 -10
Tests 4 286 6 +280
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 330 60 +270

Review metrics

Metric Value Why it matters
Production versus test delta production +44/-54 (net -10); tests +286/-6 The fix reduces production code while adding owner, helper, and Chromium regression coverage for the cancellation invariant.

Stored data model

Persistent data-model change detected: serialized state: ui/src/app/lazy-shell-action.ts, serialized state: ui/src/app/stale-chunk-reload.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Verify the storage-denied recovery contract (recommended)
    Run the focused exact-head Chromium recovery path for Retry followed by Close and for unavailable session storage before merging.
  2. Accept the documented degraded mode
    Merge with the intentional behavior that a retry without persistent replay state remains in the current document instead of navigating away.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Run the focused Control UI Chromium recovery test on the exact head, including session-storage denial and Retry followed by Close.

Technical review

Best possible solution:

Keep the two-stage request-identity and persistence predicate at the shell action owner, land after the focused browser checks pass, and keep the separate storage-denied cross-document handoff work with #127733.

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

Yes, from source: current main starts a stale retry without request ownership and reloads once its asynchronous reachability probe succeeds. The added owner and Chromium scenarios encode Retry followed by Close, replacement, context change, and disconnect, but were not executed in this read-only review.

Is this the best way to solve the issue?

Yes. Moving the decision to the shell action owner lets the shared reload helper remain reusable for URL-owned paths while requiring current request identity and successful action persistence immediately before navigation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5090935817e3.

Labels

Label changes:

  • add P1: A stale-panel Retry can unexpectedly reload the whole Control UI and replay an obsolete requested action for affected operators.
  • add merge-risk: 🚨 compatibility: The PR intentionally changes Retry behavior when session storage cannot preserve the pending action, affecting existing storage-restricted browser and webview setups.
  • 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: This maintainer-authored PR is exempt from the contributor proof gate; its body nevertheless reports real Chromium and HTTP-asset scenarios, with linked screenshots unavailable to this review environment.

Label justifications:

  • P1: A stale-panel Retry can unexpectedly reload the whole Control UI and replay an obsolete requested action for affected operators.
  • merge-risk: 🚨 compatibility: The PR intentionally changes Retry behavior when session storage cannot preserve the pending action, affecting existing storage-restricted browser and webview setups.
  • 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: This maintainer-authored PR is exempt from the contributor proof gate; its body nevertheless reports real Chromium and HTTP-asset scenarios, with linked screenshots unavailable to this review environment.

Evidence

What I checked:

  • Current-main defect: The current-main controller invokes stale recovery without a request-ownership predicate, and the helper reloads after any successful eventual probe; a Close or replacement during that await cannot prevent the reload. (ui/src/app/lazy-custom-element.ts:145, 5090935817e3)
  • Owner-boundary repair: The branch makes the lazy controller retain the retry request identity, then has the shell owner require both that identity and successful persistence of the exact pending action before navigation. (ui/src/app/app-shell-chrome.ts:696, 05a426bb691e)
  • Late reload guard: The shared recovery helper rejects a retired request both before probing and immediately before its only reload side effect, covering a Close or replacement that occurs while the probe is pending. (ui/src/app/stale-chunk-reload.ts:210, 05a426bb691e)
  • Behavior coverage: The owner tests cover Close, context replacement, disconnect, and a new request during a held document probe; the Chromium test asserts that Retry then Escape leaves exactly one document request and clears stored intent. (ui/src/app/lazy-shell-action.test.ts:152, 05a426bb691e)
  • Sibling boundary: URL-owned route and plugin-panel retries call the shared recovery helper directly but do not own a persisted shell action, so the shell-specific predicate does not alter their existing reload flow. (ui/src/app/router-outlet.ts:80, 05a426bb691e)
  • Feature history: The stale lazy-surface recovery area was established and subsequently maintained through several Control UI fixes, including the failed-lazy-surface and newer-build recovery work. (ui/src/app/stale-chunk-reload.ts:201, 5eda48ed9996)

Likely related people:

  • steipete: Peter Steinberger authored the prior stale-chunk and failed-lazy-surface recovery work and the current branch refinement. (role: feature owner and recent area contributor; confidence: high; commits: c59d07b9a833, f5940ee92dcc, 5eda48ed9996; files: ui/src/app/stale-chunk-reload.ts, ui/src/app/lazy-custom-element.ts, ui/src/app/app-shell-chrome.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let the focused exact-head UI and Chromium checks complete, including the storage-denied degraded path.

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.

@steipete

Copy link
Copy Markdown
Contributor Author

The final published head is 05a426bb691eecd3b3567428db46bd68beb8b40b. CI run 33085084072 is completed successfully, and fresh GitHub mergeability is clean. The exact cumulative patch matches the final 91 owner tests, five fresh production-bundle Chromium scenarios, both production builds, all 21 changed checks, and independent review.

I read the completed ClawSweeper review and its rank-up list. The requested storage-denied and Retry-then-Close browser checks already completed against this exact source: dismissed recovery stays at one document request, while a current action with working storage reloads and replays once. Additional real Chromium/HTTP proof permanently retires the old asset: denied storage retains the visible error and exact pending action through two Retry clicks, and Close clears it; working storage loads a fresh document and new module hash and replays once. Screenshots use only synthetic fixtures. Native WebKit and live-provider behavior are not claimed.

This intentionally preserves the current document when the action cannot be persisted. It does not solve cross-document recovery with denied storage, and #127733 remains open for that separate handoff problem. The stored action format is unchanged; no URL, cookie, new storage format, or compatibility path was introduced. The owner repair removes 10 net production lines. Native preparation and merge remain the final gates.

@steipete
steipete merged commit 233f1f0 into main Aug 27, 2026
122 checks passed
@steipete
steipete deleted the codex/sweep-lazy-shell-retry-20260827 branch August 27, 2026 16:08
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 28, 2026
…w#130988)

* fix(ui): retain lazy recovery ownership through reload

* refactor(ui): simplify pending action dispatch
steipete added a commit that referenced this pull request Oct 14, 2026
…ecovery

Automatic recovery now waits through outages, so closing a failed lazy surface must retire the pending reload for the running build (#130988 contract). Gateway build targets keep their recovery; surfaces still showing a failure re-arm it on render.
steipete added a commit that referenced this pull request Oct 14, 2026
…ed surface

Escape on a pending command palette retires the lazy request through abandon(), not close(), so the dismissal contract (#130988) must live there. A successful in-place retry also abandons and no longer leaves a needless page reload pending.
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 maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. 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