Skip to content

fix(ui): abort stale destructive session confirmations on reconnect - #124254

Merged
vyctorbrzezowski merged 2 commits into
mainfrom
brzezowski/stale-confirm-abort
Aug 15, 2026
Merged

vyctorbrzezowski merged 2 commits into
mainfrom
brzezowski/stale-confirm-abort

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Aug 15, 2026 •

Copy link
Copy Markdown
Member

Fixes #124227

What Problem This Solves

Resolves a problem where a destructive confirmation (session delete, batch
delete, cloud-worker stop, preserved-worktree removal, or session-group
delete) stayed open across a Gateway reconnect, capability replacement, or
disconnect. Confirming it afterward silently did nothing, because the code
that ran on confirm re-checked the mutation scope and bailed out with no
visible outcome. The dialog also held the shared confirmation lock the whole
time it sat open, so the operator had to dismiss it manually before any other
confirmation could appear. This covers both the sidebar and the chat-header
delete/fork/archive menu, which shares the same delete operation through its
own independently-owned mutation scope.

Why This Change Was Made

SessionDataController already retires the sidebar's mutation scope by
advancing an epoch on reconnect, capability replacement, and teardown, but
nothing told the open dialog about it. confirm-dialog.ts already accepts an
AbortSignal and tears itself down (and releases its lock) when that signal
fires — the same pattern the Devices page uses for its own destructive
confirms. This change gives SessionDataController an AbortController
owned by the mutation epoch, aborts it whenever the epoch advances, and
exposes the signal on SidebarSessionMutationScope. Every scope-bound
showConfirmDialog call in session-organizer-operations.runtime.ts and
session-organizer-catalog.ts now passes that signal, so a stale dialog
dismisses itself the moment its scope retires instead of waiting for the
operator.

The chat header builds its own SidebarSessionMutationScope from
connectionGeneration instead of going through SessionDataController, so it
had no signal to wire in and stayed uncovered. ChatPaneBase now owns its own
headerSessionMutationAbortController, retired everywhere
connectionGeneration advances (a reconnect in chat-pane-context.ts and
pane teardown in chat-pane-lifecycle.ts), and captureHeaderSessionActionScope
hands its signal to the captured scope the same way SessionDataController
does for the sidebar.

Separately, an aborted confirm resolves to false, which is indistinguishable
from an ordinary cancel click. Every destructive-confirm call site checked
!confirmed before checking whether the scope was still current, so an
abort's false short-circuited past the existing staleness check and the
operator's lost intent vanished with no notice at all — the dialog just closed
on its own with no explanation. Each site now checks scope staleness first and
shows a toast ("Gateway connection replaced ... Try again.") before falling
through to the ordinary cancel path, reusing the exact pattern
deleteSessionGroup already had for a narrower race (confirmed but the scope
went stale before the request went out). New i18n strings
(deleteSessionStale, deleteSessionsStale, stopCloudWorkerStale) follow
that same existing convention; the preserved-worktree follow-up confirm reuses
the existing deletePreservedWorktrees copy since the outcome is identical
(the worktree stays put).

User Impact

A confirmation dialog left open across a reconnect — in the sidebar or the
chat header — now disappears on its own instead of sitting there until the
operator dismisses it, and a fresh confirmation can open immediately
afterward. When that happens the operator now sees a toast explaining the
action was canceled by the reconnect and inviting a retry, instead of the
dialog just vanishing with no explanation. Ordinary confirm/cancel behavior
and the "don't ask again" delete preference are unchanged.

Evidence

Focused suites, with the fix applied:

$ LC_ALL=en_US.UTF-8 node scripts/run-vitest.mjs ui/src/components/session-organizer-batch-mutations.test.ts
 Test Files  1 passed (1)
      Tests  30 passed (30)

$ LC_ALL=en_US.UTF-8 node scripts/run-vitest.mjs ui/src/pages/chat/chat-pane.test.ts
 Test Files  1 passed (1)
      Tests  30 passed (30)

$ LC_ALL=en_US.UTF-8 node scripts/run-vitest.mjs ui/src/components/app-sidebar.test.ts
 Test Files  1 passed (1)
      Tests  261 passed (261)

Regression-test proof (stashed the production fix, kept the strengthened
tests, reran the same suites):

 ❯ |ui| ui/src/components/session-organizer-batch-mutations.test.ts (30 tests | 5 failed)
     × aborts the 'batch delete'/'session delete'/'cloud worker stop'/'session-group delete' confirm ...
     × keeps a retired scope from navigating when the worktree prompt is cancelled
 AssertionError: expected "vi.fn()" to be called with arguments: [ Array(1) ]
 Number of calls: 0

 ❯ |ui-isolated| ui/src/pages/chat/chat-pane.test.ts (30 tests | 1 failed)
     × aborts a stale header delete confirm and shows a retry notice ...
 Error: Test timed out in 120000ms.

