Skip to content

feat(gateway): run disposable cloud workers through node transport - #125288

Merged
steipete merged 9 commits into
mainfrom
steipete/cloud-node-enrollment
Aug 17, 2026
Merged

steipete merged 9 commits into
mainfrom
steipete/cloud-node-enrollment

Conversation

@steipete

@steipete steipete commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Cloud worker sessions used a Crabbox-specific SSH and workspace carrier even though paired devices already hosted complete worker turns through the node protocol. That split duplicated lifecycle and transport policy, made cloud execution a separate product path, and prevented the Gateway from owning cloud worker identity, bundle, claims, transcript, and workspace behavior through one canonical flow.

Why This Change Was Made

This converges disposable Crabbox worker-turn environments onto the current node worker protocol. The Gateway now owns replay-safe one-use enrollment, persists the authenticated node binding, installs the current worker bundle, transfers the workspace through authenticated node routes, and removes the cloud-owned pairing during teardown. openclaw connect --ephemeral enables process-scoped worker hosting without installing a service or changing durable worker settings.

The cloud path is intentionally current-only: there is no SSH fallback, mixed-version payload, or legacy cloud transport shim. Codex-style remote execution still requires a provider that explicitly advertises SSH-backed remote-exec support.

AI-assisted; the implementation and live failure analysis were reviewed with the repository autoreview gate.

User Impact

Operators can place ordinary OpenClaw worker turns on disposable cloud machines through the same session-owned node path used by devices. Cloud nodes stay hidden from the persistent paired-device inventory, while their environments remain visible as disposable workers. Provisioning and restart replay reuse the environment-owned setup identity, and teardown removes both the provider lease and cloud-owned node role.

Evidence

Static and focused proof:

  • node scripts/check-changed.mjs
  • node scripts/run-vitest.mjs src/cli/connect-cli.test.ts src/pairing/setup-code.test.ts src/gateway/worker-environments/node-worker-tunnel.test.ts extensions/crabbox/src/crabbox-worker-provider.test.ts — 168 tests passed on the rebased head
  • pnpm build
  • autoreview --mode branch --base origin/main — clean
  • Production/test/docs/generated LOC: production +878/-413, tests +668/-320, docs +59/-54, generated +2/-0. Production growth establishes the enrollment owner, persisted node transport, transactional pairing binding, process-scoped replay authority, and fail-closed provider capability boundary. The obsolete Crabbox desktop setup path was removed in this change; the remaining cloud-only SSH execution carrier is intentionally removed in the next soak-gated milestone.
  • ClawSweeper blockers addressed through head 58108341673: resumed nodes use hidden process-scoped node run --ephemeral with no durable nodeHost.workerRuns mutation; every mode-bound allocation requires an explicit provider supportedExecutionModes declaration; and pairing-role retirement now requires the durable cloud nodeSetupId, so ordinary paired-device teardown cannot revoke its node role. The teardown regression demonstrably failed on the prior lifecycle and passes with the ownership gate.
  • The capability declaration is intentionally current-only rather than deprecated: WorkerProvider was introduced after stable tag v2026.7.1-2, no stable tag contains that Plugin SDK surface, and OpenClaw's beta-only SDK rule carries no compatibility obligation. Direct lifecycle-only environments.create remains available when no placement mode is requested.

Live AWS proof through the real Gateway flow:

  • Allocated a fixed operation-derived Crabbox AWS lease and replay-adopted the same lease across Gateway restart.
  • Installed the exact self-contained OpenClaw version, preferring the exact globally installed binary.
  • Kept the setup credential out of argv and uploaded script text; Crabbox forwarded it only through an explicitly allowed environment channel into an owner-only target file.
  • Paired the environment-owned node through the configured public Gateway URL, persisted the authenticated Ed25519-derived device ID, installed the current Gateway worker bundle, and projected only the disposable worker environment—not a persistent paired-device row.
  • Preserved the active placement across an isolated Gateway restart.
  • Transferred a real Git workspace through the authenticated node workspace path and reached placement.state=active with a connected tunnel.
  • Ran a real openai/gpt-5.6-sol worker turn on AWS. The model invoked the shell tool in the remote workspace, created worker-proof.txt, and returned DONE.
  • Reclaimed the session. Final reconciliation restored worker-proof.txt locally with exact contents cloud node turn completed and advanced the workspace manifest.
  • Teardown left the environment destroyed, node.list empty, device.pair.list with no pending or paired devices, and crabbox list --provider aws with no active leases.

