Skip to content

feat(workers): snapshot prepared projects before session enrollment - #133447

Merged
steipete merged 13 commits into
mainfrom
codex/smart-snapshot-reuse
Aug 31, 2026
Merged

steipete merged 13 commits into
mainfrom
codex/smart-snapshot-reuse

Conversation

@steipete

@steipete steipete commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #133450
Closes #133436

What Problem This Solves

Fixes an issue where users starting another cloud session for the same project still waited for repository cloning, or received a cold machine despite an existing usable snapshot. Capturing only when the first session stopped also meant a second session could not benefit while that first session remained open.

The first eligible Git project now prepares its committed checkout and node runtime, then captures a reusable machine image before node enrollment. A later session can fork that image, reuse its Git objects, and receive its own current file changes without cloning or downloading the full repository again. The first dispatch pays the preparation/capture cost; later sessions do not need to wait for the first session to stop.

Why This Change Was Made

The Gateway owns project identity, the pinned commit, bounded Git packing, and preparation authority. The provider owns transport to its operation-owned machine, native capture, and allocation. The node owns materializing the current session manifest from validated cached objects. This keeps repository policy out of Crabbox and uses one Git-pack builder for project preparation, node transfer, and SSH transfer.

Project identity combines the Gateway namespace with the canonical shared Git directory, so linked session worktrees share a cache while separate clones and Gateways remain distinct. The environment intent pins the preparation commit across retries; each seed identifies that exact commit. Native capture runs after pristine checkout and any required runtime-only installation, followed by scrubbing and fresh enrollment. A usable image skips duplicate runtime-only preparation and the SSH refresh needed after a capture. Configured profile/desktop setup and normal enrollment retain their existing per-provision behavior.

The provider records the cold/checkpoint choice and effective class before allocation, then tracks preparation and enrollment. A timeout or Gateway restart replays that same choice; an uncertain fork cannot switch to another image or silently become a cold allocation. Selected checkpoints remain pinned until confirmed provider stop. Replacement publication preserves the previous image and its deletion obligation; failed retirement remains durable and cannot delete an image still needed by another allocation.

This also preserves the earlier fixes in this PR:

  • Accept Crabbox's verified fork-readiness actions, including ready Machine0 ACTIVE responses, while retaining Docker's available/delete contract.
  • Apply the same lease lifetime, idle timeout, desktop, and public-network policy to cold allocations and checkpoint forks.
  • Build fallback Git packs only on authenticated demand, share the original immutable base, and cancel/drain/clean failed generation under its transfer owner.
  • Let providers declare resolveDestroyTimeoutMs(profile) for both normal teardown and bootstrap-failure cleanup. Crabbox accounts for its bounded capture, maintenance, stop, and process-settlement phases; native command limits are unchanged. Control UI Stop waits for the Gateway result instead of imposing a shorter timeout.

User Impact

Matching project snapshots work with private repositories and unpublished commits because preparation transfers committed Git objects without forwarding repository credentials or local Git configuration. Session edits, eligible untracked files, attachments, author metadata, and fresh node identity are applied afterward. Workspace transfer copies only validated Git objects into a fresh repository, so cached worktree files, hooks, configuration, and alternates cannot enter the next session. Missing seeds use the existing bounded pack transfer; invalid seeds fail visibly without replacing the prior workspace.

Changed commits refresh the same project's image; they do not create another project identity. Seeds retain the existing six-entry/30-day policy, with one-hour staging cleanup and protection for the current seed. Images retain the 24-hour refresh and 14-day unused-image policy. Outstanding allocations, captures, and retirements keep their ownership slots: the 128-profile and 256-allocations-per-profile bounds reject new admission with cleanup guidance rather than evicting replay or cleanup obligations. Non-Git workspaces keep the existing sync path and eligible capture at teardown.

Upgrade: this introduces a version-2 envelope in the existing plugin-state namespace, without a SQLite schema/version change or new configuration option. Stop the owning Gateway/capture processes and run openclaw doctor --fix. Doctor preserves old images, capture selectors, and retirement obligations without inventing missing allocation choices. Legacy lease rows whose original choice is unknown require the exact cleanup acknowledgement reported by Doctor before warm allocation resumes. Runtime accepts canonical state only; do not mix old/new writers or downgrade with unresolved ownership. See warm-image upgrade and recovery.