Without the header abort wiring, the header's dialog never dismisses itself
and the new test hangs the same way the original sidebar bug did. Without the
reordered staleness check, the toast assertions fail with zero calls: the
!confirmed branch swallows the abort before the stale-scope toast is ever
reached.

node scripts/check-changed.mjs -- ui/src/components/session-organizer-batch-mutations.test.ts ui/src/components/session-organizer-catalog.ts ui/src/components/session-organizer-operations.runtime.ts ui/src/i18n/locales/en.ts ui/src/pages/chat/chat-pane-base.ts ui/src/pages/chat/chat-pane-context.ts ui/src/pages/chat/chat-pane-lifecycle.ts ui/src/pages/chat/chat-pane-session-menu.ts ui/src/pages/chat/chat-pane.test.ts
passed lint/typecheck/duplicate-scan/dependency-pin/format/i18n gates
(delegated through Testbox).

.agents/skills/autoreview/scripts/autoreview --mode uncommitted reported no
accepted/actionable findings.

CI diagnosis (previous head)

checks-node-compact-large-22 and checks-ui both failed on the same single
test, ui/src/components/app-sidebar.test.ts > AppSidebar group mutation collapsed state > keeps a reconnected group delete retryable after its confirm opened (pre-existing on main, unrelated to this PR's stated
scope). That test reconnects while a group-delete confirm is open, then
clicks confirm, and expects the existing "Gateway connection replaced ..."
toast. Wiring signal: scope.signal into deleteSessionGroup's confirm call
made the dialog auto-dismiss on reconnect before the click could land, so
confirmed came back false and the old if (!confirmed) return false;
ordering skipped the toast branch entirely — a real regression this PR's
earlier commits introduced into a main test, not a flake. The reordering
above fixes it directly; both jobs had exactly one failing test each and no
other failures. All 12 checks-ui-e2e shards and checks-ui-e2e-real-gateway
were green on this PR's own head, so there's no e2e flake to report here.

Control UI proof (running app, head 5298bea2834)

Drove the real sidebar through the mocked-Gateway Playwright harness
(installMockGateway, the same harness session-organizer-batch-mutations.test.ts's
sibling e2e suite uses) with a "Projects" session group, forced a Gateway
reconnect while its delete confirm was open, and screen-recorded the result:

  1. Destructive confirm open — Delete group "Projects":
    https://github.com/user-attachments/assets/195c9027-f387-42e6-940f-e67fbd4d9270
  2. Gateway reconnect lands while the dialog is open — it tears itself down and
    the reordered staleness check fires the retry toast in the same beat:
    https://github.com/user-attachments/assets/6adf5563-2fc6-41bb-bbff-0f8660ca7caf
  3. Retry — the confirmation lock released with the stale dialog, so a fresh
    Delete group "Projects" opens immediately (toast still visible above it):
    https://github.com/user-attachments/assets/3740d27c-11d0-4a20-bb02-473d4639fdab
  4. Retry confirmed — sessions.groups.delete lands and "Projects" is gone:
    https://github.com/user-attachments/assets/22c86389-294c-4efd-bd56-d228a608f5f0

Full recording (open → reconnect → dismiss/toast → retry → success):
https://github.com/user-attachments/assets/0eb46077-8980-42a9-9d5c-1be9eee08034

SessionDataController retires the session-mutation scope on reconnect,
capability replacement, and host disconnect, but left any open
destructive confirmation dialog in place. If the operator confirmed
after reconnect the action silently no-opped, and the dialog's global
lock stayed held until manually dismissed.

Give SessionDataController an AbortController owned by the mutation
epoch, abort it whenever the epoch advances, and expose the signal on
SidebarSessionMutationScope. Wire it into every scope-bound confirm
dialog: batch delete, single delete, cloud-worker stop, preserved-
worktree removal, and session-group delete. confirm-dialog.ts already
tears down its modal and releases the lock on an aborted signal, so a
stale dialog now dismisses itself instead of surviving the reconnect.

Fixes #124227
@clawsweeper

clawsweeper Bot commented Aug 15, 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 15, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review August 15, 2026 19:29
@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 15, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 6:57 PM ET / 22:57 UTC.

ClawSweeper review

What this changes

