Repository navigation
refactor(crabbox): consolidate cloud-worker command plumbing - #159357
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: needs changes before merge. Reviewed September 27, 2026, 4:50 AM ET / 08:50 UTC (Revision 3). ClawSweeper reviewWhat this changesThe Crabbox cloud-worker plugin consolidates CLI result checks, JSON decoding, error formatting, and lease command arguments while removing unused warm-image helper plumbing. Merge readiness⛔ Needs changes before merge - 1 item remains Keep open. The focused Crabbox cleanup is absent from current main, and source review found no blocking defect. The author's follow-up connects it to the merged cloud-session reliability work, addressing the prior scope concern; that connection should also appear in the PR body. Priority: P3 Review scores
Verification
How this fits togetherThe Gateway sends cloud-worker requests to the bundled Crabbox plugin, which runs Crabbox CLI commands. Command results feed provisioning, warm-image management, enrollment diagnostics, and Doctor output. flowchart LR
A[Gateway worker request] --> B[Crabbox plugin]
B --> C[Command handling]
C --> D[Crabbox CLI]
D --> E[Command result]
E --> F[Provisioning, warm images, and Doctor]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -21, Tests -2. Total -23 across 17 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep command handling plugin-local and preserve the existing lease, error, and warm-image contracts as the reliability work proceeds. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR addresses duplicated internal plumbing rather than a reported failing user flow; the duplication and consolidation are visible in source. Is this the best way to solve the issue? Yes. The shared command owner is a narrow way to remove the duplication, and the inspected callers retain their specialized error and storage behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d86796f25b36. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Maintainer-requested: this refactor is part of a cloud-session stress/deslop campaign I asked for (stress test, deslop, and improve the cloud session feature). It is scoped to the Crabbox plugin's command plumbing, behavior-preserving, and a prerequisite cleanup for the Crabbox reliability fixes landing alongside it (#159399). |
Keep lease argv, command output checks, JSON syntax errors, and error formatting with the command owner. Remove injected argv builders and unused warm-image status plumbing without changing lifecycle, persistence, or Doctor contracts.
a2a7d4e to
f127ffb
Compare
|
Merged via squash.
|
Keep lease argv, command output checks, JSON syntax errors, and error formatting with the command owner. Remove injected argv builders and unused warm-image status plumbing without changing lifecycle, persistence, or Doctor contracts.
What Problem This Solves
The bundled Crabbox cloud-worker plugin repeated the same Crabbox CLI plumbing (non-zero exit → error, stdout extraction, JSON decoding, lease
runargv) in a dozen places, and threaded an injectable argv builder through the warm-image manager even though only one production builder exists.User Impact
No user-visible change. Cloud-worker provisioning, warm images, Doctor output, error messages, and persisted warm-image records are unchanged; the plugin is smaller and has one owner for Crabbox command results.
Why This Change Was Made
Part of a cloud-session stress/deslop pass.
crabbox-worker-command.tsnow owns command execution, result checking (crabboxCommandOutput), JSON decoding (parseCrabboxJson), error formatting, and the leaserunargv; callers use it instead of re-implementing the checks. The separatecrabbox-worker-command-error.tsmodule, the unused warm-image status key parameter, a one-line predicate wrapper, and the passthroughrunArgsdependency are removed. Sandbox execution, version probes, catalog parsing, and lease guards keep their own contracts because their error/output rules differ.Net production change: −21 lines across 15 files.
Evidence
node scripts/run-vitest.mjs extensions/crabbox: 20 files / 626 tests passed, plus 13 files / 221 tests passed (13 skipped) in the second shard.typecheck extensionsandtypecheck extension tests(tsgo) passed; formatting and SDK-boundary checks passed.Crabbox <action> failed with exit code …,… returned invalid JSON),CrabboxCheckpointCreateErrorfor failed creates, and the empty-binary path of checkpoint deletion (still returnsfalse) are preserved.Unrelated CI failure
checks-node-compact-small-19(run 36290393694) failed insrc/plugin-sdk/session-store-runtime.conversation.test.tswith a teardown error (Agent database resource drainage failed/SqliteWorkerError: Shared-state admission requires the host broker). This PR only touchesextensions/crabbox/src. Bounded reproduction: the file passed twice in isolation on an origin/main-based checkout (5/5 each); the failure appears order/shared-state dependent within that shard. No existing issue or PR matched. Re-running the failed job once.