Repository navigation
feat(workers): run OpenClaw and Codex on the same cloud profile - #127752
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 3:08 AM ET / 07:08 UTC. ClawSweeper reviewWhat this changesAdds a dual-mode cloud worker profile so OpenClaw worker turns and Codex remote execution can use the same approved cloud profile. Merge readinessKeep open for manual merge review: current main does not supersede the cloud-profile capability, and no concrete patch defect was found, but the required direct inspection of the pinned Codex source contract could not be completed in this environment. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway advertises cloud worker capabilities to the Control UI, which selects an execution mode and provisions an environment. Codex remote execution then invokes an approved node command through the Gateway authorization boundary. flowchart LR
A[Cloud worker profile] --> B[Gateway capability projection]
B --> C[Control UI placement choice]
C --> D[Environment provisioning]
D --> E[Node command authorization]
E --> F[Codex remote execution]
Decision needed
Why: The feature launches and relays the Codex execution server; repository policy requires direct sibling-source inspection for a Codex verdict or proof-sufficiency conclusion. Before merge
Findings
Agent review detailsSecurityNeeds attention: No concrete Gateway authorization defect was found, but direct pinned-Codex source verification is still required for this execution-boundary change. PR surfaceSource +323, Tests +1357, Docs +69. Total +1749 across 78 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Complete the direct pinned-Codex source contract review, then merge if it confirms the exercised protocol and lifecycle assumptions. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a feature PR; supplied exact-head evidence exercises the new denied and approved execution paths. Is this the best way to solve the issue? Unclear: the design is coherent across Gateway, UI, and provider boundaries, but the required direct Codex contract check remains incomplete. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9d5d881a576a. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
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 (13 earlier review cycles; latest 8 shown)
|
ffb1ba1 to
b4c891a
Compare
|
Rebased final head Direct AWS proof remains blocked: the real bundled provider created public/no-IAM leases @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:
|
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Exact-head repair and live proof are complete for The provider-boundary finding is fixed: unsupported execution modes fail before any Crabbox command or external allocation. The regression demonstrably fails on the prior path and passes with zero provider commands after the repair. Current-version dependency proof is against Final live Hetzner proof covers both modes from the same profile id and exact head. This is the sanitized authority/final-effect trace; ephemeral lease, node, environment, and run identifiers are intentionally redacted: {"stage":"preflight-passed","sha":"e5c180cab54b377cbcd7a238ba1123b2384c7853","exactProductionDist":true,"provider":"hetzner","publicNetwork":true,"tailscale":false,"hydration":false,"sshAuthentication":"key-only","rootArtifactHashVerified":true,"codexArtifactHashVerified":true,"codexArtifactNpmShasumVerified":true,"artifactVersionsVerified":true,"artifactExactHeadVerified":true,"artifactNativeDependencyVerified":true,"rootArtifactNpmInstallable":true,"baselineCloudLeaseCount":0}
{"stage":"gateway-ready","sha":"e5c180cab54b377cbcd7a238ba1123b2384c7853","profileId":"same-profile-cloud-direct","provider":"hetzner","executionModes":["worker-turn","remote-exec"],"inference":"deterministic-local-provider","approvedNodeCommand":"codex.exec-server.stdio.v1","credentialsPersistedByDriver":false}
{"stage":"placement-active","profileId":"same-profile-cloud-direct","mode":"worker-turn","environmentId":"[redacted]","leaseId":"[redacted]","nodeId":"[redacted]","provider":"hetzner","nodeBacked":true,"workerChild":true,"publicNetwork":true,"tailscale":false}
{"stage":"openclaw-worker-proof-passed","runId":"[redacted]","profileId":"same-profile-cloud-direct","mode":"worker-turn","leaseId":"[redacted]","nodeId":"[redacted]","reconciledFile":"compaction-retry-summary.txt"}
{"stage":"session-reclaimed","session":"agent:qa:aws-openclaw-proof","state":"reclaimed"}
{"stage":"openclaw-worker-cleanup-verified","leaseId":"[redacted]","remainingOwned":0}
{"stage":"placement-active","profileId":"same-profile-cloud-direct","mode":"remote-exec","environmentId":"[redacted]","leaseId":"[redacted]","nodeId":"[redacted]","provider":"hetzner","nodeBacked":true,"workerChild":false,"publicNetwork":true,"tailscale":false}
{"stage":"codex-approval-resolved","decision":"deny","runId":"[redacted]"}
{"stage":"codex-denial-proof-passed","runId":"[redacted]","decision":"deny","terminal":"error","nativeExecCalls":0,"httpHits":0,"evidenceReconciled":false}
{"stage":"codex-approval-resolved","decision":"allow-once","runId":"[redacted]"}
{"stage":"codex-remote-exec-proof-passed","runId":"[redacted]","profileId":"same-profile-cloud-direct","mode":"remote-exec","leaseId":"[redacted]","nodeId":"[redacted]","decision":"allow-once","nativeExecCalls":1,"httpHits":1,"streamedHttp":true,"credentialCanariesPresent":false,"privateHome":true,"privateCodexHome":true,"gatewayEnvironmentIsolated":true,"openClawWorkerChild":false,"reconciledFile":"codex-node-proof.json"}
{"stage":"session-reclaimed","session":"agent:qa:aws-codex-proof","state":"reclaimed"}
{"stage":"codex-cleanup-verified","leaseId":"[redacted]","remainingOwned":0}
{"stage":"cleanup-environment-inventory","totalEnvironments":3,"ownedEnvironments":2,"ownedStates":["destroyed","destroyed"]}
{"stage":"cleanup-cloud-inventory","remainingOwnedCloudLeases":0,"baselineCloudLeaseCount":0,"otherNewCloudLeases":0}
{"stage":"cleanup-complete","remainingOwnedCloudLeases":0}
{"stage":"live-proof-passed","sha":"e5c180cab54b377cbcd7a238ba1123b2384c7853","profileId":"same-profile-cloud-direct","executionModes":["worker-turn","remote-exec"],"nativeExecCalls":1,"streamedHttpHits":1,"remainingOwnedCloudLeases":0,"namedProofGaps":["post-revocation-retained-placement-authority-before-process-io"]}Final local proof:
The exact-head CI failures were repaired at their owners: a stale SSH-backed recovery fixture now uses the canonical node transport, and container status observes a dead attach client's already-owned terminal result before converting it into an interruption. The PR body contains the current dependency-source audit, change accounting, cleanup results, and the one explicitly named non-blocking post-reclaim proof gap. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
3ad01e2 to
9e7cb16
Compare
|
🦞🧹 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:
|
|
Merged via squash.
|
…claw#127752) * feat(workers): run both harnesses on one cloud node profile * docs(workers): explain shared OpenClaw and Codex cloud profiles * fix(workers): preserve trusted Codex cloud enrollment * docs(codex): clarify bundled cloud plugin eligibility * fix(workers): honor Crabbox bootstrap retries * fix(workers): allow cloud profile setup to finish * fix(workers): reject unsupported cloud execution modes * refactor(workers): split cloud placement modules * fix(workers): preserve completed container results
Related: #127202
What Problem This Solves
Operators could not use the same configured Crabbox cloud profile for both an OpenClaw session and a Codex session. OpenClaw cloud placement required
worker-turn, Codex requiredremote-exec, and New Session / Move Session treated an otherwise appropriate cloud profile as unavailable when the selected runtime changed.Why This Change Was Made
One provider-owned profile can now advertise both canonical execution modes. Provisioning records the selected mode and admits the same outbound enrolled-node carrier for either runtime: OpenClaw starts its existing restricted worker child, while Codex keeps app-server/model authentication on the Gateway and invokes the approval-gated, node-backed pinned Codex exec-server without starting an OpenClaw worker child.
The Crabbox enrollment owner validates exact-version Codex and its executable pinned native dependency before node startup. It also rejects unsupported execution modes before any external allocation. Bundled plugins retain bundled provenance; officially installed npm plugins are projected into a physical per-lease managed npm project and recovered by the existing installed-plugin index, preserving
trustedOfficialInstallwithout fabricating provenance, directly writing SQLite, or installing plugins during enrollment. Device/pairing generation, current command advertisement, placement ownership, explicit allow-once approvals, and credential isolation remain authoritative.This change does not bump a protocol version or SQLite schema, add dependencies, activate hosted wrappers, remove SSH support, add reconnect/resume behavior, or change existing single-mode provider contracts.
User Impact
Operators configure one disposable Crabbox profile and can select that same profile in New Session and Move Session for either OpenClaw or Codex. Both paths execute on outbound enrolled cloud nodes and reconcile workspace results. Incompatible one-mode profiles remain visibly unavailable. Codex node execution remains explicit-approval-only, with model/provider credentials and app-server authentication confined to the Gateway.
Exact Revision and Change Accounting
e5c180cab54b377cbcd7a238ba1123b2384c7853.1af9b07e30df15fb5387a5650cc48f7033f8fc2d; six conflicts were resolved by preserving current main's automatic device selection and newer Codex/runtime behavior alongside this PR's dual-mode provider contract.Source and Dependency Contract Audit
The Codex contract was personally checked against sibling
codextagrust-v0.149.1, peeled commitff29a44391deccde0aba0f8390337d7f3c319ea4:codex-rs/exec-server-protocol/src/protocol.rs:19,codex-rs/exec-server/src/connection.rs:38,codex-rs/exec-server/src/client_transport.rs:388,codex-rs/exec-server/src/local_process.rs:695, andcodex-rs/protocol/src/shell_environment.rs:97. These establish the initialize/initialized handshake, newline-delimited 64 MiB stdio messages, one child-owned stdio process per connection, process/filesystem/capability/streamed-HTTP methods, terminal disconnect ownership, and the node-local-plus-explicit-overlay environment contract.Official install recovery and trust were audited at
src/plugins/installed-plugin-index-record-reader.ts:133,src/plugins/npm-project-roots.ts:17, andsrc/plugins/manifest-registry.ts:811. A real isolated CLI reproduction installed the candidate as an official npm package, demonstrated the old global-extension alias loses official provenance, and showed the physical npm-project projection restoresorigin: "global",trustedOfficialInstall: true, loaded status, trusted keyed state, and node-command registration; bundled discovery remainedorigin: "bundled".Automated and Local Proof
node scripts/run-vitest.mjs extensions/crabbox/src/crabbox-worker-provider.test.ts: 133/133 pass. The unsupported-mode regression fails on the pre-fix provider because Crabbox is invoked before rejection, then passes with zero provider commands after the fix.pnpm check:changed: all selected TypeScript, formatting, lint, docs, plugin-boundary, import-cycle, database-first, and architecture gates pass. Three touched files that crossed hard line limits after the rebase were split into concept-owned modules; no suppressions or baseline edits were added.pnpm build: exact-head production build passes.@openai/[email protected].worker-turntransport, and container status waits for its already-owned child observation before converting a dead attach client into an interruption. The affected 59 tests pass; the container success case also passed 20/20 stress runs.Real Hetzner Same-Profile Proof
Two exact-head runs used the same profile id and the real bundled Crabbox provider against public Hetzner nodes. The isolated Gateway used deterministic local model inference, an ephemeral authenticated Cloudflare ingress, no Tailscale, no hydration, key-only provider setup, and no persisted proof credentials.
OpenClaw
worker-turn[worker-turn, remote-exec].worker-turnplacement with a worker child.sessions.reclaimdestroyed the placement and the provider inventory returned to zero owned leases before the Codex leg began.Codex
remote-exec[worker-turn, remote-exec]and became a node-backedremote-execplacement without an OpenClaw worker child or worker-slot consumption.0, streamed HTTP hits0, and no evidence file reconciled.NODE_ENVwere absent in the remote process. The process received privateHOMEandCODEX_HOMEdirectories.Named proof gap: public
sessions.reclaimdestroys the cloud node, so this PR does not claim a post-revocation retained-placement attempt against the same destroyed operational instance. The observed denial-before-I/O path covers the merge-blocking authorization requirement.Sanitized Control UI Evidence
The screenshots use synthetic account, session, and Gateway fixtures only; they were individually inspected before upload. Both New Session and Move Session are shown for both runtimes.