Skip to content

fix(crabbox): report completed source cleanup after capture cancellation - #143349

Merged
steipete merged 1 commit into
mainfrom
codex/crabbox-project-capture-teardown-20260909
Sep 9, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/crabbox-project-capture-teardown-20260909

Conversation

@steipete

@steipete steipete commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where stopping a cloud session during project image capture reported worker cleanup as failed even after Crabbox confirmed the source VM was stopped.

Why This Change Was Made

After successful source cleanup, report the optional capture error as a warning. Failed source cleanup still rejects. The uncertain capture reservation and the fence preventing node enrollment remain intact, so successful VM cleanup never claims that an interrupted snapshot was resolved.

User Impact

Stop and reclaim can finish when the worker is actually gone. Operators still receive the existing guidance for reconciling an uncertain image capture.

Evidence

Observed a real canceled project capture where the source lease reached released/cleanup-complete while the Gateway reported an unresolved-capture teardown error. The task-owned snapshot was subsequently identified and deleted; capture recovery state was retained.

The regression failed before the fix. Its successful-stop and failed-stop cases verify allocation retirement, retained capture uncertainty, no repeated capture, and no node enrollment. All 132 focused provider tests passed, the complete changed-file gate passed, and independent isolated P0–P2 review was clean. Existing warm-image documentation already specifies this behavior.

@steipete
steipete marked this pull request as ready for review September 9, 2026 19:32
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 3:38 PM ET / 19:38 UTC.

ClawSweeper review

What this changes

The Crabbox plugin reports successful worker cleanup despite an interrupted optional image capture, with regression coverage for successful and failed cleanup.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix: current main and v2026.9.3 still report capture failure after confirmed source cleanup. No blocking correctness finding was identified.

Priority: P2
Reviewed head: 745c6a56869840a46432e9a37de7b81e13956323

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful regression coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. The body reports a real canceled capture and focused regression results, but does not provide an after-fix live teardown trace.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. The body reports a real canceled capture and focused regression results, but does not provide an after-fix live teardown trace.
Evidence reviewed 8 items Introduced change verified: The pinned merge-base-to-head diff changes only teardown error reporting and adds a two-case cancellation regression. The warning runs after stopLease resolves; stop failures still propagate.
Current main still needs the fix: The fetched main revision still throws captureError after awaiting successful stopLease, reproducing the reported false cleanup failure at the source level.
Latest release retains the old behavior: The provider source fetched at v2026.9.3 also throws the optional capture error after successful source cleanup.
Findings None None.
Security None None.

How this fits together

The Crabbox plugin provisions and stops cloud workers for OpenClaw. Its teardown result tells the Gateway whether worker cleanup completed, while image capture recovery is tracked separately.

flowchart TD
  A[Worker stop request] --> B[Crabbox teardown]
  B --> C[Attempt optional image capture]
  C --> D[Stop source VM]
  C --> E[Retain uncertain capture record]
  D --> F{Stop confirmed}
  F -->|Yes| G[Report cleanup complete and capture warning]
  F -->|No| H[Report cleanup failure]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1, Tests +46. Total +47 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 4 3 +1
Tests 1 46 0 +46
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 50 3 +47

Review metrics

None.

Technical review

Best possible solution:

Keep VM cleanup completion independent of optional snapshot recovery, while preserving stop failures and unresolved-capture safeguards.

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

Yes, from source: cancel project capture, then destroy the lease with a successful stop result; current main still throws the retained capture error. Runtime reproduction was not executed in this read-only review.

Is this the best way to solve the issue?

Yes. Reporting the optional capture error as a warning at the teardown owner matches existing documentation without changing stop confirmation or capture recovery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ac0a263eebf9.

Labels

Label changes:

  • add P2: This repairs a bounded cloud-worker cleanup reporting failure after capture cancellation.
  • 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: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. The body reports a real canceled capture and focused regression results, but does not provide an after-fix live teardown trace.

Label justifications:

  • P2: This repairs a bounded cloud-worker cleanup reporting failure after capture cancellation.
  • 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: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. The body reports a real canceled capture and focused regression results, but does not provide an after-fix live teardown trace.

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)

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
steipete merged commit d48d7c2 into main Sep 9, 2026
163 checks passed
@steipete
steipete deleted the codex/crabbox-project-capture-teardown-20260909 branch September 9, 2026 19:58
@steipete

steipete commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: crabbox maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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