Skip to content

fix(crabbox): allow native snapshots to finish before enrollment - #143288

Merged
steipete merged 2 commits into
mainfrom
codex/crabbox-checkpoint-wait-main
Sep 9, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/crabbox-checkpoint-wait-main

Conversation

@steipete

@steipete steipete commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Related: #134931, #143227, #142221

What Problem This Solves

Fixes an issue where cloud project provisioning aborts an ordinary pending native snapshot after three minutes on AWS, leaving an uncertain capture and preventing worker enrollment. The CLI and Doctor also tell operators to stop and recover a capture after 20 minutes even while it can still be within the provider's normal capture window.

Why This Change Was Made

Pass Crabbox's explicit 45-minute native-capture budget and let the enclosing command cover submission, source lifecycle, and child settlement. Preserve provider-specific timing: Machine0 has separate default stop/restore windows; Daytona includes preparation and stop inside its native-capture budget and has separate recovery afterward.

Distinguish a recorded uncertain outcome from a merely long-running capture in CLI, Doctor, and maintenance guidance. Stored phase/stale data, the 20-minute warning threshold, capture ownership, publication, non-submission handling, and manual recovery guards remain unchanged. This introduces no extra capture attempt, configuration option, or schema change.

User Impact

Legitimate pending snapshots can finish within the CLI's bounded contract before enrollment. Operators see wait/inspect guidance for long-running work and retain explicit recovery instructions for uncertain outcomes. Cancellation, failed capture, source cleanup, and reservation safety remain enforced.

Evidence

  • An actual installed-Gateway AWS campaign reproduced the issue: OpenClaw terminated checkpoint creation at 180 seconds while AWS repeatedly reported the snapshot pending. The exact retained checkpoint later verified completed through Crabbox. The instance and matched snapshot were deleted; the original failed run and supplemental cleanup evidence are preserved. No successful session from that failed campaign is claimed.

  • The delayed-readiness regression advances an existing command-deadline model to four minutes: the original code fails with unresolved capture; repaired AWS/Azure/GCP cases publish and enroll exactly once. The broader reconciled provider, cancellation, stop, and receipt suites passed 396 tests.

  • Six existing diagnostic cases reproduced premature stop/recovery advice for old creating/scrubbing phases. The final owner, CLI, Doctor, maintenance, and recovery suites passed 151 tests; the final maintenance wording passed its 14-case rerun. These test counts overlap and are not summed.

  • The full changed-file gate, formatting, and documentation checks passed. Independent P2 review completed with no accepted actionable finding remaining. Source-based review dispositions preserve Machine0's direct lifecycle route and clarify that Daytona preparation shares the native-capture budget; no unsupported budget extension was added.

  • The exact Crabbox v0.51.0 source contract was inspected at commit 745eb21f8fb97582a7e0ec176ee9671562eba2b9. The Machine0 allowance covers its default lifecycle windows, not arbitrary external timeout overrides.

  • Post-fix native AWS proof passed on 4ddee76e9413ea6fffa11831bc8b2d8829cb50eb with pinned installed Crabbox v0.51.0 and one m7a.large / 400 GiB lease. Actual provider.provision followed by the optional teardown provider.destroy entrypoint ran the real scrub and one native EBS checkpoint with --wait --wait-timeout 2700000ms. Capture completed successfully in 45.25 seconds, verified available before the ordinary stop, and published an available image. Normal destroy, source deletion, and exact checkpoint deletion/absence all passed; cleanup completed and every command settled normally.

  • Runtime installation/enrollment in that positive proof is explicitly synthetic, and capture enters through non-project optional teardown. It does not establish a running node, real session, or project dispatch/enrollment, nor Machine0/Daytona live qualification. The 45.25-second capture is below the old 180-second cutoff and does not exercise that regression boundary or the 45-minute maximum. The original live pending-snapshot failure and separate four-minute delayed-readiness regression establish the deadline rationale; the positive run verifies the current native command contract and successful cleanup. The experiment retains its 30-minute main, 10-minute cleanup, and 40-minute total caps.

  • CI exposed two stale lifecycle-budget expectations in the plugin registration integration test. The independent expected values now account for the 46-minute-10-second capture-envelope increase. The original failures were reproduced locally; all 29 registration, lazy-load, cancellation, and stop cases passed after the test-only correction, followed by changed-file checks and scoped review. Production code and native command arguments did not change.