The installed local Crabbox CLI does not implement the newer heartbeat command, so the live Gateway emitted a bounded warning during the short proof. It did not affect placement, execution, reclaim, or teardown; upgrading the external CLI is independent of this OpenClaw change.

@clawsweeper

clawsweeper Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes extensions: crabbox size: XL maintainer Maintainer-authored PR labels Aug 17, 2026
@steipete
steipete force-pushed the steipete/cloud-node-enrollment branch from 319a1b0 to a541020 Compare August 17, 2026 14:14
@steipete steipete self-assigned this Aug 17, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 2:44 PM ET / 18:44 UTC.

ClawSweeper review

What this changes

This PR moves disposable Crabbox cloud workers onto Gateway-managed node enrollment and transport for worker turns, replacing the provider-specific SSH setup path.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No new blocking correctness finding was found on the reviewed head. This maintainer-owned feature should remain open for a rebase onto current main and exact-head validation before the final merge decision.

Priority: P2
Reviewed head: 581083416738bf80b55ee335ebd38a9b3c395a58
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong real-provider evidence and coherent lifecycle ownership support the patch, with exact-head rebase validation still needed.
Proof confidence 🦞 diamond lobster (5/6) Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; its body nevertheless supplies a detailed after-fix AWS lifecycle trace.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; its body nevertheless supplies a detailed after-fix AWS lifecycle trace.
Evidence reviewed 8 items Environment-owned enrollment: The store persists a setup identity, binds a completed setup to one device identity, and rejects identity drift before provisioning can continue.
Transactional pairing binding: Cloud-worker setup completion resolves the owning environment and writes its device binding inside the pairing write transaction.
Cloud-only role retirement: Teardown retires a node role only when the durable record has a cloud enrollment setup identity, preserving ordinary paired-device roles.
Findings None None.
Security None None.

How this fits together

A cloud-worker request is persisted by the Gateway, fulfilled by the Crabbox provider, enrolled as an authenticated node, and then used for bundle transfer, workspace sync, and worker execution. Teardown releases the provider lease and removes only the environment-owned node role.

flowchart LR
  A[Cloud worker request] --> B[Gateway environment record]
  B --> C[Crabbox lease]
  C --> D[One-use node enrollment]
  D --> E[Authenticated node transport]
  E --> F[Bundle and workspace transfer]
  F --> G[Worker turn]
  G --> H[Lease and node-role teardown]
Loading

Decision needed

Question Recommendation
After a clean rebase, should the current-only cloud-node transport contract land with exact-head worker-lifecycle validation? Rebase and validate before merge: Rebase onto current main and rerun focused lifecycle checks plus the real Crabbox/Gateway flow on the resulting head.

Why: The feature direction is established, but current main changed adjacent worker execution-context behavior after this branch's base, so a human should accept the exact merged behavior.

Before merge

  • Resolve merge risk (P1) - Current main has progressed worker execution-context behavior since this branch's base; rebase and focused exact-head validation are needed before merge, even though GitHub reports the PR cleanly mergeable.
Agent review details

Security

None.

PR surface

Source +476, Tests +337, Docs +5, Generated +2. Total +820 across 74 files.

View PR surface stats
Area Files Added Removed Net
Source 42 890 414 +476
Tests 26 643 306 +337
Docs 5 59 54 +5
Config 0 0 0 0
Generated 1 2 0 +2
Other 0 0 0 0
Total 74 1594 774 +820