The PR aborts sidebar and chat-header destructive session confirmations when their Gateway mutation scope retires, then shows a retry toast instead of silently discarding the action.

Regression provenance

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

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for protected maintainer merge review. The PR repairs the lifecycle owner that currently retires mutation scopes without cancelling their dialogs, and it extends that rule to the independently scoped chat-header path; the prior missing-header concern is addressed.

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

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused owner-boundary changes, pre-fix regression evidence, green exact-head checks, and a recorded Control UI flow make this a strong repair candidate.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (recording): The PR body provides a linked Control UI recording at the reviewed head showing open confirmation, reconnect dismissal with retry notice, immediate retry, and successful deletion.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (recording): The PR body provides a linked Control UI recording at the reviewed head showing open confirmation, reconnect dismissal with retry notice, immediate retry, and successful deletion.
Evidence reviewed 6 items Current sidebar defect and lifecycle owner: Current main advances the session-mutation epoch on disconnect, capability replacement, and Gateway changes, but its captured scope has no abort signal. The destructive operations await a dialog without a lifecycle cancellation path, leaving only a post-dialog stale guard.
Dialog cancellation contract: The shared confirmation implementation already accepts AbortSignal, resolves an aborted dialog to false, removes its DOM host, and clears the global lock in finally; the proposed owner-bound signal reuses that established contract.
Independent chat-header scope: The chat-header menu constructs its own session mutation scope from connectionGeneration, while current reconnect and teardown paths advance that generation. The PR adds a corresponding abort-controller lifecycle rather than assuming the sidebar controller owns this path.
Findings None None.
Security None None.

How this fits together

Control UI session actions capture a Gateway-bound mutation scope before showing a destructive confirmation. Reconnects and teardown retire that scope; the dialog layer must release its global confirmation lock, prevent the stale request, and tell the operator to retry.

flowchart LR
  A[Operator starts session action] --> B[Capture mutation scope]
  B --> C[Open destructive confirmation]
  D[Gateway reconnect or pane teardown] --> E[Retire scope generation]
  E --> F[Abort scope dialog signal]
  F --> G[Release dialog lock]
  G --> H[Show retry notice]
  H --> I[Operator retries on current connection]
Loading

Decision needed

Question Recommendation
Should this protected maintainer-owned P1 repair land with its explicit lifecycle cancellation and action-specific retry notices? Land after protected review: Accept the owner-scoped abort controllers and the explicit retry notices as the canonical fix for stale destructive confirmations.

Why: The patch is technically supported, but the maintainer label requires an explicit human merge decision and the bug fix intentionally adds production lifecycle/UI surface.

Before merge

  • Resolve merge risk (P1) - Production code grows by 71 net lines for lifecycle ownership and action-specific retry outcomes; the protected maintainer review should confirm that retaining the explicit per-action notices is preferable to a helper that would blur their distinct semantics.
  • Complete next step (P2) - No repair job is needed: this active protected PR already owns the focused fix and awaits explicit maintainer review.
Agent review details

Security

None.

PR surface

Source +71, Tests +105. Total +176 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 9 77 6 +71
Tests 2 109 4 +105
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 186 10 +176

Review metrics

Metric Value Why it matters
Production versus test delta production +77/-6 (net +71); tests +109/-4 (net +105) The production growth implements two lifecycle owners, signal propagation, and distinct cancellation outcomes; tests cover the new sidebar and chat-header races.

Stored data model

Persistent data-model change detected: serialized state: ui/src/components/session-data-controller.ts, serialized state: ui/src/components/session-organizer-batch-mutations.test.ts, serialized state: ui/src/components/session-organizer-catalog.ts, serialized state: ui/src/components/session-organizer-operations.runtime.ts, unknown-data-model-change: ui/src/components/session-organizer-batch-mutations.test.ts, unknown-data-model-change: ui/src/components/session-organizer-operations.runtime.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #124227
Summary: This PR is the focused implementation candidate for the linked stale-confirmation lifecycle bug.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land one owner-bound cancellation signal per sidebar epoch and chat-header connection generation, preserving the existing confirmation behavior and giving each retired destructive action a visible retry outcome.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land one owner-bound cancellation signal per sidebar epoch and chat-header connection generation, preserving the existing confirmation behavior and giving each retired destructive action a visible retry outcome.

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

Yes in source: open a destructive session confirmation, then reconnect or replace the session capability before confirming. Current main retires the scope but leaves the dialog active, while the PR includes focused regression scenarios for that sequence.

Is this the best way to solve the issue?