Match the explicit native-capture wait with provider source lifecycle and child-settlement budgets. Keep long-running captures distinct from uncertain outcomes in operator guidance, preserving capture ownership and manual recovery guards. Validation covers delayed readiness, provider cancellation and cleanup, the landed non-submission behavior, and CLI/Doctor/maintenance guidance. Live AWS qualification follows on the prepared-checkout integration.
@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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime extensions: crabbox size: M maintainer Maintainer-authored PR labels Sep 9, 2026
@steipete
steipete marked this pull request as ready for review September 9, 2026 17:23
@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: blocked before merge. Reviewed September 9, 2026, 2:19 PM ET / 18:19 UTC (Revision 4).

ClawSweeper review

What this changes

The Crabbox plugin extends native snapshot deadlines and updates operator guidance to distinguish long-running captures from uncertain outcomes.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful, focused repair: current main still cuts off ordinary native captures prematurely. No blocking defect was found, and the updated AWS evidence resolves the earlier proof concern for the shared capture boundary.

Priority: P2
Reviewed head: 4ddee76e9413ea6fffa11831bc8b2d8829cb50eb

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused contract-alignment repair with useful native AWS observations, targeted regression coverage, and no actionable correctness findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The updated body reports exact-head AWS observations through the real provider teardown and shared capture owner: scrub, native creation with the new arguments, available-image publication, and confirmed cleanup. The 45.25-second run does not prove delayed readiness beyond 180 seconds or real project enrollment; those limits are explicit, with the deadline regression covered separately by the four-minute test.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The updated body reports exact-head AWS observations through the real provider teardown and shared capture owner: scrub, native creation with the new arguments, available-image publication, and confirmed cleanup. The 45.25-second run does not prove delayed readiness beyond 180 seconds or real project enrollment; those limits are explicit, with the deadline regression covered separately by the four-minute test.
Evidence reviewed 8 items Introduced capture changes: The pinned merge-base-to-head diff adds the explicit native wait and updates command and enclosing lifecycle budgets. Capture submission, reservation checks, publication, uncertain-result handling, and the enrollment barrier remain intact.
Still necessary on current main: Fetched main retains a 180-second ordinary capture deadline and a 600-second Machine0 deadline. The repair is not already present there.
Latest release retains the short deadlines: The v2026.9.3 source keeps the same 180-second and 600-second limits inside the warm-image implementation and invokes checkpoint creation without an explicit wait timeout.
Findings None None.
Security None None.

How this fits together

Crabbox provisions cloud workers and saves prepared machine images for later reuse. Its capture owner scrubs worker state, waits for the native snapshot, then permits project enrollment or completes worker teardown.

flowchart TD
  A[Prepared cloud worker] --> B[Scrub worker state]
  B --> C[Native snapshot with bounded wait]
  C --> D{Capture outcome}
  D -->|Available| E[Publish reusable image]
  E --> F[Enroll project worker or finish teardown]
  D -->|Uncertain| G[Retain reservation and recovery guidance]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +33, Tests +87, Docs 0. Total +120 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 5 65 32 +33
Tests 6 163 76 +87
Docs 1 2 2 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 230 110 +120

Review metrics

Metric Value Why it matters
Native capture command budgets 48 minutes normally; 51 minutes on Daytona; 78 minutes on Machine0 These bounded ceilings include the 45-minute native wait and the provider-specific source lifecycle allowances.

Stored data model

Persistent data-model change detected: migration/backfill/repair: extensions/crabbox/src/doctor.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: canonical
Canonical: #143288
Summary: This is the focused deadline repair extracted from broader cloud-worker work.

Members:

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

Technical review

Best possible solution:

Keep snapshot waiting aligned with Crabbox's bounded native contract while preserving cancellation, capture ownership, and explicit recovery for uncertain outcomes.

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

Yes: current main terminates ordinary checkpoint commands after 180 seconds despite Crabbox's 45-minute native wait contract. The supplied AWS failure and four-minute regression describe the matching trigger; this review did not execute it.

Is this the best way to solve the issue?

Yes: repairing the shared capture deadline and its enclosing budgets addresses the mismatch without retrying submission or changing stored ownership, while phase-based guidance avoids treating elapsed time as failure.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The updated body reports exact-head AWS observations through the real provider teardown and shared capture owner: scrub, native creation with the new arguments, available-image publication, and confirmed cleanup. The 45.25-second run does not prove delayed readiness beyond 180 seconds or real project enrollment; those limits are explicit, with the deadline regression covered separately by the four-minute test.