Review metrics

Metric Value Why it matters
Production versus test LOC production +881/-414; tests +654/-306 The production growth is justified by a new persisted enrollment and node-transport ownership boundary; the focused test growth covers replay, capability, and teardown behavior.

Stored data model

Persistent data-model change detected: durable storage schema: src/gateway/worker-environments/environment-access.ts, durable storage schema: src/gateway/worker-environments/node-enrollment.ts, durable storage schema: src/gateway/worker-environments/node-worker-tunnel.test.ts, durable storage schema: src/gateway/worker-environments/node-workspace-retain-coordinator.test.ts, durable storage schema: src/gateway/worker-environments/node-workspace-retain-coordinator.ts, durable storage schema: src/gateway/worker-environments/placement-dispatch-test-fixtures.ts, and 33 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Rebase and rerun exact-head proof (recommended)
    Validate the rebased node-enrollment lifecycle against current worker execution-context changes before merging.
  2. Pause for additional soak coverage
    Hold the PR if maintainers want a longer merged-head cloud-worker soak before accepting the transport convergence.

Technical review

Best possible solution:

Rebase the canonical node-enrollment flow onto current main, preserve the current-only explicit provider-mode contract, and validate the merged worker lifecycle through provisioning, restart replay, execution, and teardown.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a feature PR. The relevant proof is the supplied after-fix cloud-worker lifecycle run and the exact-head checks required after rebase.

Is this the best way to solve the issue?

Yes, subject to rebase validation: reusing the existing authenticated node transport removes the parallel cloud SSH carrier while preserving an explicit SSH-only path for remote-exec runtimes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5fe5d26007cc.

Labels