Evidence

The overlapping project-session live flow and final integration CI passed. The complete runtime/UI build at 0098afe0c47 passed. After successful CI on 9303b6397e1, main added bootstrap failure diagnostics in the same provider files. Final head ac89e409f07 resolves that conflict; its own CI run and required merge gate both passed. All 301 focused integration tests passed, with one platform skip, and a fresh full-change Codex P0 review found no actionable findings.

The live candidate remains accurately identified as 0098afe0c47: 39 of the 43 recorded runtime files are byte-identical to ac89e409f07. Main's integrations add reclaim coordination, Unicode-safe enrollment display names, bootstrap diagnostic phase labels, and an equivalent error-constructor inline in the extracted provisioning owner; the obsolete error wrapper was removed outside that original 43-file manifest. Successful allocation/capture/enrollment decisions remain unchanged. Runtime-only preparation still returns before identity activation. Earlier merged coverage passed 74 worker concurrency/recovery cases and 28 enrollment/startup cases; the latest 301-case run covers generated bootstrap scripts, truncated downloads, provider/project lifecycle, and UI integration. This distinguishes actual live behavior from the additional merged-source proof.

The real Machine0/Gateway run captured checkpoint chk_f6e4741a3958786a before first enrollment. A second session forked that exact image while the first remained active. Both independent audits verified all 64 corpus files (16 MiB), the exact committed Git tree, pristine cached seed, distinct tracked/untracked session overlays, and identical runtime digests. Both remote workers completed assistant turns. Public node inspection independently showed two distinct paired and connected nodes at the same time.

Observed phase Cold session Warm session
Full dispatch to active 1,179.779 s 211.718 s
Native allocation/fork 133.456 s 132.714 s
Normal setup command 49.060 s 10.445 s
Project seed probe 9.856 s, miss 10.617 s, hit
Project upload + install 56.512 s Skipped
Runtime-only installation 142.724 s Skipped
Native image capture 197.237 s Skipped
Fresh node enrollment 15.112 s 11.266 s

The warm trace recorded zero origin requests, full-pack downloads, project uploads/installs, runtime-only installs or artifact downloads, recaptures, and cold fallbacks. Each session downloaded only its manifest and two changed-file blobs. Cold runtime installation made one artifact request; warm made none. Allocation policy matched on both leases: requested class tiny, actual native size override large, four-hour TTL, one-hour idle timeout, public network, no Tailscale, and keep enabled.

Timing limits: this is one pair using a 16 MiB synthetic unpublished Git project and real cloud/Gateway/worker execution; only model responses were mocked. Cold dispatch includes up to 508.677 seconds of first-Gateway local bootstrap assembly, which the warm session shares through the existing process cache. Native allocation itself took essentially the same time in both sessions. The overall ratio therefore does not isolate snapshot speed. The first capture's cost is deliberately paid before enrollment. A macOS /tmp alias bug in the external audit helper was corrected during a bounded pause after cold dispatch; the same VM/image were retained and both audits passed, without changing production code or dispatch timings. Both exact native VMs were confirmed absent from successful provider inventory, and the exact image was explicitly not found. The unrelated preexisting VM was untouched; task Gateway and rig processes stopped.

The runtime optimization passed all 87 focused snapshot/project cases. The final owner fix rejects late runtime grants and cleanup after ownership changes; both regressions failed before the fix and all 11 project and 20 protocol cases passed afterward. Core/plugin production and test typechecks, selected static checks, and focused lint passed through the recorded reruns. Fresh full-change and final test-only Codex reviews found no actionable P0 findings. The earlier live run does not establish the new capture-before-enrollment flow or its speedup.