Label justifications:

  • P2: This repairs premature snapshot failure in the optional cloud-worker image workflow with a bounded provider-local change.
  • 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 (live_output): The updated body reports exact-head AWS observations through the real provider teardown and shared capture owner: scrub, native creation with the new arguments, available-image publication, and confirmed cleanup. The 45.25-second run does not prove delayed readiness beyond 180 seconds or real project enrollment; those limits are explicit, with the deadline regression covered separately by the four-minute test.
  • proof: sufficient: Contributor real behavior proof is sufficient. The updated body reports exact-head AWS observations through the real provider teardown and shared capture owner: scrub, native creation with the new arguments, available-image publication, and confirmed cleanup. The 45.25-second run does not prove delayed readiness beyond 180 seconds or real project enrollment; those limits are explicit, with the deadline regression covered separately by the four-minute test.

Evidence

What I checked:

  • Introduced capture changes: The pinned merge-base-to-head diff adds the explicit native wait and updates command and enclosing lifecycle budgets. Capture submission, reservation checks, publication, uncertain-result handling, and the enrollment barrier remain intact. (extensions/crabbox/src/crabbox-worker-warm-image.ts:559, 4ddee76e9413)
  • Still necessary on current main: Fetched main retains a 180-second ordinary capture deadline and a 600-second Machine0 deadline. The repair is not already present there. (extensions/crabbox/src/crabbox-worker-timeouts.ts:36, 7c1824faa6c9)
  • Latest release retains the short deadlines: The v2026.9.3 source keeps the same 180-second and 600-second limits inside the warm-image implementation and invokes checkpoint creation without an explicit wait timeout. (extensions/crabbox/src/crabbox-worker-warm-image.ts:59, 1391f7cd2d40)
  • Affirmative dependency contract: The changed OpenClaw command directly executes Crabbox checkpoint creation. At the PR's pinned Crabbox v0.51.0 revision, checkpoint.go defines --wait-timeout with a 45-minute default and forwards it to native creation; checkpoint_native.go uses that duration while observing the exact retained checkpoint. (internal/cli/checkpoint.go:121, 745eb21f8fb9)
  • Provider lifecycle allowances: Inspected Machine0 images.go: source stop uses CreateTimeout, snapshot readiness uses WaitTimeout, and restoration gets a separate CreateTimeout context; config.go defaults CreateTimeout to 15 minutes. Daytona checkpoint.go shares one wait context across preparation, stop, creation, and readiness, then allows a separate three-minute recovery context. (internal/providers/machine0/images.go:215, 745eb21f8fb9)
  • Regression and diagnostic coverage: The revised AWS/Azure/GCP test advances the command-deadline model to four minutes, verifies no early enrollment, then checks one capture, one enrollment, and an available image. CLI, Doctor, and maintenance cases distinguish all three capture phases while asserting stored ownership remains unchanged. These tests were inspected, not executed during this read-only review. (extensions/crabbox/src/crabbox-worker-project.test.ts:145, 4ddee76e9413)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-09T17:30:18.352Z sha 07fe992 :: blocked before merge. :: none
  • reviewed 2026-09-09T17:43:05.723Z sha 4ddee76 :: blocked before merge. :: none
  • reviewed 2026-09-09T17:50:59.724Z sha 4ddee76 :: blocked before merge. :: none

Retain the independent plugin registration boundary checks and account for the explicit native-capture wait plus command settlement. The old literals failed in CI and locally; all 29 registration, lazy-load, cancellation, and stop cases pass with the corrected budget arithmetic.
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 9, 2026
@steipete
steipete merged commit 115af64 into main Sep 9, 2026
153 checks passed
@steipete
steipete deleted the codex/crabbox-checkpoint-wait-main branch September 9, 2026 18:26
@steipete

steipete commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
…nclaw#143288)

* fix(crabbox): align native checkpoint capture deadlines

Match the explicit native-capture wait with provider source lifecycle and child-settlement budgets. Keep long-running captures distinct from uncertain outcomes in operator guidance, preserving capture ownership and manual recovery guards. Validation covers delayed readiness, provider cancellation and cleanup, the landed non-submission behavior, and CLI/Doctor/maintenance guidance. Live AWS qualification follows on the prepared-checkout integration.

* test(crabbox): align registered lifecycle budget expectations

Retain the independent plugin registration boundary checks and account for the explicit native-capture wait plus command settlement. The old literals failed in CI and locally; all 29 registration, lazy-load, cancellation, and stop cases pass with the corrected budget arithmetic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: crabbox gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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