Yes. The patch attaches cancellation to the same lifecycle owners that define scope validity, covers the independent chat-header owner, and preserves action-specific user outcomes rather than adding downstream retries or fallbacks.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides a linked Control UI recording at the reviewed head showing open confirmation, reconnect dismissal with retry notice, immediate retry, and successful deletion.
  • add proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR body provides a linked Control UI recording at the reviewed head showing open confirmation, reconnect dismissal with retry notice, immediate retry, and successful deletion.

Label justifications:

  • P1: A reconnect can otherwise silently discard destructive session actions and keep the shared confirmation lock occupied.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (recording): The PR body provides a linked Control UI recording at the reviewed head showing open confirmation, reconnect dismissal with retry notice, immediate retry, and successful deletion.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides a linked Control UI recording at the reviewed head showing open confirmation, reconnect dismissal with retry notice, immediate retry, and successful deletion.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR body provides a linked Control UI recording at the reviewed head showing open confirmation, reconnect dismissal with retry notice, immediate retry, and successful deletion.

Evidence

What I checked:

  • Current sidebar defect and lifecycle owner: Current main advances the session-mutation epoch on disconnect, capability replacement, and Gateway changes, but its captured scope has no abort signal. The destructive operations await a dialog without a lifecycle cancellation path, leaving only a post-dialog stale guard. (ui/src/components/session-data-controller.ts:721, 1db8fe4d4f52)
  • Dialog cancellation contract: The shared confirmation implementation already accepts AbortSignal, resolves an aborted dialog to false, removes its DOM host, and clears the global lock in finally; the proposed owner-bound signal reuses that established contract. (ui/src/components/confirm-dialog.ts:24, 1db8fe4d4f52)
  • Independent chat-header scope: The chat-header menu constructs its own session mutation scope from connectionGeneration, while current reconnect and teardown paths advance that generation. The PR adds a corresponding abort-controller lifecycle rather than assuming the sidebar controller owns this path. (ui/src/pages/chat/chat-pane-session-menu.ts:216, 1db8fe4d4f52)
  • Regression coverage and real UI evidence: The PR head adds focused sidebar and chat-header regression coverage; its body records pre-fix failures and links a running Control UI recording of reconnect, automatic dismissal, retry toast, fresh confirmation, and successful deletion. (ui/src/components/session-organizer-batch-mutations.test.ts:459, 5298bea2834a)
  • Feature-history provenance: The session-confirmation design appears to date to the in-app destructive-confirmation commit, with related group-confirmation work immediately adjacent; shallow history limits a fuller lineage pass but identifies the relevant original area work. (ui/src/components/session-organizer-operations.runtime.ts:274, 3dc03f926550)
  • Current-source ownership check: Current-main blame places the scope invalidation and chat connection-generation boundaries in the checked-out source; those are the lifecycle boundaries the patch extends with abort controllers. (ui/src/components/session-data-controller.ts:723, c0824d284e95)

Likely related people:

  • vyctorbrzezowski: Authored the original in-app destructive-confirmation and session-group confirmation work, as well as the current lifecycle repair. (role: feature owner and recent area contributor; confidence: high; commits: 3dc03f926550, b953cb259743, 5298bea2834a; files: ui/src/components/session-organizer-operations.runtime.ts, ui/src/components/session-organizer-catalog.ts, ui/src/pages/chat/chat-pane-session-menu.ts)

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 (2 earlier review cycles)
  • reviewed 2026-08-15T19:36:54.746Z sha ac82b81 :: needs changes before merge. :: [P1] Cancel chat-header confirmation dialogs on reconnect
  • reviewed 2026-08-15T21:53:35.133Z sha 5298bea :: needs maintainer review before merge. :: none

The sidebar epoch-abort wiring left the chat-header delete/fork/archive
path uncovered: it builds its own SidebarSessionMutationScope from
connectionGeneration but never handed it a signal, so a header confirm
left open across a reconnect kept the shared confirmation lock forever.
Give ChatPaneBase its own AbortController, retire it everywhere
connectionGeneration advances (reconnect and pane teardown), and wire
the signal into the header's captured scope, matching
SessionDataController's controller for the sidebar.