Initial CI exposed stale provision-budget and cancellation-signal expectations, plus a release-navigation fixture changed concurrently on main. Those are corrected; the navigation fixture now uses main's canonical version. One unrelated full docs-copy test exceeded its existing 120-second limit locally; its assertions and timeout are unchanged, and final CI passed. Live QA startup also exceeded its local CLI wrapper during isolated repair; normal standalone repair completed successfully before using the public Gateway launcher against that repaired state. No cloud resources were allocated by the failed setup attempts.

Two subsequent attempts completed cold capture before enrollment but failed in the external audit harness before reaching a warm session: the first audit command competed for the lease claim; the replacement expected SSH fields omitted by read-only inspection. Both VMs and images were confirmed removed. The corrected harness uses source-verified host/user/key metadata, asynchronous direct SSH with existing strict host trust, complete stdout draining, and bounded resource preservation on audit failure. Its connection metadata was tested against the saved real response, and its exact content assertions passed a resource-free two-workspace Git fixture. These partial attempts establish capture ordering only; they are not warm-flow or speedup proof.

Completed project validation:

  • Genuine pre-fix reproductions: three prepared-seed cases downloaded an unwanted full pack; inherited plain-project replay rejected its own idempotency key; and the old provider enrolled before project preparation/capture. Candidate versions passed the corresponding regressions.
  • 389 Crabbox provider, setup, image ownership, migration, and Doctor tests passed, with one Linux-only skip. Broader Gateway coverage exercised 426 cases; four new-argument fixture assertions were corrected and passed focused reruns. These are overlapping runs, not an aggregate count.
  • 41 node transfer/seed/memo cases passed, with two Windows-only skips. Focused proof also passed six generated project-script cases, three project/Git-base cases, five Doctor contract/declaration cases, and four authenticated Git/HTTP pack cases. Coverage includes dirty/deleted overlays, symlinks, absent/corrupt/oversized seeds, exact commit contents, retention, immutable replay, capture pins, and failed cleanup.
  • Core/plugin production and test typechecks, targeted lint/formatting, and diff checks passed for the recorded project implementation. Scoped Codex P0 autoreviews reported no actionable findings; this is not a claim of an independent review at every priority.
  • The final live pair proved pre-enrollment capture and overlapping exact-image reuse, no repeated project/runtime work, matching full corpus and base tree, isolated overlays, fresh node identities, and successful worker replies. The phase measurements and their limits are above.
Earlier live evidence: prior stop-and-capture flow only

The earlier real Machine0 flow completed cold session → UI Stop/capture → verified image fork → warm session, with assistant replies in both sessions. Full dispatch measured 542.9 seconds cold and 202.7 seconds warm; native capture took 200.4 seconds and UI Stop completed in 216.9 seconds. Cold dispatch included about 221 seconds of local artifact preparation, and native forking itself was slower, so this pair does not isolate snapshot speed. Both sessions issued zero fallback-pack requests, the warm session used the recorded Git seed, and task VMs/image were verified removed.

These screenshots document that prior flow and the earlier UI Stop fix, not the new project-snapshot implementation:

Prior cold session Prior warm session
Prior cold session Prior warm session

Prior UI Stop remaining pending during provider-owned capture

Earlier regression runs also covered readiness, lazy packing, and both teardown paths timing out at 300,001 ms before their fixes. The final affected UI follow-through passed 459 tests. Those results support the earlier changes only.

Review decisions and dependency contract

The maintainer accepted the optional resolveDestroyTimeoutMs provider contract and the durable allocation/project-preparation direction implemented here. The hook remains optional, provider-agnostic, validated before effects, and subordinate to an explicit service override. Both SDK overview and worker-provider reference document it.

The latest ClawSweeper review and rank-up requests, updated August 30 at 22:29 UTC against 0098afe0c47, ask for production HTTP revocation proof, prepared-project and Doctor recovery proof, and matching Codex contract inspection. The owner direction above is accepted. All three requests are addressed by the live pair above and the HTTP, Doctor, and dependency evidence below. The bot has not yet rerated that evidence; no new source finding is being skipped.

