Skip to content

fix(ui): show snapshot warning after forced worktree removal - #124605

Merged
steipete merged 2 commits into
mainfrom
fix/autoqa-gateway-negative-ack-v3
Aug 16, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/autoqa-gateway-negative-ack-v3

Conversation

@steipete

@steipete steipete commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where operators forcing removal of a managed worktree after snapshot creation failed would see an unqualified success, even though no recovery snapshot existed. The same silent outcome affected preserved-worktree cleanup after deleting a session.

Why This Change Was Made

The Gateway already returns the typed WorktreesRemoveResult with removed: true and snapshotError for this explicit-force outcome. Both Control UI consumers now retain that result and route snapshotError through their existing visible, scope-fenced error owners. No Gateway, protocol, or worktree-service behavior changes.

User Impact

Operators still get the requested forced removal, but now also see why the recovery snapshot was not created instead of being told only that the removal succeeded.

Evidence

  • Focused regressions: 47/47 passing across the Worktrees page and session-organizer deletion flows.
  • Full Control UI gate: 9,580 tests passing across 666 files, with one pre-existing skip.
  • UI typecheck, stylelint, i18n verification, changed-file formatting/lint/type gates, import/dead-export guards, and git diff --check all pass.
  • Exact-head Control UI build changed the served asset from index-CkH47Swx.js on local origin/main to index-D-CN21K_.js on this branch.
  • Source-blind Chromium contract: 5/5 clauses pass against an isolated mocked Gateway, including ordered {id} then {id, force: true} requests and a visible nested gitlink warning after the worktree disappears.
  • Blacksmith Testbox proof: https://github.com/openclaw/openclaw/actions/runs/31949443727
  • Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/31950301690 passed on attempt 2. Attempt 1 had one unrelated config-safe-write.e2e.test.ts timeout in shard 8/12; the targeted rerun and aggregate openclaw/ci-gate are green at the unchanged head.
  • Fresh Codex autoreview: clean, no accepted/actionable findings, 0.99.
  • Production LOC: +16/-4 (net +12). Tests: +34/-3 (net +31).

Visual proof

Forced removal preserves the snapshot warning

forced-removal-warning.webm

AI-assisted: yes. The implementation and proof were directly reviewed and independently revalidated.

@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 16, 2026 13:36
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Aug 16, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 16, 2026
@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 9:42 AM ET / 13:42 UTC.

ClawSweeper review

What this changes

This PR displays the Gateway’s snapshot-creation warning after a forced managed-worktree removal in the Worktrees page and session-deletion cleanup flow.

Regression provenance

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

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. The patch correctly exposes an existing Gateway snapshot warning through both Control UI removal flows; it is a maintainer-authored, protected-label PR awaiting normal exact-head CI completion.

Priority: P2
Reviewed head: a68a08a73bcc3388d366bbcf916f2a903b0f8082

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-covered UI repair that follows the existing Gateway contract and scoped error ownership.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (recording): The PR body supplies a recording and screenshot targeting the post-force warning, plus a source-blind Chromium contract; attachment retrieval was blocked by reviewer DNS, not missing contributor evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (recording): The PR body supplies a recording and screenshot targeting the post-force warning, plus a source-blind Chromium contract; attachment retrieval was blocked by reviewer DNS, not missing contributor evidence.
Evidence reviewed 6 items Current-main defect: Current main performs the forced request but discards its successful result, so a returned snapshot warning cannot reach the Worktrees page error callout.
Authoritative result contract: The protocol explicitly permits snapshotError on a successful forced removal, and the Gateway forwards that field from the worktree service.
Both UI consumers repaired: The branch retains the typed result in the direct page flow and session cleanup flow, publishing snapshotError through their existing scoped error owners.
Findings None None.
Security None None.

How this fits together

The Control UI asks the Gateway to remove managed worktrees and presents outcomes to operators. The Gateway can complete a forced removal without a recovery snapshot, and this change routes that warning to the existing scoped UI error surfaces.