Separately, resolving an aborted confirm to `false` looked identical to
an ordinary cancel, so the operator's lost intent vanished silently.
Reorder every destructive confirm site to check scope staleness ahead
of the `confirmed` guard and show the existing "Gateway connection
replaced ... Try again." toast on abort, matching the pattern
deleteSessionGroup already used for the same race. This also fixes a
regression the PR had introduced in a pre-existing main test
(app-sidebar.test.ts's "keeps a reconnected group delete retryable
after its confirm opened"), which is what failed
checks-node-compact-large-22 and checks-ui on the previous head.
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 15, 2026
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Pre-merge maintainer decision

Landing this as maintainer (vyctorbrzezowski). Recording the resolution of every item in the latest ClawSweeper review (reviewed head 5298bea2834ad672489fde77b5c9b67651b86558, findings: none) so nothing is merged past silently.

"Resolve merge risk (P1)" — production grows +71 net; confirm per-action notices over a shared helper. Accepted as-is, keeping the explicit notices. The three new strings (deleteSessionStale, deleteSessionsStale, stopCloudWorkerStale) each name the specific action the reconnect discarded; a shared helper would have to take the action noun as a parameter and would report "an action" rather than which one, which is exactly the visible-outcome quality this PR exists to restore. They also follow the convention deleteSessionGroup already established in ui/src/i18n/locales/en.ts for its narrower stale race, so this is the existing pattern extended, not a new one. The remaining production lines are lifecycle ownership — one AbortController per epoch owner (SessionDataController, ChatPaneBase) plus signal propagation — which is the ownership boundary the bug lives on; the cheaper alternatives (a downstream guard at each confirm site, or a post-hoc retry) are the consumer-only compensation Repair Doctrine rules out.

"Complete next step (P2)" — no repair job needed. Informational; nothing to apply.

"Stored data model" flag. False positive from the heuristic's "serialized state" match on UI controller filenames. All 11 changed files live under ui/src/** (components, chat pane, i18n/locales/en.ts, two test files); there is no schema, config, persisted-state, or protocol surface in the diff, so no migration or upgrade-compatibility proof applies.

Land-ready verification

  • Exact-head CI green: run 31910215173 on 5298bea2834ad672489fde77b5c9b67651b86558 — completed/success, 142 passing checks, 24 skipped, 0 failing.
  • ClawSweeper review at that same head (2026-08-15 22:57 UTC, ~15 min before this comment): merge readiness ready-for-maintainer, patch quality 5/6, findings none.
  • Focused suites and the pre-fix regression run (tests fail on pre-fix code for the intended reason) are in the PR body's Evidence section, together with the running Control UI recording of open → reconnect → dismiss/toast → retry → success.
  • Merging through the repo-native scripts/pr flow with OPENCLAW_TESTBOX=1.
  • Known proof gaps: none identified beyond the mocked-Gateway harness used for the Control UI recording, which is the harness this suite's sibling e2e coverage already uses.

@vyctorbrzezowski
vyctorbrzezowski merged commit 5014839 into main Aug 15, 2026
192 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/stale-confirm-abort branch August 15, 2026 23:18
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…penclaw#124254)

* fix(ui): abort stale destructive session confirmations on reconnect

SessionDataController retires the session-mutation scope on reconnect,
capability replacement, and host disconnect, but left any open
destructive confirmation dialog in place. If the operator confirmed
after reconnect the action silently no-opped, and the dialog's global
lock stayed held until manually dismissed.

Give SessionDataController an AbortController owned by the mutation
epoch, abort it whenever the epoch advances, and expose the signal on
SidebarSessionMutationScope. Wire it into every scope-bound confirm
dialog: batch delete, single delete, cloud-worker stop, preserved-
worktree removal, and session-group delete. confirm-dialog.ts already
tears down its modal and releases the lock on an aborted signal, so a
stale dialog now dismisses itself instead of surviving the reconnect.

Fixes openclaw#124227

* fix(ui): abort chat-header confirms too and surface a retry notice

The sidebar epoch-abort wiring left the chat-header delete/fork/archive
path uncovered: it builds its own SidebarSessionMutationScope from
connectionGeneration but never handed it a signal, so a header confirm
left open across a reconnect kept the shared confirmation lock forever.
Give ChatPaneBase its own AbortController, retire it everywhere
connectionGeneration advances (reconnect and pane teardown), and wire
the signal into the header's captured scope, matching
SessionDataController's controller for the sidebar.

Separately, resolving an aborted confirm to `false` looked identical to
an ordinary cancel, so the operator's lost intent vanished silently.
Reorder every destructive confirm site to check scope staleness ahead
of the `confirmed` guard and show the existing "Gateway connection
replaced ... Try again." toast on abort, matching the pattern
deleteSessionGroup already used for the same race. This also fixes a
regression the PR had introduced in a pre-existing main test
(app-sidebar.test.ts's "keeps a reconnected group delete retryable
after its confirm opened"), which is what failed
checks-node-compact-large-22 and checks-ui on the previous head.
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 P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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.

Abort stale destructive session confirmations on reconnect

1 participant