Repository navigation
fix(crabbox): slow coordinator reads and unsupported backends no longer strand cloud workers - #164231
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. Reviewed October 3, 2026, 8:04 AM ET / 12:04 UTC (Revision 5). ClawSweeper reviewWhat this changesThe PR retries qualifying Crabbox coordinator timeouts within existing command budgets and distinguishes fresh unsupported-backend refusals from uncertain allocation replays. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 3 items remain The work remains useful, but the previously reported warm-image reservation leak is still present at the reviewed head and blocks merge. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s cloud-worker lifecycle asks the Crabbox plugin to allocate, prepare, enroll, and release remote machines. The plugin records warm-image allocation reservations before contacting Crabbox, while core records worker progress and cleanup responsibility. flowchart TD
A[Cloud worker request] --> B[Gateway lifecycle]
B --> C[Crabbox allocation reservation]
C --> D[Crabbox command]
D --> E{Command outcome}
E --> F[Bounded timeout retry]
F --> D
E --> G[Worker enrollment]
E --> H[Refusal or cleanup settlement]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +110, Tests +458, Docs +8. Total +576 across 11 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Settle the reservation created by a definitively refused fresh attempt locally, while preserving reservations belonging to earlier uncertain allocations. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the introduced failure: enable warm images with no reusable checkpoint, return the exact backend capability refusal, and observe the pending reservation surviving terminal failure and ordinary destroy. This review did not execute that scenario. Is this the best way to solve the issue? The shared retry owner and replay distinction are appropriate, but the refusal path is incomplete because it settles core state without settling the fresh plugin reservation. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 063685e96d00. LabelsLabel changes: No label changes. Label justifications:
EvidenceAcceptance criteria:
What 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 (4 earlier review cycles)
|
Include ordinary runtime preparation in the existing fixed-lease coordinator retry policy. Extend the provider-flow regression and document the phase without changing timeouts, budgets, or allocation ownership.
4b72e69 to
748d1b3
Compare
|
Merged via squash.
|
…er strand cloud workers (openclaw#164231) * fix(crabbox): recover coordinator timeouts and reject unsupported backends * fix(crabbox): retry node runtime preparation reads Include ordinary runtime preparation in the existing fixed-lease coordinator retry policy. Extend the provider-flow regression and document the phase without changing timeouts, budgets, or allocation ownership.
What Problem This Solves
Fixes healthy cloud workers failing on coordinator reads before setup starts, and fresh unsupported-backend requests accumulating cleanup for machines that were never created.
User Impact
Transient coordinator timeouts recover on the same lease. Backends without fixed lease ID support fail with actionable guidance without starting a teardown loop for a fresh request. Earlier uncertain allocations retain their cleanup responsibility. No timeout, budget, configuration, or SDK changes are required.
Why This Change Was Made
The command owner retries only complete coordinator-timeout diagnostics that prove the script never started. Profile setup, node runtime preparation, node enrollment setup, inspect/readiness, heartbeat, and stop share at most three attempts with 1s/2s backoff inside the original phase budget. Any script output prevents retry; exhaustion preserves the diagnostic and attempt count. Allocation remains owned by provisioning replay.
The exact backend-matching exit-2 capability refusal uses the permanent provider-rejection contract. Crabbox rejects it before Warmup/Acquire. Core distinguishes a fresh request from replay so a later refusal cannot erase an earlier uncertain allocation. Missing or mismatched local claims are not proof of remote absence, so they cannot discharge cleanup responsibility.
Main integration preserves diagnostic redaction, first-boot package-manager guidance, and ordinary runtime preparation before enrollment. The added runtime-preparation phase uses the same fixed-lease script command and classifier. Its regression extends the existing provider-flow table and archive fixtures.
Evidence
Operator-observed coordinator timeouts occurred after healthy Hetzner/AWS allocations reached ready and before setup/enrollment script execution. Unsupported fixed-ID backends then entered repeated cleanup despite no fresh allocation. Provider diagnostics and lease identifiers in the tests are synthetic.
The added ordinary-runtime case failed before the selector fix with
Crabbox node runtime preparation failedandcleanup_complete. It now recovers after two coordinator timeouts, enrolls on the original lease, and does not stop or allocate another machine. Existing regressions cover exhaustion, script-output rejection, cancellation, stop classification, fresh capability refusal, other exit-2 failures, and preserved cleanup responsibility across restart.Post-rebase local proof, each run with
pnpm test <file> --maxWorkers=1:extensions/crabbox/src/crabbox-worker-coordinator-retry.test.tsextensions/crabbox/src/crabbox-worker-command.test.tsextensions/crabbox/src/crabbox-worker-enrollment-overlap.test.tssrc/gateway/worker-environments/provider-crabbox-runtime-preflight.test.tsMost extension-suite wall time is compiler preparation and module setup; the retry cases themselves take milliseconds and use the existing injected sleep. The Gateway suite exercises real bundled-provider registration, persisted state, and restart to prove cleanup responsibility across that boundary.
node scripts/check-changed.mjsran the full changed-check plan. Its first run caught a missing required worker-bundle field in the new test grant; the existing archive fixture now supplies it, and extension test types passed on recheck (6.21s). Extension lint caught an unnecessary object spread in that same case; the direct conditional replacement passed targeted lint over all five changed Crabbox files (101.55s) and the full retry test file. All other planned formatting, core/extension production and test typechecks, dead-export scans, core/script lint, doctor-contract tests, and architecture/auth guards passed. SDK boundary declaration preparation succeeded; no declaration deferral is needed. Git hooks remained enabled, andgit diff --checkpassed.Independent P1 review found no actionable issues in the original patch or substantive runtime-preparation follow-up. The subsequent lint-only conditional simplification was manually inspected and rechecked.
The previous head
4b72e69e15d33d83875e41f5e63ae3f44d58dbc9passed CI run 37115787383. Exact-head CI run 37119742895 also passed on candidate748d1b334e41ba65a0251d003378b76c528b6df6(403 seconds elapsed for the complete CI run); the native watcher reported a green rollup. No live cloud allocation was run for this patch.