Runtime artifact final-I/O proof: on exact head 9303b6397e1, the real SQLite store, runtime preparation manager, transfer callback, and production HTTP handler served requests over TCP. An authorized grant delivered the exact 1,049,369-byte synthetic archive, verified byte for byte. Separate unused grants returned HTTP 404 with zero archive bytes after runtime closure and after authoritative requestDestroy; the latter retained an un-aborted runtime signal, exercising the owner predicate. Closing the real grant after its file descriptor opened but before response headers also returned 404 with zero archive bytes. A retained bearer after that closure was rejected. Five requests passed with no handler failures; server, temporary state, and archive were cleaned up. Only archive production was synthetic. This proves rejection at final HTTP delivery, including the after-open window; it does not claim revocation after bytes have already streamed.

Doctor recovery proof: the actual packaged CLI used isolated SQLite and synthetic resource IDs. All four Doctor/recovery owner files match 9303b6397e1 byte for byte. Legacy inspection failed with the Doctor instruction; openclaw doctor --fix --non-interactive migrated four rows while preserving image metadata, capture ownership, retirement obligations, and the unknown-choice lease. Recovery without acknowledgement failed without changing any row. Exact acknowledged recovery preserved three images and the pending retirement. Separate-process reopen and an idempotent second Doctor run passed. Canonical v2 admission/release then passed with only its native command runner replaced by an in-memory fake. No cloud resources or normal operator state were touched.

Crabbox v0.47.0 source was independently inspected: fork lease flags, allocation policy application, common native readiness, and Machine0 verification. Native capture stops, saves, waits for readiness, and restarts the source, which is why project capture precedes enrollment.

The acting maintainer agent personally inspected the matching Codex rust-v0.151.0 source at commit 78c290807ce710180111df227df3b7a4fe845452: platform-native launcher selection, per-session/process execution parameters, process shutdown, and per-request environment construction. OpenClaw's managed binary, node exec-server, and bootstrap artifact owners were also checked: destination-native dependencies remain exact pins; fresh executor/session identity and temporary home remain outside the reusable project seed. No Codex protocol or archive-format change is introduced. This is source-contract proof, not a claim of live Codex remote-exec execution.

Size and release note

Named performance follow-up: Reduce first-Gateway node bootstrap artifact assembly I/O. Live process/file inspection identified cold local preparation in node-bootstrap-artifact.ts copying the built distribution into its immutable package, including declaration files, before any provider allocation. The second session shares this process-owned artifact cache. Keep that local cost separate from native allocation and snapshot savings; changing the packaging contract is outside this snapshot repair.

At final head ac89e409f07, the effective change against integrated main 3ef446c7b6b is production +2,639/-1,066 (net +1,573); tests/test support +2,456/-400 (net +2,056); docs +57/-27 (net +30), across 81 effective files. Upstream-only changes are excluded; moves cancel in the net figures. Production growth supplies the newly accepted project-preparation capability, durable allocation/capture/retirement ownership, and Doctor migration/recovery. The refactor removes duplicate pack construction, separates admission and Git initialization into their owners, and stops treating the former enrolled-lease registry as allocation-choice authority. No configuration option, SQLite table, or schema version is added; persisted envelope and retention/admission semantics do change as described above.

Release note for the release-only changelog generator: Cloud workers: capture pristine project checkouts before enrollment, reuse snapshots across subsequent sessions without cloning, preserve allocation choices across retries, and let provider-owned capture finish during safe reclaim. Existing warm-image state migrates through Doctor.

@clawsweeper

clawsweeper Bot commented Aug 30, 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 docs Improvements or additions to documentation gateway Gateway runtime extensions: crabbox size: M maintainer Maintainer-authored PR labels Aug 30, 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: 🐚 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 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 30, 2026, 6:28 PM ET / 22:28 UTC.

ClawSweeper review

What this changes

The branch snapshots a Git project and node runtime before cloud-worker enrollment so Crabbox can capture and reuse prepared worker images, while adding warm-state migration and teardown handling.

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 6 items remain

The branch remains necessary and source review supports its provider-owned lifecycle direction, but merge review is incomplete: the new pre-enrollment artifact capability lacks final-I/O revocation proof and its Codex remote-exec dependency contract cannot be inspected locally.

Priority: P2
Reviewed head: 0098afe0c47f17a7db1073b58981b25d51d48ade
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The architectural patch is materially covered by focused tests, but final-effect authority proof and the required Codex contract check are missing.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: Authority-chain proof required: attempt the prepared runtime artifact download after the nearest operation closure or revocation through the production HTTP streaming owner and show it rejects before any archive bytes stream; current tests cover the service boundary, not that final effect. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: attempt the prepared runtime artifact download after the nearest operation closure or revocation through the production HTTP streaming owner and show it rejects before any archive bytes stream; current tests cover the service boundary, not that final effect. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 7 items Authority enforcement in source: Artifact transfer revokes a capability when its owner is stale, then the HTTP callback rechecks authorization after opening the file and while streaming chunks; source has no demonstrated final-I/O revocation scenario.
Runtime grant lifecycle: Runtime preparation is operation-bound and provider provisioning closes a stale prepared runtime before it can be retained; this aligns the new artifact authority with the provisioning owner.
Existing tests stop below final HTTP delivery: Tests prove that closed runtime preparation can no longer authorize or open an artifact, but they call the transfer service rather than the production HTTP stream endpoint.
Findings None None.
Security None None.

How this fits together

Cloud-worker provisioning converts a session workspace into a provider allocation, prepared node runtime, enrolled node, and synchronized session. The added preparation stage lets a provider capture a clean project and runtime before node credentials exist.

flowchart LR
A[Session workspace] --> B[Gateway project snapshot]
B --> C[Cloud provider allocation]
C --> D[Runtime preparation]
D --> E[Image capture]
E --> F[Node enrollment]
F --> G[Workspace synchronization]
G --> H[Worker session]
Loading

Decision needed

Question Recommendation
Should OpenClaw accept this expanded worker-provider API and durable Crabbox warm-image migration contract after the missing final-effect proof is supplied? Accept the lifecycle contract: Retain the generic preparation API and land after final-I/O authority and upgrade recovery evidence is supplied.

Why: The change creates a reusable provider lifecycle capability and changes durable upgrade behavior; source review cannot determine whether that public plugin and operational tradeoff is desired.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: attempt the prepared runtime artifact download after the nearest operation closure or revocation through the production HTTP streaming owner and show it rejects before any archive bytes stream; current tests cover the service boundary, not that final effect. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - A closed or revoked pre-enrollment runtime grant has not been exercised through the production HTTP artifact stream to prove it rejects before archive bytes reach the remote machine.
  • Resolve merge risk (P1) - The warm-image v2 upgrade can block existing Crabbox warm provisioning until legacy allocation rows receive explicit provider-cleanup acknowledgement.
  • Resolve merge risk (P1) - The changed bootstrap archive is used by Codex remote-exec, but the required direct Codex source inspection is unavailable in this checkout.
  • Complete next step (P2) - This maintainer-owned provider API and durable-state migration needs owner direction plus authority and upgrade proof, not an automated repair.
Agent review details

Security

None.

PR surface

Source +1590, Tests +2036, Docs +30. Total +3656 across 79 files.

View PR surface stats
Area Files Added Removed Net
Source 47 2666 1076 +1590
Tests 27 2429 393 +2036
Docs 5 57 27 +30
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 79 5152 1496 +3656

Review metrics

Metric Value Why it matters
Production versus test change production +2,643/-1,070; tests/support +2,452/-399; docs +57/-27 The large production growth is tied to a new provider lifecycle and migration, so the owner boundary and proof need proportionate scrutiny.
Persisted warm-image state 1 state envelope changed; 1 Doctor migration added Existing Crabbox warm-image records may require controlled recovery before provisioning resumes.

Stored data model

Persistent data-model change detected: durable storage schema: src/gateway/worker-environments/node-worker-workspace-actions.ts, durable storage schema: src/gateway/worker-environments/node-workspace-transfer-service.ts, durable storage schema: src/gateway/worker-environments/node-workspace-transfer-snapshot.ts, durable storage schema: src/gateway/worker-environments/placement-dispatch-startup.ts, durable storage schema: src/gateway/worker-environments/project-preparation.ts, durable storage schema: src/gateway/worker-environments/project-seed-script.ts, and 33 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Prove final-effect revocation (recommended)
    Exercise an authorized artifact download and a closed or revoked pre-enrollment grant through the HTTP streaming owner, showing rejection before archive bytes stream, then validate the Doctor recovery path.
  2. Accept the residual operational risk
    Land with the current service-level revocation tests while explicitly accepting that HTTP final-effect and upgrade recovery evidence remains absent.
  3. Pause the generic provider expansion
    Defer this branch if the new API and persisted-state migration cannot receive the required owner and operator proof.

Technical review

Best possible solution:

Keep one provider-owned preparation flow, prove revocation at the artifact HTTP final effect, and obtain explicit maintainer acceptance of the provider API and warm-state upgrade contract.

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

No; focused tests exercise the component lifecycle, but the PR describes the final project flow as pending and provides no final-head live reproduction.

Is this the best way to solve the issue?

Unclear; the source follows the provider-owned lifecycle, but absent Codex contract inspection and final-I/O authority proof prevent a best-solution verdict.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: attempt the prepared runtime artifact download after the nearest operation closure or revocation through the production HTTP streaming owner and show it rejects before any archive bytes stream; current tests cover the service boundary, not that final effect. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P2: This is a substantial cloud-worker lifecycle improvement with bounded operational impact rather than a demonstrated urgent outage.
  • merge-risk: 🚨 compatibility: The branch expands the provider contract and changes durable warm-image records that existing operators must migrate or recover.
  • merge-risk: 🚨 security-boundary: A pre-enrollment bearer archive capability reaches a remote machine and still needs final-effect revocation proof.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: attempt the prepared runtime artifact download after the nearest operation closure or revocation through the production HTTP streaming owner and show it rejects before any archive bytes stream; current tests cover the service boundary, not that final effect. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Acceptance criteria:

  • [P1] Exercise revoked prepared-runtime artifact delivery through the production HTTP streaming boundary and verify no archive bytes are delivered.
  • [P1] Run the exact-head prepared-project capture/enrollment flow with a Crabbox provider and validate legacy warm-state recovery via Doctor.

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.

  • Add production HTTP artifact-stream proof for the nearest closed or revoked runtime preparation, including no bytes delivered.
  • Demonstrate the final prepared-project cloud flow and the Doctor recovery path on the exact head.
  • Inspect and cite the matching Codex remote-exec artifact contract before declaring compatibility.

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 (7 earlier review cycles)
  • reviewed 2026-08-30T18:28:14.245Z sha b560863 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-30T18:39:12.868Z sha 5dd5c5c :: needs maintainer review before merge. :: none
  • reviewed 2026-08-30T19:42:44.348Z sha 5ff8267 :: found issues before merge. :: [P2] Document the teardown timeout in the manifest contract
  • reviewed 2026-08-30T19:49:29.538Z sha 5ff8267 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-30T20:17:45.679Z sha d15c688 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-30T21:44:25.009Z sha c74612f :: needs maintainer review before merge. :: none
  • reviewed 2026-08-30T22:14:24.320Z sha 0098afe :: needs maintainer review before merge. :: none

@steipete steipete changed the title fix(workers): preserve warm lease limits and skip unused workspace packs fix(workers): reuse ready cloud snapshots and skip redundant packing Aug 30, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 30, 2026
Give providers a bounded teardown budget for reclaim and bootstrap cleanup.
Keep queue ownership checks and explicit service overrides in the shared
owner lifecycle. Account for Crabbox capture, maintenance, lease removal,
and process settlement without extending native command timeouts.

Let Control UI Stop wait for the Gateway outcome. Cover both teardown
entrances, invalid budgets, override precedence, and stale queued owners.
@steipete steipete changed the title fix(workers): reuse ready cloud snapshots and skip redundant packing fix(workers): reuse verified snapshots and honor teardown deadlines Aug 30, 2026
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L and removed size: M labels Aug 30, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 30, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The final head adds the provider-owned teardown deadline and UI wait behavior, beyond the previously reviewed scope. The PR body now includes direct installed-Crabbox contract links, the successful real cold/capture/warm flow, observed lease policy, seeded workspace reuse, sanitized screenshots, and the timing caveats. All task cloud resources were cleaned up; local checks and the final packaged build pass.

The PR remains draft while exact-head CI runs and the separate durable allocation-choice/class/enrollment refactor in #133436 awaits maintainer design acceptance. No persistent-state implementation is included in this head.

@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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. labels Aug 30, 2026
@clawsweeper clawsweeper Bot added 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: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. 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. labels Aug 30, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The final code head is 63ce71b055e. This now includes the maintainer-accepted durable allocation-choice design and project checkout/runtime capture before enrollment, so a second session can reuse the image while the first remains open. Both earlier Rank-up moves are addressed in the PR body.

The full packaged build, owner regressions, and merged Stop/dispatch integration tests passed. Exact-head CI and the new overlapping-session live proof are still running; the body explicitly separates them from the earlier Stop-and-capture evidence. I will add the new measured flow and confirmed cleanup before landing.

@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete merged commit c753bbd into main Aug 31, 2026
262 checks passed
@steipete
steipete deleted the codex/smart-snapshot-reuse branch August 31, 2026 01:17
@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 31, 2026
…penclaw#133447)

* fix(workers): preserve warm lease policy and defer workspace packing

* fix(crabbox): recognize verified native image readiness

* fix(workers): honor provider snapshot teardown deadlines

Give providers a bounded teardown budget for reclaim and bootstrap cleanup.
Keep queue ownership checks and explicit service overrides in the shared
owner lifecycle. Account for Crabbox capture, maintenance, lease removal,
and process settlement without extending native command timeouts.

Let Control UI Stop wait for the Gateway outcome. Cover both teardown
entrances, invalid budgets, override precedence, and stale queued owners.

* test(ui): align cloud worker stop deadline assertions

* docs(plugins): document provider teardown budgets

* feat(workers): capture prepared project snapshots before enrollment

* perf(workers): skip runtime preparation on project snapshot hits

* fix(workers): fence project setup and cleanup after runtime grants

* test(workers): align lifecycle and release navigation expectations

* test: use canonical release navigation coverage from main
steipete added a commit that referenced this pull request Oct 25, 2026
Reuse worker-confirmed empty SQLite plugin-state observations through the existing bounded receipt-invalidated cache, retain Reef read operations, and retain successful Crabbox legacy readiness at its manager. Keep TTL expiry, mutation settlement, first-handler validation, failure retries, generic snapshots and PostgreSQL external-write visibility. No schema or public SDK signature changes.

Synthetic Gateway counts: Reef steady 21 to 17 SQL and 13 to 9 requests per minute; Crabbox 15 to 11 SQL and 10 to 6 requests per two minutes. Runtime main-thread SQL remains zero. Focused owner and SDK tests, isolated review rounds and exact-head CI including all three PostgreSQL shards pass.

The retired Crabbox legacy writer was removed in #133447.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
…law#183223)

Reuse worker-confirmed empty SQLite plugin-state observations through the existing bounded receipt-invalidated cache, retain Reef read operations, and retain successful Crabbox legacy readiness at its manager. Keep TTL expiry, mutation settlement, first-handler validation, failure retries, generic snapshots and PostgreSQL external-write visibility. No schema or public SDK signature changes.

Synthetic Gateway counts: Reef steady 21 to 17 SQL and 13 to 9 requests per minute; Crabbox 15 to 11 SQL and 10 to 6 requests per two minutes. Runtime main-thread SQL remains zero. Focused owner and SDK tests, isolated review rounds and exact-head CI including all three PostgreSQL shards pass.

The retired Crabbox legacy writer was removed in openclaw#133447.
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 docs Improvements or additions to documentation extensions: crabbox gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Machine0 cloud sessions never reuse verified warm images [Bug]: Warm cloud provisioning retries fail after snapshot refresh

1 participant