Skip to content

feat: provision cloud worker runtimes without registry access - #188651

Merged
roboclaw-bot merged 6 commits into
mainfrom
openclaw/p2c-offline-runtime-split
Oct 30, 2026
Merged

roboclaw-bot merged 6 commits into
mainfrom
openclaw/p2c-offline-runtime-split

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Cloud workers using bundle installation still need registry access to assemble their node runtime on the destination.

User Impact

Bundle profiles install preassembled runtime dependencies without invoking npm or package lifecycle scripts. Explicit npm profiles retain destination-native installation, project locks, fallback, and reuse.

Cross-platform bundle deployments must prepare matching OS/CPU dependency inputs; a missing target fails with a preparation hint instead of silently falling back to npm. Cached-runtime verification pins the manifest and build/platform identity and probes the CLI; it does not hash every installed payload file.

Why This Change Was Made

The canonical producer packages the installed dependency graph and qualified target inputs, keeping selected plugin dependencies at their installation owner. Enrollment verifies and extracts authenticated archives into private staging before publication. Producer caches distinguish execution mode and installation mode. Only bundle runtime enrollment uses Node-only prerequisites: repository seed/setup and npm enrollment retain npm, npx, and Corepack preparation, preserving the original contract from #170796.

This is the first runtime slice of the requested packaging split. Public artifact APIs, read-only cache verification, and Linux composition remain separate dependent changes. Existing npm dependency ownership, locks, credential isolation, and timing behavior are preserved. Package input validation is shared with the dependency collector; no second installer, durable state owner, database schema change, or profile migration was introduced.

Evidence

  • Initial secretless, network-disabled Linux proof: 252 tests passed across 13 focused files (115.88s and 74.72s matrices including guarded compilation). A subsequent plugin dependency-owner repair passed 50 affected tests (82.18s). Offline execution is red on unchanged main; the plugin-owner regression is red on the earlier candidate.
  • Hosted-review repairs in c0e37f780d9e503fdeb949facc4c01277895bced: 52 tests passed across toolchain, project preparation, offline artifact, and generated installer boundaries (77.30s wrapper). The final 13-test toolchain suite passed in 3.96s, including .nvmrc=24 resolution and Corepack/packageManager behavior. Missing npm and missing Corepack cases exercise both generated repository entrypoints; both fail on the prior head because it skips prerequisite repair. The baseline fixture maps the newly named bundle-only export to its former Node-only default export.
  • Retained-runtime compatibility: the real installer first populates an old-style npm runtime without the new bundle manifest, then installs and reuses a bundle beside it under the same HOME. npm is not invoked again, bundle lifecycle scripts do not run, and the retained npm installation remains unchanged. Existing profile installation selectors/defaults and stored schemas are unchanged. A full latest-stable Gateway/provider upgrade was not run; this is retained-cache and profile-contract evidence, not a claim of complete live-upgrade qualification.
  • The exact extension-test TS2367 failure was repaired by emitting the platform array directly in the already bundle-only fixture branch. Extension test types, gateway test types, production core types, production/test lint, formatting, normal commit hooks, and git diff --check passed. The final fixture-lint correction 09858ddea16c469992f43a20da52342e6e662e84 only adds explicit loop braces; it changes no behavior.
  • All five introduced unsafe assertions were removed through canonical manifest ownership, inferred copies, validated target-name parsing, and an unknown-JSON record guard. The canonical assertion-safety ratchet passes against the PR base, with no assertion-baseline relaxation. The existing dedicated test-line allocation now covers 356 net lines, including 36 additional retained-cache/repository regression and fixture lines; the shared test baseline is unchanged.
  • Fresh local autoreview, P0–P2, reviewed the complete substantive repair against 538027dc9ff67b99974d7a7973129ece0d654057 with the full owning contracts: scoped-clean. The subsequent brace-only correction passed formatting and test lint. Local ClawSweeper was unavailable; the completed hosted re-review of the exact published head found no actionable code findings. Its remaining generic compatibility-proof request is addressed by the source-backed scope and explicit limits below.
  • Compatibility review of the remaining hosted request: the introduced diff changes no src/state schema, config schema, worker-environment row decoder, or persisted environment-record shape. requireInstall retains the existing bundle default and accepts the same explicit npm selector; its signature only narrows the required input fields. The new install/build/manifest fields are freshly prepared enrollment-transfer metadata, not migrated fields on stored profiles or worker rows. Old runtime directories remain keyed by their old archive digest; the installer publishes the new runtime beside them. A retained prebuilt archive whose complete manifest differs is a cache miss and is rebuilt by the existing producer. The retained-cache regression above exercises the real installer boundary, including preservation of an old-style npm installation and bundle reuse. This addresses the identified data/cache contracts; it does not establish a full released-binary Gateway/provider upgrade, which remains unrun.
  • Current-main composition: source inspection against fc3490aa24e624f0182ae5e29482611fee5736fb found no intervening changes in the 20 PR paths. A conflict-free merge-tree retained current main’s runtime-chunk/literal-call scanner pair, package manifest, and lockfile unchanged, including fs-safe 0.26.15. The producer still consumes the same chunk-selection result contract. This is composition/source evidence, not a replay of the test suite on a new merged head; the reviewed PR head remains unchanged.
  • Current-head broad gates: CI run 41123091138 completed successfully for b44eeb2585e317027dc17b5f37246984245ac226; the exact-head combined CI, dependency-review, and security-sensitive-review statuses also passed. No live Azure provisioning or real macOS/Windows/native-ABI qualification is claimed; foreign-target tests validate packaging contracts, not native compatibility.