flowchart LR
A[Operator confirms removal] --> B[Control UI]
B --> C[Gateway worktree removal]
C --> D[Removal result]
D --> E{Snapshot warning present?}
E -->|Yes| F[Scoped visible warning]
E -->|No| G[Successful removal]
F --> H[Operator can act with context]
Loading

Before merge

  • Resolve merge risk (P1) - GitHub reports the branch behind its base with checks still running; merge only after the exact head is confirmed mergeable and required checks complete.
  • Complete next step (P2) - No repair lane is needed: this PR already contains the focused owner-boundary fix; await exact-head merge and CI gates.
Agent review details

Security

None.

PR surface

Source +12, Tests +31. Total +43 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 16 4 +12
Tests 2 34 3 +31
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 50 7 +43

Review metrics

Metric Value Why it matters
Production versus regression coverage production +16/-4 (net +12); tests +34/-3 (net +31) The production growth is limited to retaining an existing typed result in two distinct UI error owners; regression coverage exercises both consumers.

Stored data model

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the existing Gateway result contract and land this narrow propagation once exact-head CI is green, so every forced-removal UI path explains when recovery is unavailable.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the existing Gateway result contract and land this narrow propagation once exact-head CI is green, so every forced-removal UI path explains when recovery is unavailable.

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

Yes, from source: current main discards successful forced-removal results despite the Gateway contract allowing snapshotError; the branch’s focused tests exercise both affected consumers.

Is this the best way to solve the issue?

Yes. Reusing the existing typed Gateway result and each consumer’s scoped error owner is narrower and safer than adding a parallel warning channel or changing worktree-service behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: The patch fixes an operator-visible silent warning gap after an explicit forced worktree removal.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies a recording and screenshot targeting the post-force warning, plus a source-blind Chromium contract; attachment retrieval was blocked by reviewer DNS, not missing contributor evidence.
  • add proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR body supplies a recording and screenshot targeting the post-force warning, plus a source-blind Chromium contract; attachment retrieval was blocked by reviewer DNS, not missing contributor evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (recording): The PR body supplies a recording and screenshot targeting the post-force warning, plus a source-blind Chromium contract; attachment retrieval was blocked by reviewer DNS, not missing contributor evidence.

Label justifications:

  • P2: The patch fixes an operator-visible silent warning gap after an explicit forced worktree removal.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (recording): The PR body supplies a recording and screenshot targeting the post-force warning, plus a source-blind Chromium contract; attachment retrieval was blocked by reviewer DNS, not missing contributor evidence.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies a recording and screenshot targeting the post-force warning, plus a source-blind Chromium contract; attachment retrieval was blocked by reviewer DNS, not missing contributor evidence.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR body supplies a recording and screenshot targeting the post-force warning, plus a source-blind Chromium contract; attachment retrieval was blocked by reviewer DNS, not missing contributor evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Commit f19f62c introduced the Gateway worktree contract and both affected Control UI consumers; blame maps the omitted-result lines to that feature introduction. (role: feature author and recent area contributor; confidence: high; commits: f19f62cb77e3; files: packages/gateway-protocol/src/schema/worktrees.ts, src/gateway/server-methods/worktrees.ts, ui/src/pages/worktrees/worktrees-page.ts)

Rank-up moves

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

  • Let the remaining exact-head checks finish before merge.

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

Land-ready proof for exact head a68a08a:

Known proof gaps: none for this UI-only contract. No Gateway, protocol, service, persistence, configuration, release, or deployment change is included.

@steipete
steipete merged commit d8e7ec5 into main Aug 16, 2026
367 of 370 checks passed
@steipete
steipete deleted the fix/autoqa-gateway-negative-ack-v3 branch August 16, 2026 13:50
@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 17, 2026
…w#124605)

* fix(ui): surface forced worktree snapshot failures

* chore: remove normal-PR changelog entry
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 P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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.

1 participant