Skip to content

fix(ui): preserve panel actions when session storage is unavailable - #127733

Closed
steipete wants to merge 1 commit into
mainfrom
codex/autoqa-ui-lazy-action-storage-20260822
Closed

steipete wants to merge 1 commit into
mainfrom
codex/autoqa-ui-lazy-action-storage-20260822

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users opening a Control UI panel, command palette, or approval dialog would lose their requested action after retrying a stale UI chunk when browser session storage is unavailable or blocked.

Why This Change Was Made

The lazy-shell action owner treated an unavailable session-storage value as evidence that an action had been persisted. Its caller then selected a full document reload even though no action could survive that reload. A nullish-presence check keeps recovery in the existing in-document retry path unless an action really exists in session storage; no storage format, authentication behavior, configuration, or product contract changes.

User Impact

The requested panel or dialog now opens after the operator retries, including in privacy-restricted browsers and embedded webviews that deny browser storage. Browsers with working storage retain the existing reload-and-replay behavior.

Evidence

  • Before the production edit, three actual regressions failed: unavailable session storage was falsely reported present; a real browser storage SecurityError was falsely reported present; the real shell controller attempted a document reload instead of replaying the requested terminal-panel action.
  • After the one-token owner correction, the existing owner, browser host, lazy controller, stale-chunk recovery, and complete app-host suites all passed: node scripts/run-vitest.mjs ui/src/app/lazy-shell-action.test.ts ui/src/app/app-host.panel-toggles.test.ts ui/src/app/lazy-custom-element.test.ts ui/src/app/stale-chunk-reload.test.ts ui/src/app/app-host.test.ts — 5 files, 84 tests passed.
  • Coverage includes unavailable storage, browser getter denial, failing storage reads, empty storage, a genuinely persisted action, malformed saved actions, and exact-once action replay through the real UI host.
  • Both baseline ratchets, focused formatting, direct lint, independent source review, and fresh authenticated full-branch Codex review passed.
  • Production delta: +1/-1, net zero; regression-test additions are separate. Exact reviewed head: e63bbd805fbad170749520634fc48622c41e6338.
  • This changes recovery behavior without altering layout; the real DOM-host regression is executable evidence, and exact-head hosted UI/browser checks provide the remaining visual-environment coverage.

@clawsweeper

clawsweeper Bot commented Aug 22, 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: S maintainer Maintainer-authored PR labels Aug 22, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 22, 2026
@clawsweeper

clawsweeper Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 4, 2026, 5:18 AM ET / 09:18 UTC.

ClawSweeper review

What this changes

This PR changes Control UI stale-chunk recovery so a missing or blocked session-storage value is not treated as a persisted panel action, with focused shell-action tests.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep open for a maintainer product decision. The branch retains the prior P1 gap: when storage is unavailable, Retry reuses a permanently stale cached import rather than reaching a fresh document, so the requested action can remain inaccessible; the current main replacement is safer but explicitly leaves this cross-document handoff unsolved.

Priority: P1
Reviewed head: e63bbd805fbad170749520634fc48622c41e6338
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The predicate correction is narrow and tested, but it does not deliver the claimed permanent stale-asset recovery path.
Proof confidence 🌊 off-meta tidepool Not applicable: Repository state identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply; the supplied DOM-host evidence remains supplemental and does not demonstrate recovery from a permanently retired asset.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository state identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply; the supplied DOM-host evidence remains supplemental and does not demonstrate recovery from a permanently retired asset.
Evidence reviewed 5 items Introduced retry-selection defect: The introduced nullish check returns false when guarded session storage is unavailable, so the host selects the in-document retry path rather than document recovery.
Caller and retry behavior: At the reviewed head, the host converts a false storage predicate into no reload; the retry controller then reloads the same lazy element only when reload recovery returns false.
Current-main owner boundary: Current main replaced the raw presence predicate with persistence success at the action owner and revalidates the current pending action before a reload; this preserves cancellation ownership but does not create a storage-free handoff.
Findings 1 actionable finding [P1] Preserve recovery for cache-pinned stale imports
Security None None.

How this fits together

Control UI lazy panels record an operator action before loading an on-demand component. When that load fails because an old hashed asset is stale, the retry path either reloads into fresh assets and replays saved intent or retries in the current document.

flowchart LR
  A[Operator opens panel] --> B[Lazy shell action owner]
  B --> C[Try to persist action]
  C --> D[Stale chunk retry]
  D --> E[Reload fresh document and replay]
  D --> F[Retry current lazy import]
  E --> G[Requested panel opens]
  F --> H[Panel opens or stale error remains]
Loading

Decision needed

Question Recommendation
Should Control UI support a privacy-safe cross-document handoff for permanent stale assets when session storage is unavailable? Define a safe handoff: Specify a bounded, privacy-safe action handoff and add permanent-old-hash proof before reworking this branch.

Why: The necessary state must survive a reload without relying on the denied storage surface; choosing its transport and privacy boundary is product and security-sensitive design, not a mechanical repair.

Before merge

  • Preserve recovery for cache-pinned stale imports (P1) - This is the previously reported blocker. With storage unavailable, this predicate makes the host skip document recovery; retry() then retries the same lazy import, so a permanently retired hashed URL remains an error and the requested panel never opens. The merged related repair at fix(ui): stop dismissed lazy retries from reloading the page #130988 correctly protects ownership but explicitly leaves this handoff problem unresolved.
  • Resolve merge risk (P1) - For a permanently cache-pinned stale asset with storage denied, this branch suppresses the only route to fresh asset URLs and leaves the requested action inaccessible after Retry.
  • Resolve merge risk (P1) - The PR is conflict-dirty and has no available pinned test merge, so its current merge result cannot be validated.
  • Complete next step (P2) - Resolve the storage-free handoff direction, then rebase and rework this branch on current main while preserving https://github.com/openclaw/openclaw/pull/130988’s action-ownership and cancellation guards.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

  • [P1] Preserve recovery for cache-pinned stale imports — ui/src/app/lazy-shell-action.ts:47
Agent review details

Security

None.

PR surface

Source 0, Tests +92. Total +92 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 2 93 1 +92
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 94 2 +92

Review metrics

Metric Value Why it matters
Production vs test LOC production +1/-1; tests +93/-1 The production edit is net-neutral, but its tests model a successful in-document retry rather than a permanently unavailable stale asset.

Root-cause cluster

Relationship: canonical
Canonical: #127733
Summary: This PR remains the canonical discussion for storage-denied permanent stale-asset recovery; the merged repairs address adjacent action ownership and dismissal behavior.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Rework after a handoff decision (recommended)
    Choose and prove a safe storage-free handoff, then rebase onto current main while retaining the current cancellation and persistence-success guards.
  2. Retain current degraded behavior
    Keep the merged safe behavior that avoids an unsafe reload when intent cannot be persisted, and pause or close this obsolete branch.

Technical review

Best possible solution:

Define and prove a privacy-safe, action-preserving cross-document recovery mechanism, or retain current main’s intentional safe degraded behavior when no persistence channel is available.

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

Yes—source inspection maps storage denial through the introduced predicate to an in-document retry, and the supplied discussion records the permanent-old-hash scenario; this review did not execute it locally.

Is this the best way to solve the issue?

No. The nullish check fixes the false-presence predicate, but it cannot make a permanently stale import recover without a cross-document action handoff; current main already contains the safer owner-boundary replacement.

Full review comments:

  • [P1] Preserve recovery for cache-pinned stale imports — ui/src/app/lazy-shell-action.ts:47
    This is the previously reported blocker. With storage unavailable, this predicate makes the host skip document recovery; retry() then retries the same lazy import, so a permanently retired hashed URL remains an error and the requested panel never opens. The merged related repair at fix(ui): stop dismissed lazy retries from reloading the page #130988 correctly protects ownership but explicitly leaves this handoff problem unresolved.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: Repository state identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply; the supplied DOM-host evidence remains supplemental and does not demonstrate recovery from a permanently retired asset.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 🛠️ actively grinding: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P1: A Retry on a Control UI panel can still leave a requested action unavailable for users whose browser denies session storage.
  • merge-risk: 🚨 compatibility: The branch changes stale-chunk recovery behavior for existing privacy-restricted browser and embedded-webview setups.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: Repository state identifies this as a MEMBER-authored PR, so the external-contributor proof gate does not apply; the supplied DOM-host evidence remains supplemental and does not demonstrate recovery from a permanently retired asset.

Evidence

What I checked:

Likely related people:

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

Rank-up moves

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

  • Resolve whether a privacy-safe storage-free handoff should exist.
  • Rebase and rework on current main if that direction is approved, preserving the current action-ownership guard.

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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-22T01:12:59.192Z sha e63bbd8 :: found issues before merge. :: [P1] Preserve the action across the required stale-chunk reload
  • reviewed 2026-08-22T01:35:55.229Z sha e63bbd8 :: needs changes before merge. :: [P1] Preserve the action across the required stale-chunk reload
  • reviewed 2026-08-27T07:47:22.850Z sha e63bbd8 :: needs real behavior proof before merge. :: [P1] Preserve reload recovery for cache-pinned stale imports

@steipete
steipete marked this pull request as ready for review August 22, 2026 01:30
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. and removed P2 Normal backlog priority with limited blast radius. labels Aug 22, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Related cancellation repair: #130988. It carries request ownership through the asynchronous reachability probe, prevents a dismissed/replaced Retry from navigating, and requires the current intent to be saved before shell-action reload. Its real browser Retry-then-Close regression changes from two document requests to one.

The stronger storage-denied scenario remains unresolved here: with the old module URL permanently returning 404, two real Retry clicks still leave the visible error and exact pending in-memory intent; Close clears it. With working storage, the control loads a fresh document and a different module hash, opens the palette once and clears saved intent. This is direct limitation proof, not successful denied-storage recovery. #130988 documents that distinction and introduces no alternative URL/cookie/storage handoff. Keeping this PR open for that separate owner-level repair.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Aug 30, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #130988 (233f1f01720233b6b37e83adea460175dd8afbde).

The old presence-check helper has been retired. The current shell retry path allows a reload only after successfully persisting the current action; unavailable or denied storage and failed replacement writes retain the action and retry in place. Existing owner-level tests cover those cases, successful single replay, and preservation of terminal/browser event details.

I verified that replacement and its relevant source/tests on current main. There is no remaining production change from this PR to apply. This closure is based on current-source and test-coverage inspection with an independent challenge; no fresh browser test run is claimed.

@steipete steipete closed this Sep 20, 2026
@RomneyDa
RomneyDa deleted the codex/autoqa-ui-lazy-action-storage-20260822 branch October 22, 2026 00:12
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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant