Repository navigation
perf(workers): streamline cloud startup and fix bootstrap archive races - #134043
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 1:46 PM ET / 17:46 UTC. ClawSweeper reviewWhat this changesThe branch removes redundant cloud-worker readiness probes after trusted setup and successful image forks, enables Daytona snapshot capture to stop its source, and records the filesystem-applied modes in bootstrap archives. Merge readinessKeep open for explicit maintainer review: this member-authored, maintainer-labeled PR has no confirmed introduced source defect, but its Daytona behavior depends on an external Crabbox CLI contract that could not be directly inspected in this offline review. Priority: P2 Review scores
Verification
How this fits togetherCrabbox is the bundled cloud-worker provider used by the Gateway to allocate a machine, prepare project and runtime state, capture reusable images, and enroll a node. The bootstrap artifact builder packages the Gateway runtime that is transferred to that node. flowchart LR
A[Gateway worker request] --> B[Crabbox allocation]
B --> C[Project and runtime preparation]
C --> D[Snapshot capture or warm fork]
D --> E[Node enrollment]
E --> F[Bootstrap artifact transfer]
F --> G[Active cloud worker]
Decision needed
Why: The introduced command directly depends on that external CLI contract, but network resolution prevented direct upstream-source or released-binary inspection in this review. Before merge
Agent review detailsSecurityNone. PR surfaceSource +31, Tests +69, Docs +2. Total +102 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Before merge, independently verify the documented Crabbox 0.41.1 command contract and Daytona stop/capture/restore behavior, then retain this owner-boundary split and archive-mode repair. Do we have a high-confidence way to reproduce the issue? No high-confidence independent reproduction was available: the prior behavior is clear in current-main source, but this read-only review could not execute the provider path or inspect the external Crabbox implementation. Is this the best way to solve the issue? Unclear pending external-contract verification. The code keeps readiness refreshes where setup can alter SSH state and narrows only the internally owned paths, which is the right shape if the Daytona lifecycle claim holds. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b75d04d01617. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
@clawsweeper re-review Head The earlier requested Crabbox flag/source contract evidence is posted above. Full Daytona Gateway proof remains unavailable in this run; the already-recorded live Daytona evidence covers native capture, restore and two isolated fixed-ID forks, not Gateway dispatch. A bounded Machine0 Gateway cold/warm experiment is in progress. Its outcome will be reported separately; it is not yet a successful cloud-turn result. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Reuse the successful snapshot fork attestation and finish trusted runtime preparation and enrollment through the shared command cleanup owner. Keep provider readiness refreshes for arbitrary setup and native capture. Allow Daytona to perform its required snapshot stop/capture/restore cycle. Validated with 372 Linux tests, canonical changed-surface checks, and the full QA-enabled build. The only later test edit removes an unused import.
Remove the obsolete post-enrollment inspect expectation for AWS worker-turn and Hetzner remote-exec. The explicit lifecycle inspection remains covered. All six existing plugin-entrypoint cases pass; runtime bytes are unchanged.
05eb09a to
f47921a
Compare
|
Merged via squash.
|
…es (openclaw#134043) * perf(crabbox): streamline warm project activation Reuse the successful snapshot fork attestation and finish trusted runtime preparation and enrollment through the shared command cleanup owner. Keep provider readiness refreshes for arbitrary setup and native capture. Allow Daytona to perform its required snapshot stop/capture/restore cycle. Validated with 372 Linux tests, canonical changed-surface checks, and the full QA-enabled build. The only later test edit removes an unused import. * test(crabbox): align classless enrollment inspection expectation Remove the obsolete post-enrollment inspect expectation for AWS worker-turn and Hetzner remote-exec. The explicit lifecycle inspection remains covered. All six existing plugin-entrypoint cases pass; runtime bytes are unchanged. * test(auto-reply): prepare model capabilities in mock followups * fix(workers): record actual bootstrap file permissions
What Problem This Solves
Cloud startup repeats provider inspections after trusted setup and successful snapshot forks. Daytona also rejects capture of a running source without explicit permission to stop it. A real Gateway experiment exposed another startup failure: Node's process-wide umask getter can race concurrent archive writes, making recorded permissions disagree with the staged files and preventing allocation.
What Changed
Trusted runtime and enrollment scripts use the existing command-completion and failure-cleanup owner. Arbitrary profile/desktop setup still refreshes readiness and security information, and native capture still refreshes the restored source. A successful fork carries its exact checkpoint identity forward; a replaced image still requires verification. Daytona receives its required
--no-reboot=falseflag.The archive producer records the permissions actually applied by the filesystem, retaining the verified input digest and full final archive comparison. Windows normalization is unchanged. A shared test fixture now supplies its prepared model capabilities, removing unintended catalog discovery without changing production behavior or test deadlines.
No configuration, schema, retention policy, timeout, setup semantics or enrollment authority changes. This does not introduce prepared running capacity or make new sessions start in seconds.
Validation
024f984209ce95d3ba5c6608bac78c51c83e7938. The current headf47921a367b1a002184170c745a77237ec716a09replays the same substantive changes ontoace8a13, retaining newer main lifecycle/store fixes. Every added/deleted line remains identical, and the root changelog matches main. The earlier build/live results prove preserved PR behavior; they are not an exact rebased-artifact claim. The generated payload and seven native targets were independently verified; the actual compiled bootstrap producer passes under umask 077 with 10,362 archive entries. Public package assets and local Gateway command execution also pass.The real Machine0 Gateway flow passed cold, warm and already-active worker turns. The warm session forked the same snapshot while the cold session remained connected. Both fresh identities, pristine Git commit/tree, dirty/untracked overlay isolation and retained runtime digest were verified. Warm performed no project upload/install, runtime installation/download, new capture, origin request or full-pack request.
This used a mock model and a three-file synthetic project. The cold runtime transfer alone took 431.616s, so the difference is not a pure snapshot-speed measurement. The warm worker bundle still transferred separately in 42.004s. Setup ran per provision; the retained build marker is a machine cache outside the project, not proof of arbitrary project builds. Permissions stayed unset. Node plugin plan was empty: Codex remote-exec and plugin-enablement latency are not measured.
Both VMs and the image were deleted through canonical owners and independently absent under the unchanged account. The controller returned 1 on a final process-probe EPERM after child closure; a separate exact PID/process-group read proved absence. That failure and reconciliation remain recorded. All helper processes stopped and task access files were removed.
Daytona Contract and Remaining Scope
Direct source inspection and real native Daytona capture/restore/fork proof cover the changed flag contract: Crabbox declares and forwards the flag, and the Daytona owner stops, captures, waits for settlement and restores readiness. Its native capture barrier does not depend on
--wait. The real capture completed in 13.412s; two fresh forks completed in 7.717s and 7.193s with Git/build markers preserved and session overlays isolated. Cleanup verified all native resources absent. Relevant source blobs match the tested Crabbox binary; this is not an official release claim.The latest ClawSweeper review of
f47921a3asked whether the new flag requires a higher released Crabbox minimum. It does not: published Crabbox 0.41.1, the documented baseline, already declares and forwardsno-reboot. The checksum-verified released macOS ARM64 binary acceptscheckpoint create --provider daytona --no-reboot=false --helpwith exit 0; invalid-boolean and unknown-flag controls exit 2. These parser runs used empty isolated configuration with network access denied. This proves compatibility of the added flag, not full Daytona native/fixed-ID/JSON support in 0.41.1. Warm images retain their separately documented fixed-ID checkpoint capability requirement; no Doctor minimum change is justified by this flag. The native lifecycle proof above remains pinned to the tested newer Crabbox candidate.The lead directly inspected both released CLI source and the tested Daytona lifecycle. The net 24 production lines remain the canonical command-completion split, fork-fact propagation and applied-mode record. The automated stored-data classification does not correspond to a schema or serialized-shape change: the archive manifest already had a mode field, whose value now records the actual file.
Full Daytona Gateway proof remains unavailable because live credentials are unavailable; native Daytona API proof and the full Machine0 Gateway flow remain explicitly separate. Full Daytona Gateway, Windows runtime and seconds-level prepared-session adoption remain unproven.
Production is +41/-17 (net +24), tests/support +148/-72, docs +2. Growth supplies the shared command-completion owner, carries the existing fork result and records applied file modes. Named follow-ups: investigate the unchanged deep doctor-import fixture’s 256 MiB heap variability; remove the same unsafe umask getter from fs-safe atomic text writes without implicitly changing directory permissions, which needs a separate dependency repair.