Label justifications:

  • P2: This is a substantial opt-in cloud-worker feature with bounded operator impact rather than an active emergency.
  • merge-risk: 🚨 compatibility: The PR changes the unshipped WorkerProvider placement contract and removes the Crabbox SSH setup path.
  • merge-risk: 🚨 security-boundary: It creates one-use node enrollment credentials, persists a device binding, and retires the associated node role.
  • merge-risk: 🚨 availability: Provisioning, restart replay, and teardown determine whether cloud worker sessions remain reachable and recoverable.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate; its body nevertheless supplies a detailed after-fix AWS lifecycle trace.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the WorkerProvider foundation and the current node-enrollment lifecycle branch. (role: feature foundation author and recent area contributor; confidence: high; commits: 7c7c7524ad24, 581083416738; files: src/plugins/capability-provider.types.ts, src/gateway/worker-environments/provider-lifecycle.ts, src/cli/connect-cli.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Rebase onto current main and rerun focused worker-environment checks plus the real Crabbox/Gateway lifecycle proof.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-08-17T15:47:03.680Z sha a541020 :: needs real behavior proof before merge. :: [P1] Keep ephemeral worker authorization process-scoped | [P1] Require explicit remote-exec capability before allocation
  • reviewed 2026-08-17T16:53:15.377Z sha a541020 :: found issues before merge. :: [P1] Gate node retirement to cloud-enrolled environments | [P1] Include the device wait in the provision deadline | [P1] Keep cloud worker hosting process scoped on replay
  • reviewed 2026-08-17T17:28:14.757Z sha 48a07c6 :: needs changes before merge. :: [P1] Gate node retirement to cloud-enrolled environments
  • reviewed 2026-08-17T17:48:45.444Z sha ed42e37 :: found issues before merge. :: [P1] Gate node retirement to cloud-enrolled environments | [P1] Preserve existing worker-provider placement compatibility
  • reviewed 2026-08-17T18:26:51.774Z sha 5810834 :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review August 17, 2026 16:44
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 17, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 17, 2026
@steipete

steipete commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor Author

ClawSweeper exact-head findings, addressed at 58108341673:

  • [P1] Gate node retirement to cloud-enrolled environments — fixed. The shared lifecycle now invokes cloud enrollment retirement only when the durable environment record carries nodeSetupId. Ordinary paired-device leases retain nodeSetupId: null, so destroying them tears down the environment without removing the device's node role. The existing cloud test now persists the real setup ownership fact before provisioning, and a new owner-boundary regression destroys a node lease without cloud enrollment ownership and verifies retirement is not invoked. That regression failed on the prior lifecycle because the callback was called once, then passed after the ownership gate.
  • [P1] Preserve existing worker-provider placement compatibility — intentionally not applicable. WorkerProvider was introduced by 7c7c7524ad2 after the latest stable tag v2026.7.1-2; no stable release tag contains that commit, and the stable tag does not export WorkerProvider from the Plugin SDK. OpenClaw's compatibility contract explicitly treats beta-only/main Plugin SDK surface as unshipped and requires removal or correction rather than deprecation scaffolding. Omitted supportedExecutionModes therefore intentionally advertises no placement modes: existing bundled providers declare their modes explicitly, and external providers built against unreleased surface must adopt the current contract. Keeping omission permissive would reopen the remote-exec allocation bypass this PR closes.

Fresh proof:

  • Pre-fix regression: node scripts/run-vitest.mjs src/gateway/worker-environments/provider-provisioning-node.test.ts — failed only keeps paired-device roles when a node lease has no cloud enrollment owner, because retirement was invoked once.
  • After fix: node scripts/run-vitest.mjs src/gateway/worker-environments/provider-provisioning-node.test.ts src/gateway/worker-environments/provider-provisioning.test.ts src/gateway/worker-environments/device-provider.test.ts — 28 tests passed.
  • node scripts/check-changed.mjs — passed.
  • autoreview --mode local — clean.

The earlier live AWS proof remains valid; this follow-up changes only teardown ownership and adds regression coverage.

Landing readiness on exact head 581083416738bf80b55ee335ebd38a9b3c395a58:

  • Ordinary CI run 32053848329 — green.
  • Security CodeQL run 32053848540 attempt 4 — green after GitHub service retries.
  • Critical-quality CodeQL run 32053848565 attempt 3 — green after GitHub service retries.
  • scripts/pr review-validate-artifacts 125288 — READY FOR /prepare-pr, zero findings.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 125288 — passed with hosted_exact_or_recent_parent; the wrapper reused the already-green hosted exact-head gates, so it did not allocate a Testbox lease.
  • Native prepare initialized from the current PR head without rebasing and verified the remote head tree unchanged. Therefore the ClawSweeper post-rebase live-repeat move is not applicable: there was no rebase or tree change after the recorded AWS lifecycle proof. The exact-head lifecycle tests and CI were rerun after the teardown fix.
  • Known proof gap: the installed external Crabbox CLI lacks the newer heartbeat command; the bounded warning did not affect placement, restart recovery, execution, reconciliation, reclaim, or teardown.

@clawsweeper

clawsweeper Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 17, 2026
@clawsweeper

clawsweeper Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 17, 2026
@steipete
steipete merged commit 45e6784 into main Aug 17, 2026
281 of 290 checks passed
@steipete
steipete deleted the steipete/cloud-node-enrollment branch August 17, 2026 18:49
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 18, 2026
…penclaw#125288)

* feat(gateway): converge cloud workers onto nodes

* fix(gateway): honor public URL for cloud enrollment

* fix(crabbox): execute cloud bootstrap package binary

* fix(gateway): bind cloud nodes in pairing transaction

* fix(crabbox): prefer exact installed cloud bootstrap

* fix(gateway): complete cloud node bootstrap

* fix(gateway): enforce cloud worker capability boundaries

* fix(gateway): complete cloud node migration

* fix(gateway): preserve paired node roles on teardown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation extensions: crabbox extensions: qa-lab gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant