Repository navigation
fix(ci): stop leaked Testbox SSH sessions and guard lease reuse - #160052
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 maintainer review before merge. Reviewed September 28, 2026, 12:14 PM ET / 16:14 UTC (Revision 7). ClawSweeper reviewWhat this changesFor remote Testbox proof, the branch selects Crabbox 0.67.0, binds retained leases to caller and checkout receipts, rechecks them before native commands, and updates Doctor, tests, and guides. Merge readiness✅ Ready for maintainer review Keep open. Current main still has the older Testbox client selection and schema-1 lease receipts. This PR supplies a distinct repair with credible real-client proof, and the review found no introduced blocker. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s Crabbox wrapper sends checkout proof commands through a native client to Blacksmith Testboxes. It selects the client and checks local lease state before delegation; Doctor checks cloud-worker binary availability. flowchart LR
A[Checkout and caller] --> B[Crabbox client selection]
B --> C[Lease receipt]
C --> D[Final admission check]
D --> E[Native Crabbox command]
E --> F[Blacksmith Testbox]
F --> G[Result and cleanup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +46, Tests +465, Docs +23, Other +201. Total +735 across 10 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep one wrapper-owned lease admission path, retain the documented stop-and-reallocate transition for schema-1 receipts, and preserve supported offline binaries for non-Testbox providers. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the current-main path: it selects the older managed client and permits reuse without allocation-bound schema-2 receipts. This read-only review did not execute a failing current-main run. Is this the best way to solve the issue? Yes. The existing wrapper owns lease admission, and the existing binary manager scopes the newer native client to Testbox while preserving the supported floor for other providers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d823120fa21b. 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
HistoryReview history (6 earlier review cycles)
|
66a9772 to
9f6d349
Compare
9f6d349 to
d0ef542
Compare
7d09af1 to
c6ebc81
Compare
df20153 to
2e85de0
Compare
2e85de0 to
b8e311d
Compare
Select Crabbox 0.67.0 for native Testbox SSH teardown while preserving supported offline binaries and managed caches for other providers. Keep doctor and execution on one cache selector. Record retained allocation provenance and revalidate the original caller, checkout and receipt immediately before delegation. Retire schema1 ephemeral lease receipts through explicit stop and reallocation. Update local and remote proof guidance. Release-owned changelog content is untouched. Real wrapper/native 0.67 proof at 09994f preserved allowed-reuse receipts, refused a different supported session and post-admission receipt withdrawal before any native Testbox call, and exercised the exact v2026.9.6 schema1 writer followed by refusal, stop, fresh schema2 allocation, reuse and terminal SSH cleanup. The four production and four Testbox test blobs remain identical after integrating main741c9cb. Freshness36/36 and the earlier scoped hosted checks passed; final exact-head proof and review remain required. The prior CI blocker repeated an inherited one-second placement polling failure and left reconciliation unjoined during teardown. Main-owned e4ea649 observes the real admission boundary and always joins recovery; c136ec6 and 958de2c repair plugin retention lifecycle proof and disposal capture. Integrate those upstream repairs instead of adding unrelated runtime changes. Main also owns the equivalent planner fixture filter, so it is absent from this PR. Production net +247 owns allocation provenance, final admission and provider-specific binary selection; tests net +456, docs net +32. Follow-ups: existing claim-restoration fencing, direct-caller rollout, remote-proof docs planner ownership and SQLite fixture maintenance isolation. No fleet upgrade.
63bfaeb to
bd03d69
Compare
|
Merged via squash.
|
) Select Crabbox 0.67.0 for native Testbox SSH teardown while preserving supported offline binaries and managed caches for other providers. Keep doctor and execution on one cache selector. Record retained allocation provenance and revalidate the original caller, checkout and receipt immediately before delegation. Retire schema1 ephemeral lease receipts through explicit stop and reallocation. Update local and remote proof guidance. Release-owned changelog content is untouched. Real wrapper/native 0.67 proof at 09994f preserved allowed-reuse receipts, refused a different supported session and post-admission receipt withdrawal before any native Testbox call, and exercised the exact v2026.9.6 schema1 writer followed by refusal, stop, fresh schema2 allocation, reuse and terminal SSH cleanup. The four production and four Testbox test blobs remain identical after integrating main741c9cb. Freshness36/36 and the earlier scoped hosted checks passed; final exact-head proof and review remain required. The prior CI blocker repeated an inherited one-second placement polling failure and left reconciliation unjoined during teardown. Main-owned d3c3c5e observes the real admission boundary and always joins recovery; a863476 and f4bb141 repair plugin retention lifecycle proof and disposal capture. Integrate those upstream repairs instead of adding unrelated runtime changes. Main also owns the equivalent planner fixture filter, so it is absent from this PR. Production net +247 owns allocation provenance, final admission and provider-specific binary selection; tests net +456, docs net +32. Follow-ups: existing claim-restoration fencing, direct-caller rollout, remote-proof docs planner ownership and SQLite fixture maintenance isolation. No fleet upgrade. Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Older native Crabbox clients can leave SSH connections active after commands return, extending Testbox lifetime. The wrapper also allowed retained leases to be reused without allocation provenance tied to the caller and checkout.
User Impact
Testbox selects Crabbox 0.67.0 or newer. Other providers retain their supported 0.56.0 floor, including offline installations stored only in the previous managed cache. Doctor detection and execution share the same read-only cache selector; new managed downloads target 0.67.0.
Retained Testboxes require the allocating task and matching checkout, HEAD/base, dependencies, environment and workflow inputs. The wrapper rechecks the original admission after asynchronous preparation, immediately before native delegation. Missing, foreign or old-schema receipts require stopping the lease and allocating again. One-shot runs and successful conditional-retention runs still stop normally.
Why This Change Was Made
The native SSH repair is already released in Crabbox. Its managed-binary owner selects that repair only where needed. The wrapper records retained allocation facts and hashed caller attribution without raw session identifiers, checkout paths or command payloads. Native claims continue to own remote authorization; these receipts constrain task reuse.
Operator-retained runs require a task label; session-owned warmup remains supported. TTL is a recorded request because the delegated provider does not enforce it. Labels and attribution remain local. Both proof guides document these boundaries.
Maintainer migration decision: retire schema-1 ephemeral lease receipts through explicit stop and fresh allocation. Schema 1 shipped in
v2026.9.6(tag commiteb377ac59e6c9fd6c7705028034812becf00271b, receipt-writer blobac963572bad0ef1c9c69f3e1fe0526f240b30484). This deliberate retirement is covered by the maintainer landing request and the live compatibility probe below. It is not an npm or installed-fleet migration claim.Evidence
Current signed head:
bd03d69ad247f545dde061a9e1d22a753b9e7d01, rebased onto immutable main4902e4ae49a669702b92a1df3aeb01b167ec6715after a real merge conflict with the now-main-owned fixture repair below. All four production files and all four Testbox test files remain byte-identical to live-proof head09994f04a56b9aaf2f37a9143f0f92421c707625. The two guides retain the lease contract and incorporate main-owned capacity and witness-recovery guidance. The release-owned changelog and already-landed planner fixture correction are absent from this ten-file diff. The bounded Vitest fixture correction has also been dropped because main now owns it. All ten retained file blobs are unchanged from the previously reviewed candidate; independent review verified the Testbox identities and upstream fixture ownership.The real wrapper ran from a qualified native PR checkout with existing local authentication, checksum-verified Crabbox 0.67.0 and Blacksmith 0.4.61. A transparent audit launcher executed the unchanged Blacksmith client and recorded only native lifecycle operation identity. No mock, bundled wrapper, borrowed loader, credential forwarding or fleet upgrade was used.
CODEX_THREAD_ID, with the same checkout, HEAD and options, was refused with zero native Testbox calls.09994f04a56b9aaf2f37a9143f0f92421c707625and tree16d4d0d416a34d92338aea5cc850009205ce01b4with frozen dependency reconciliation. Independent review verified the script, unchanged-client forwarding, receipt identities, audit and terminal cleanup.Public lifecycle receipts: original lease, replacement lease. SSH cleanup succeeded at 04:27:04 and 04:30:37 UTC; jobs ended at 04:27:09 and 04:30:43 UTC. Cancelled conclusions are expected after explicit native stop. No task lease remains active.
Validation:
b8e311dfound no actionable findings; source verification passed before and after review. Independent owner review cleared the unchanged production source and inspected the real lifecycle proof.review-testson the qualified checkout. On09994f, test types and managed-binary/doctor tests passed. Prior wrapper proof covers byte-identical wrapper production and tests.2e85de0CI run then failed inherited placement-fence/teardown assertions twice; retention assertions failed in attempt 1 and were cancelled by fail-fast in attempt 2. No unchanged retry is being used as proof.741c9cb. No gateway or plugin-runtime repair is added by this PR.b8e311dCI run exposed inherited AI-declaration fixture drift. A focused before-run reproduced both extra-build failures; the corrected fixture and canonical prebuilt-AI sibling passed 48/48, with targeted lint, formatting, autoreview and independent review. Then exact63bfaebe55b91a359f1a6c7f0eeeafa8ea8abdc1full CI and security completion passed, and ClawSweeper found no remaining action. Native merge stopped before submission when main landed the canonical fixture fix. This branch takes that main fixture wholesale and drops its equivalent fixture commit; main also moved missing-declaration repair to the CI shard owner. Fresh current-head CI and review are required: the earlier green run is not claimed as exact-head qualification.0da3c21c1ca531ce64f36757059e93a5d7e54522for SSH/SCP and retention contracts, and Codex414782450952a196bbb64b1605a458c2531c47b6:codex-rs/protocol/src/shell_environment.rs:104,codex-rs/core/src/unified_exec/process_manager.rs:1096,codex-rs/core/src/tools/runtimes/mod.rs:289for session propagation.Review Follow-through
The provider-floor, documentation and release-owned changelog findings are addressed. Real final-effect refusal and schema-1 stop/reallocation proof now close the previously reported live gaps. Maintainer acceptance is the explicit ephemeral-receipt retirement described above. No new schema or runtime bypass was added to obtain proof.
The earlier
2e85de0Node plan fell back broadly withunresolved changed-path owner: "docs/reference/test/remote-proof.md". That is a named planner-ownership follow-up, not a claimed fanout reduction. The current ten-file diff contains only the Testbox owner, regressions and proof guides. All inherited harness, planner and AI-build fixture repairs are main-owned.Production: +309/-62 (net +247), owning allocation provenance, final admission and provider-specific binary selection. Tests: +564/-108 (net +456). Docs: +55/-23 (net +32).
Named follow-ups: existing native claim-restoration fencing; direct-caller Crabbox rollout; remote-proof docs planner ownership; and SQLite cleanup fixture isolation from automatic maintenance during setup. No speculative production repairs or fleet changes are included.