Repository navigation
refactor(workers): make worker turns node-only - #125384
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 6:43 PM ET / 22:43 UTC. ClawSweeper reviewWhat this changesThe PR makes worker-placement providers declare one transport mode, rejects incompatible SSH/node leases during provisioning and restart reconciliation, and removes obsolete Crabbox SSH handling. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open for maintainer compatibility review. No concrete patch defect was found, but the checked-out head has no merge-base with the supplied base and the required Codex source checkout is unavailable, so the preview-SDK and Codex-contract claims cannot be independently confirmed here. Priority: P2 Review scores
Verification
How this fits togetherCloud worker placement records a provider lease, then Gateway runs it either as a node-backed worker turn or an SSH-backed remote-exec environment. The PR enforces that provider declarations and durable lease transport agree before the lifecycle can resume work. flowchart LR
A[Session placement] --> B[Worker provider]
B --> C[Declared transport]
C --> D[Lease validation]
D --> E[Gateway lifecycle]
E --> F[Node worker turn]
E --> G[SSH remote execution]
Decision needed
Why: This is a protected maintainer PR that narrows a plugin SDK contract, while release and direct Codex provenance are unavailable in this review environment. Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +25, Docs -3. Total +22 across 27 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the single-transport lease invariant, but merge only after an owner verifies the preview-only compatibility decision and the current Codex remote-exec contract. Do we have a high-confidence way to reproduce the issue? No live reproduction was run in this read-only review, but the fresh and persisted mismatch paths are directly traceable in source and covered by focused regression tests. Is this the best way to solve the issue? Yes for the lifecycle boundary: validation occurs where leases enter and resume, rather than at downstream SSH/node consumers; the compatibility decision still needs owner confirmation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 27cb5d021fd1. LabelsLabel justifications:
EvidenceWhat 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 (9 earlier review cycles; latest 8 shown)
|
2251d0a to
4ff3e9c
Compare
|
ClawSweeper findings addressed through
Focused proof:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
5b01283 to
42dfe9c
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
This reverts commit 0a1f97399b23eca81e99af45dd9ea616e266de54.
42dfe9c to
65272f8
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* refactor(workers): bind placement modes to transports * refactor(workers): split provider reconciliation * Revert "refactor(workers): split provider reconciliation" This reverts commit 0a1f97399b23eca81e99af45dd9ea616e266de54. * refactor(workers): split lifecycle options * test(workers): align SSH fixture with remote exec * refactor(workers): encode one placement mode * fix(workers): fence persisted transport mismatches * style(workers): keep persisted lease note concise * test(workers): declare node access fixture modes * test(agents): match exec notifications by receipt
What Problem This Solves
After cloud worker turns converged onto node transport, the worker-provider contract could still advertise both execution modes and return an SSH lease for
worker-turn. That kept the replaced reverse-worker carrier reachable through provider configuration, while Crabbox still parsed and exposed SSH identity fields that its node leases no longer use.Why This Change Was Made
This makes each session-placement provider choose one current transport mode, encodes that declaration as a one-element SDK tuple, and validates both new and persisted leases at the lifecycle owner:
worker-turnrequires a node lease, andremote-execrequires an SSH lease. A mismatched lease is durably recorded, destroyed, and terminalized instead of being bootstrapped through the wrong carrier, including after Gateway restart. QA Lab static SSH is nowremote-execonly, while Crabbox deletes its obsolete SSH identity resolver and inspect projection.The generic pinned SSH workspace/sandbox contract remains intact for Codex-style
remote-exec; this slice deliberately does not remove rsync or the independent SSH sandbox. The lifecycle options type moved to a concept-named module to keep the owner below the repository line limit without adding a suppression.AI-assisted; the implementation and boundary analysis were reviewed with the repository autoreview gate.
User Impact
Supported cloud behavior is unchanged: Crabbox worker turns stay node-backed, and SSH remote execution stays available through an explicitly remote-exec provider. Persisted leases whose stored transport no longer matches their provider declaration are reclaimed as failed during restart reconciliation instead of reviving an obsolete execution path. The existing ordered-fallback integration fixture now declares
remote-exec, matching its SSH lease while preserving its bootstrap, restart, workspace, reclaim, and teardown assertions. Pre-release provider plugins that return a lease for the wrong transport now fail before session use and clean up their allocation. Operator documentation no longer describes Crabbox as an OpenClaw SSH lease or identity provider.Evidence
readyforworker-turn, while a node lease forremote-execfailed later as a generic bootstrap error.node scripts/run-vitest.mjs src/agents/bash-tools.test.ts src/gateway/worker-environments/environment-access.test.ts src/gateway/server.sessions.worker-original-order.test.ts src/gateway/worker-environments/provider-bootstrap.test.ts src/gateway/worker-environments/provider-provisioning-node-admission.test.ts src/gateway/worker-environments/provider-provisioning-node.test.ts src/gateway/worker-environments/provider-provisioning.test.ts src/gateway/worker-environments/provider-reconciliation.test.ts src/plugins/worker-provider-registry.test.ts extensions/qa-lab/src/static-ssh-worker-provider.test.ts extensions/crabbox/src/crabbox-worker-inspect.test.ts extensions/crabbox/src/crabbox-worker-provider.test.ts— 235 tests passed on the exact rebased head.bash-toolsassertion that matched events by the first eight characters of a human-readable process slug. The test now uses the exactexec:<sessionId>eventcontextKey, matching production receipt ownership; three additional focused runs passed.node scripts/check-changed.mjs— passed.pnpm build— passed.pnpm plugin-sdk:surface:check— passed.autoreview --mode branch --base origin/main— clean.WorkerProviderwas introduced after stable tagv2026.7.1-2; no stable release tag contains that Plugin SDK surface. The repository's beta-only SDK policy therefore permits the current-only single-mode contract without a deprecation shim.environment/addregisters a stable exec-server URL and preserves the separate remote-exec environment lifecycle; this change keeps that SSH workspace contract and removes only SSH-backed worker-turn eligibility.