Source contribution: @galiniliev, adapted from 0b084c6aabe75c24c914b7a8f6fec329b83c381f while preserving current main's owners and leaving the original source branch unchanged.

Worked on by

Work sessions

roboclaw-bot and others added 2 commits October 30, 2026 19:43
Preserve explicit npm profiles and their lock/reuse path while carrying qualified target dependencies in bundle archives.

Co-authored-by: galiniliev <[email protected]>
Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 65d6807d-2851-4dba-9916-f4bc1496596b
@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime extensions: crabbox size: XL labels Oct 30, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 30, 2026 19:46
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR packages installed runtime dependencies so bundle-mode cloud workers can install without npm registry access or lifecycle scripts.

Example: Provision a Linux x64 worker with install set to bundle and registry access unavailable.

  • Before: Runtime bootstrap invokes npm to assemble destination dependencies.
  • After: Bootstrap extracts the Gateway-prepared Linux x64 dependency bundle without invoking npm.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused integration coverage supports a coherent implementation, and the previous review findings are resolved.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Bundle-mode cloud workers still need registry access to install their runtime dependencies.
Reason: The maintainer-authored direction provides offline installation through existing owners while keeping the npm alternative and explicitly documenting target preparation requirements.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this maintainer-authored PR provides a distinct offline installation capability, and all three previous findings are repaired; no further definite code defect was found.

Priority: P2
Reviewed head: b44eeb2585e317027dc17b5f37246984245ac226

Before merge

  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: The retained-cache harness does not establish a latest-stable Gateway/provider upgrade with existing profiles and worker state intact.
Agent review details

How this fits together

The Gateway artifact producer combines its built runtime, selected plugins, and installed dependencies; enrollment grants authenticated downloads, and Crabbox installs and launches the resulting worker runtime.

flowchart TD
  A[Built runtime and installed dependencies] --> B[Canonical artifact producer]
  B --> C[Enrollment scoped download]
  C --> D[Crabbox installer]
  D --> E[Bundle extraction]
  D --> F[Explicit npm installation]
  E --> G[Worker runtime]
  F --> G
Loading

Technical review

Best possible solution:

Keep the shared producer and installer, with preassembled bundle dependencies and the explicit npm installation path preserved.

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

Current-main source shows destination npm installation, so an empty worker cache still requires dependency assembly; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The smallest coherent implementation extends the existing artifact producer and installer, preserves installed dependency ownership, and retains npm behavior for explicitly selected npm profiles.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 39b2c9191e6a.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduction and repaired findings: The introduced diff and comparison with the previously reviewed head confirm that repository preparation retains package-manager prerequisites, the impossible fixture comparison is removed, and the reported unsafe assertions are replaced. (src/gateway/worker-environments/node-toolchain.ts:71, b44eeb2585e3)
  • Current main still assembles runtime dependencies through npm: Current main generates an npm install lock for every prepared node artifact and retains destination npm installation; it does not implement the proposed offline dependency bundle. (src/gateway/worker-environments/node-bootstrap-artifact.ts:33, 39b2c9191e6a)
  • Installation and cache boundaries: Bundle installation verifies the downloaded archive, rejects unsafe paths and entry types, extracts into staging, checks manifest/build/platform identity, and publishes under the archive digest; explicit npm installation remains separate. (extensions/crabbox/src/crabbox-worker-node-enrollment.ts:249, b44eeb2585e3)
  • Retained-cache regression: The added installer regression creates an old-style npm runtime, installs and reuses a bundle beside it, rejects a mismatched manifest pin, and checks that the retained npm installation stays unchanged. (extensions/crabbox/src/crabbox-worker-node-enrollment.test.ts:330, b44eeb2585e3)
  • Owner-approved direction and bounded claims: The collaborator-authored body explicitly accepts requiring matching cross-platform inputs and manifest-only cached-runtime verification, reports focused Linux tests, and states that a full latest-stable Gateway/provider upgrade was not run. (b44eeb2585e3)
  • Existing authorization owner retained: Artifact grants retain enrollment-owned authorization callbacks; the transfer service checks live authority after opening the artifact, and the installer removes forwarded bootstrap credentials before creating child environments. (src/gateway/worker-environments/artifact-transfer-service.ts, b44eeb2585e3)

Likely related people:

  • Peter Steinberger: Raw commit 4feffc7 adds src/gateway/worker-environments/node-toolchain.ts:15 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4feffc72a6c0; files: src/gateway/worker-environments/node-toolchain.ts)
  • Galin Iliev: Raw commit db01f6d adds extensions/crabbox/src/crabbox-worker-node-enrollment.ts:112 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: db01f6d520b8; files: extensions/crabbox/src/crabbox-worker-node-enrollment.ts)

PR surface

Source +456, Tests +356, Docs +8, Other +2. Total +822 across 20 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 11 749 293 +456
Tests 7 376 20 +356
Docs 1 16 8 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 20 1143 321 +822

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status no longer selects a status label.

Label justifications:

  • P2: Offline runtime provisioning is a useful, bounded cloud-worker capability rather than an established urgent regression.
  • merge-risk: 🚨 compatibility: Bundle installation changes destination dependency assembly and adds provider metadata; cross-platform inputs become required, a tradeoff explicitly recorded in this maintainer-authored PR.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-30T20:06:06.251Z sha 538027d :: blocked before merge. :: [P2] Preserve package-manager prerequisites for repository preparation | [P2] Remove the impossible npm comparison from the bundle fixture | [P2] Repair the new assertion-safety violations

Reviewed October 30, 2026, 4:34 PM ET / 20:34 UTC (Revision 2).

roboclaw-bot and others added 4 commits October 30, 2026 20:21
Scope Node-only setup to bundle enrollment, fix narrowed bundle fixture metadata, and reuse the validated package manifest owner instead of unsafe assertions. Prove missing npm/Corepack repair and retained npm runtime compatibility.

Co-authored-by: galiniliev <[email protected]>
Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 92b05551-9794-42c5-b0ea-0dbd82702c99
Keep fixture loops explicit without changing their behavior, and account for their exact test-line delta.

Co-authored-by: galiniliev <[email protected]>
Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 4b152785-ec9c-414f-90c7-2368b3a060b3
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 30, 2026
@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. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 30, 2026
@roboclaw-bot
roboclaw-bot merged commit 44e6b1b into main Oct 30, 2026
171 checks passed
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

@roboclaw-bot
roboclaw-bot deleted the openclaw/p2c-offline-runtime-split branch October 30, 2026 21:31
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…aw#188651)

* feat(workers): provision offline node runtime bundles

Preserve explicit npm profiles and their lock/reuse path while carrying qualified target dependencies in bundle archives.

Co-authored-by: galiniliev <[email protected]>

* feat: provision cloud worker runtimes without registry access

Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 65d6807d-2851-4dba-9916-f4bc1496596b

* fix(workers): retain repository package-manager prerequisites

Scope Node-only setup to bundle enrollment, fix narrowed bundle fixture metadata, and reuse the validated package manifest owner instead of unsafe assertions. Prove missing npm/Corepack repair and retained npm runtime compatibility.

Co-authored-by: galiniliev <[email protected]>

* Publish openclaw/p2c-offline-runtime-split

Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 92b05551-9794-42c5-b0ea-0dbd82702c99

* fix(test): satisfy toolchain fixture lint

Keep fixture loops explicit without changing their behavior, and account for their exact test-line delta.

Co-authored-by: galiniliev <[email protected]>

* Publish openclaw/p2c-offline-runtime-split

Worked on by:
- @galiniliev

Co-authored-by: galiniliev <[email protected]>
OpenClaw-Publication: 4b152785-ec9c-414f-90c7-2368b3a060b3

---------

The dedicated 356-line regression allocation covers offline execution, qualified target inputs, plugin dependency ownership, retained-cache installer reuse, npm lock isolation, and repository/toolchain prerequisite behavior; the shared test baseline is unchanged.

Co-authored-by: galiniliev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: crabbox gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant