Repository navigation
perf(crabbox): skip runtime preparation when a warm fork already holds the runtime - #168974
Conversation
…e runtime A warm fork whose image was captured for the exact current node runtime already holds the verified runtime and published worker archive. Skip the separate runtime-preparation Crabbox run there; enrollment still verifies the runtime, and the node fetches a missing worker bundle from the Gateway. Live trace: that run cost 43 s (6 s of script work plus Crabbox run overhead) of a ~190 s warm AWS start.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR skips runtime preparation when a forked checkpoint records the exact runtime requested by the Gateway. Example: An AWS worker forks a checkpoint with matching node-bootstrap and worker-bundle identities.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it removes redundant work from warm cloud starts, remains necessary on main, and introduces no concrete defect found in this review. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Crabbox plugin translates Gateway worker provisioning into checkpoint allocation and remote setup commands, returning an enrolled node device. flowchart TD
Gateway[Gateway provisioning] --> Provider[Crabbox provider]
Provider --> Catalog[Warm image catalog]
Catalog --> Fork[Checkpoint fork]
Fork --> Identity[Runtime identity comparison]
Identity --> Preparation[Runtime preparation when needed]
Identity --> Enrollment[Node enrollment]
Preparation --> Enrollment
Enrollment --> Node[Active worker node]
Technical reviewBest possible solution: Retain the matching-runtime shortcut with existing enrollment verification and authenticated artifact recovery. Do we have a high-confidence way to reproduce the issue? Current main directly shows matching non-project warm forks entering runtime preparation; the reported AWS timings were not independently reproduced. Is this the best way to solve the issue? The shortcut fits the existing provider owner and preserves cold preparation, runtime mismatch handling, fresh enrollment, and bundle recovery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 43c68c34df71. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +20, Tests +34. Total +54 across 3 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 11, 2026, 3:28 AM ET / 07:28 UTC. |
…s the runtime (openclaw#168974) A warm fork whose image was captured for the exact current node runtime already holds the verified runtime and published worker archive, so the provider now skips the separate runtime-preparation Crabbox run there. Enrollment still verifies the runtime (and downloads it if absent), and the node fetches a missing worker bundle from the Gateway. Forks of images captured for another runtime still prepare. Live AWS warm dispatch: 88 s to active (was 187-217 s); Crabbox ran checkpoint fork (45 s) plus one enrollment run (31 s).
First-parent upstream 75df19c..5ed6a30 (23 commits, including openclaw#169005 infrastructure SQLite work and runtime-write offload, openclaw#169062, openclaw#136677, openclaw#169070, openclaw#168857 plugin-sdk SQLite runtime writes into workers, openclaw#169038, openclaw#168916, openclaw#169053, openclaw#169052 closed-turn transcript work in workers, openclaw#168974, openclaw#168811, openclaw#169082, openclaw#169084, openclaw#166581 worker heap limits). Conflicts: - openclaw-state-worker-runtime.ts: upstream routes more update-run mutations to the worker; our continuation custody dispatch stays ahead of that branch. - worker-access inventory: regenerated (632 files, 2429 calls). server-restart-sentinel.ts auto-merged: upstream's awaited update-run writes; our continuation restart delivery is unaffected. Refs #1475 Co-Authored-By: Claude Opus 5.5 <[email protected]>
What Problem This Solves
Fixes: cloud sessions started from a warm image re-run a separate runtime-preparation script on every start, even when the image already holds the exact runtime. That costs one full Crabbox run, about 43 s on AWS.
User Impact
User impact: warm cloud-session starts become active about 40 s sooner when the warm image matches the Gateway's current runtime, which is the normal case between Gateway updates. Cold starts, prepared projects, and forks from an image built for an older runtime are unchanged.
Why This Change Was Made
A live trace of a warm AWS start (about 190 s to active) showed two Crabbox runs before the node launched:
Crabbox adds about 20–25 s of fixed overhead to each run.
The image records the runtime identity it was captured for. When that identity deep-equals the current one, the provider now skips the runtime-preparation run. Core treats
prepareNodeRuntimeas optional, sobegin()doesn't depend on it.Safety comes from paths that already exist:
Evidence
checkpoint fork(45 s), then a single enrollment run (31 s); there was no runtime-preparation run.