Repository navigation
fix(crabbox): reuse source mirrors after canceled preparation - #206267
Conversation
|
🦞👀 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: blocked before merge. What this changesPreserve preparation state when recording artifacts before consumer settlement so completed, unused source mirrors remain reusable. Example: A Blacksmith preparation completes, then SIGTERM arrives before provider admission.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this maintainer-authored PR addresses a source-confirmed mirror-reuse bug still present on main; no introduced correctness defect was found. Reviewed head: Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe Crabbox wrapper prepares local source capsules, records consumer and artifact lifecycle facts, and hands eligible source mirrors back to subsequent remote-check invocations. flowchart TD
A[Crabbox wrapper invocation] --> B[Source capsule preparation]
B --> C[Staging receipt owner]
C --> D[Provider admission]
D --> E[Consumer settlement]
C --> F[Artifact preservation]
E --> F
F --> G[Idle mirror handoff]
G --> B
Technical reviewBest possible solution: Keep the single producer-side condition and the existing idle-mirror admission and recovery owners. Do we have a high-confidence way to reproduce the issue? Source establishes the failure: pre-admission cleanup changes prepared to preserved while users remain none, causing idleMirror to reject reuse; no target code was executed during this read-only review. Is this the best way to solve the issue? The condition repairs the incorrect lifecycle fact at its producer without weakening reuse checks, adding state, or rewriting historical receipts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 71b9c69723d0. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +42, Other +2. Total +44 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
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 November 26, 2026, 8:08 PM ET / November 27, 2026, 01:08 UTC. |
|
Merged via squash.
|
* commit '7df6cb759f9e604921536a700e2f527c5516e7de': (185 commits) docs: clarify what telemetry OpenClaw sends and how to opt out refactor(ui): remove retired stream-follow test seams (#206316) fix: distinguish missing command results from unknown outcomes (#206313) fix(build): reuse stamps after identical pnpm installs (#206282) chore(ci): inventory Gateway model catalog worker lifecycles (#206251) fix: keep failed image inspections inside chat activity (#206283) fix: clarify sent-message labels and chat activity icons (#206048) fix(cron): use the service's free memory for extra automation runs (#206322) test(android): reuse the shared TLS fixture (#206280) fix(ui): restore New Session recovery during startup (#206319) test(macos): align new Gateway URL expectations (#206281) feat: let doctor --fix tell when its startup repairs have nothing to do (#206246) fix(android): pause idle gateway discovery without blocking consumers (#196209) fix(ci): prepare the Android SDK for scheduled CodeQL scans (#203843) fix(memory): read delegated cgroup pressure from the mapped leaf (#206308) improve(config): reuse plugin metadata during auto-enable (#206289) improve: copy only the selected model for agent completions (#206287) fix(pr): refresh tooling before preparing reviewed incoming PRs (#206236) fix: keep Gateway ready while plugins drain after updates (#206299) fix(crabbox): keep unused prepared mirrors reusable (#206267) ...
What Problem This Solves
Canceling a Crabbox run after source preparation finishes but before provider admission can strand its reusable source mirror. Cleanup records preserved artifacts and changes the lifecycle phase to
preserved, even though the mirror has never had a consumer. The next run then rejects the mirror's otherwise complete idle handoff and must prepare another copy.User Impact
Interrupted remote-check preparation can leave a completed, unused mirror available for the next run. Active or incomplete staging remains protected. This changes developer tooling only; no configuration, migration, or historical-receipt rewrite is required.
Why This Change Was Made
Artifact preservation now changes the phase only after admitted consumers have settled. Earlier phases retain their existing state while recording the same artifact manifest and durability result. The idle-admission rules remain unchanged.
The regression coverage extends existing fixtures for prepared and settled mirror reuse, incomplete/admitted preservation, and cancellation queued during synchronous preparation before the first admission checkpoint. Production delta is +2 comment lines; test delta is +42 lines. The simplification pass retained the single producer-side condition and reused the existing fixtures.
Evidence
users=noneandstate=preserved; the native idle-mirror check rejected that combination. This PR does not alter that retained receipt.git diff --checkand signature verification passed.1ceb6f948591b53322c0aba713376646d8324459(treed9a9257d0fad0f5e3d36f26d524b9dcc81f6340d), whose ordered parents are base7642a7fa697517f612e8d9de2a975ddb1c16b459and reviewed head0f4427a025562b735280cde14fa6722a59109cdb.Review follow-up: receipt compatibility and cancellation
This addresses the same-head review's compatibility and behavior-proof requests.
6ea542fd97e2876aa4c871ccc494ed5419a03c5c. Its complete staging owner and wrapper are byte-identical to this PR's base and the source used for the observed cancellation failure. The release's staging artifact, claim, directory-identity, location, process-provenance, user, and witness owners also match the PR base. Relevant dependency pins remain Zod 4.6.7, TSX 4.23.15, and Vitest 5.0.5, with the same supported Node range. The existing source-capsule optimization differs from the release, so this is not a claim that the entire checkout equals the release.users=none,state=preparedcombination; settled consumers still produceusers=settled,state=preserved. Existing receipts remain readable under the same rules. Previously strandednone/preservedreceipts are not promoted, migrated, or automatically removed by this fix.none/preparedreceipt. The staging handoff regression then exercises preservation and subsequent acquisition, verifies reuse of the same source inode, verifies preserved output bytes, and checks final native disposal. Prepared and settled variants both pass; incomplete/admitted/unknown-writer guards remain covered.