Skip to content

feat(cli): prepare session-host onboarding - #125879

Merged
steipete merged 2 commits into
mainfrom
steipete/finish-runners-campaign
Aug 18, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/finish-runners-campaign

Conversation

@steipete

@steipete steipete commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

openclaw connect --service could pair and install a persistent node, but it had no explicit path to consent to full worker-session hosting. The existing one-paste commands also assume Node and npm are already installed, so the true fresh-machine path could not be prepared safely ahead of a stable release.

Why This Change Was Made

This adds one explicit --session-host consent boundary to openclaw connect:

  • foreground use enables worker hosting for that process only;
  • service use first completes the authenticated bootstrap, then persists nodeHost.workerRuns.enabled=true through the conflict-safe config mutation owner, and only then installs the node service;
  • --ephemeral remains the separate provider-managed disposable-node contract;
  • service installation never starts when durable consent cannot be written.

A dormant scripts/connect.sh wrapper prepares the later fresh-machine command without publishing or activating it. It installs one exact package version, verifies that the installed CLI advertises the required connect capabilities, passes the single-use join target through a private mode-0600 file, and invokes connect --service --session-host. Unsupported exact releases fail before the target is handed off. The wrapper is not website-synced or emitted by the UI/CLI in this PR; those activation steps still require an explicitly authorized stable release and publish.

Production/tooling LOC: +248 / -4. Tests: +397 / -19. Docs: +43 / -2. The growth is the new fresh-machine installer boundary plus explicit durable session-host consent; no config/schema/protocol compatibility path is added.

AI-assisted: yes. I reviewed the connect/config/service ownership, installed-CLI capability boundary, private target handoff, exact-version contract, failure ordering, and docs.

User Impact

Operators can explicitly enroll a foreground or persistent node as a worker-session host with --session-host. Existing connect and connect --service behavior remains unchanged unless that flag is supplied.

There is no public hosted connect.sh command yet. This PR only lands the tested wrapper and CLI contract needed for a later stable-release activation.

Evidence

  • node scripts/run-vitest.mjs src/cli/connect-cli.test.ts test/scripts/connect-installer.test.ts — 34 tests passed.
  • bash -n scripts/connect.sh — passed.
  • shellcheck scripts/connect.sh — passed.
  • pnpm check:docs — passed.
  • node scripts/check-changed.mjs -- docs/cli/connect.md docs/plan/runners.md scripts/connect.sh src/cli/connect-cli.ts src/cli/connect-cli.test.ts test/scripts/connect-installer.test.ts — passed.
  • git diff --check — passed.
  • Fresh Codex autoreview — clean, no accepted/actionable findings; overall correct (0.99).
  • Exact-head CI for 08de6cc5d4902f368f8f03782a2959da42012aeb — green.
  • Direct AWS old-release proof — real v2026.7.1-2 installed from its exact release tag; its CLI lacked session-host support; the wrapper rejected it with an actionable error before contacting the join endpoint and did not print the target. Lease released; isolated state removed.
  • Direct AWS service-enrollment proof — clean Linux checkout at the exact PR head, release-shaped local v2026.8.1 tag, real join URL, exact CLI installation, real user systemd service, durable paired-device auth and endpoint, preserved unrelated config, persisted worker consent, sessionHost=true, worker slots 2/2, observed stop/unavailable and restart/reconnect, and bootstrap credential absent from the service command, config/state, wrapper output, and service logs. The temporary tag, service, Gateway, user, and state were removed; the lease was released.

The wrapper tests additionally cover exact version forwarding, explicit prefix handling without HOME, mode-0600 target handoff, target absence from child argv/output, cleanup on success/failure, missing capability flags, failed help probing, and rejection of moving/non-exact versions.

@clawsweeper

clawsweeper Bot commented Aug 18, 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 cli CLI command changes scripts Repository scripts labels Aug 18, 2026
@steipete
steipete marked this pull request as ready for review August 18, 2026 15:43
@openclaw-barnacle openclaw-barnacle Bot added size: L maintainer Maintainer-authored PR labels Aug 18, 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 18, 2026
@clawsweeper

clawsweeper Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 7:05 PM ET / 23:05 UTC.

ClawSweeper review

What this changes

The PR adds a --session-host consent flag to node onboarding and a dormant exact-version shell wrapper that installs a CLI before enrolling a persistent worker-session host.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for maintainer release-scope review. Source inspection finds a coherent opt-in consent flow and strong supplied real-machine proof, but this read-only blobless checkout could not retrieve current-main source for the required final merge comparison.

Priority: P2
Reviewed head: 08de6cc5d4902f368f8f03782a2959da42012aeb
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong real-environment evidence and focused tests support the patch, with a current-main comparison still needed before merge.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The PR supplies after-fix clean-machine service-enrollment and older-release rejection evidence through linked redacted artifacts; local artifact retrieval was blocked by the review environment.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The PR supplies after-fix clean-machine service-enrollment and older-release rejection evidence through linked redacted artifacts; local artifact retrieval was blocked by the review environment.
Evidence reviewed 9 items Consent and service ordering: The service path first completes the authenticated node-host connection, then writes the existing worker-host consent key, and only then installs the daemon.
Runtime consent owner: Worker hosting remains enforced by the node runtime through either explicit process forcing or the existing durable nodeHost.workerRuns.enabled setting.
Service reads persisted node configuration: The daemon installer loads node-host configuration before constructing its service plan, matching the CLI mutation boundary.
Findings None None.
Security None None.

How this fits together

openclaw connect redeems a one-time join target, records a paired node, and can install its background service. The new path waits for that authenticated pairing, persists existing node-host worker consent, then installs a service that reads the durable configuration on later starts.

flowchart LR
  A[Single-use join target] --> B[Connect command]
  B --> C[Authenticated node pairing]
  C --> D{Session-host consent}
  D --> E[Durable node configuration]
  E --> F[Background node service]
  G[Exact-version bootstrap wrapper] --> B
Loading

Decision needed

Question Recommendation
Should the next stable release include this opt-in session-host onboarding and dormant bootstrap wrapper while public website activation remains deferred? Approve dormant preactivation: Land the opt-in CLI and unhosted wrapper after refreshing the exact current-main merge and service-proof review.

Why: The PR deliberately expands durable worker-session hosting but defers its public activation, so release scope and operator-facing rollout cannot be inferred from source review alone.

Before merge

  • Resolve merge risk (P1) - Merging persists nodeHost.workerRuns.enabled=true for an explicitly opted-in service, which enables Gateway-managed worker sessions on later service starts; the release owner should confirm that this durable capability expansion is intended.
  • Resolve merge risk (P1) - The branch is behind main, and current-main source could not be retrieved from this blobless checkout after the remote lookup failed; refresh the exact merge result and owner-boundary review before landing.
Agent review details

Security

None.

PR surface

Source +28, Tests +378, Docs +41, Other +216. Total +663 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 1 32 4 +28
Tests 2 397 19 +378
Docs 2 43 2 +41
Config 0 0 0 0
Generated 0 0 0 0
Other 1 216 0 +216
Total 6 688 25 +663

Review metrics

Metric Value Why it matters
Production versus test delta production/tooling +248/-4; tests +397/-19; docs +43/-2 The feature adds an installer and durable-consent boundary, with substantial focused coverage for ordering and secret-handoff behavior.

Merge-risk options

Maintainer options:

  1. Refresh exact-base evidence (recommended)
    Rebase or validate the three-way merge against current main, then recheck that durable consent is written only after pairing and before service installation.
  2. Defer the rollout boundary
    Pause the PR if maintainers do not want the next stable release to expose durable worker-session hosting through this CLI path.

Technical review

Best possible solution:

Land only as an explicitly approved, inactive preactivation step after an exact current-main merge check confirms that the durable-consent and service-install ordering remain intact; keep website emission and public wrapper activation as a later stable-release change.

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

Not applicable: this PR proposes a new opt-in onboarding capability rather than reporting broken current behavior. The supplied after-fix runs provide implementation evidence, not a bug reproduction.

Is this the best way to solve the issue?

Unclear: the source uses the existing configuration mutation and node-runtime owners, which is the right shape, but current-main source could not be retrieved to complete the required best-fix comparison.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies after-fix clean-machine service-enrollment and older-release rejection evidence through linked redacted artifacts; local artifact retrieval was blocked by the review environment.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is an opt-in onboarding and service-hosting feature that needs normal maintainer prioritization.
  • merge-risk: 🚨 compatibility: The new CLI flag persists an existing node-host preference and changes later background-service behavior for opted-in installations.
  • merge-risk: 🚨 security-boundary: The feature enrolls a persistent machine to execute Gateway-managed worker sessions, making consent ordering and target secrecy merge-critical.
  • 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. Sufficient (linked_artifact): The PR supplies after-fix clean-machine service-enrollment and older-release rejection evidence through linked redacted artifacts; local artifact retrieval was blocked by the review environment.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies after-fix clean-machine service-enrollment and older-release rejection evidence through linked redacted artifacts; local artifact retrieval was blocked by the review environment.

Evidence

What I checked:

  • Consent and service ordering: The service path first completes the authenticated node-host connection, then writes the existing worker-host consent key, and only then installs the daemon. (src/cli/connect-cli.ts:233, 08de6cc5d490)
  • Runtime consent owner: Worker hosting remains enforced by the node runtime through either explicit process forcing or the existing durable nodeHost.workerRuns.enabled setting. (src/node-host/runtime.ts:289, 08de6cc5d490)
  • Service reads persisted node configuration: The daemon installer loads node-host configuration before constructing its service plan, matching the CLI mutation boundary. (src/cli/node-cli/daemon.ts:112, 08de6cc5d490)
  • Private target handoff: The wrapper probes installed CLI capabilities before creating the target file, then creates it mode 0600 and clears the in-memory join target before invoking the CLI. (scripts/connect.sh:192, 08de6cc5d490)
  • Focused regression coverage: Tests cover the auth-write-install ordering, preserved unrelated config, capability rejection, target-file permissions, and cleanup paths. (src/cli/connect-cli.test.ts:214, 08de6cc5d490)
  • Installer contract: The existing owned installer accepts the forwarded --version, --prefix, and --no-onboard arguments and installs the requested npm package into the dedicated prefix. (scripts/install-cli.sh:1276, 08de6cc5d490)

Likely related people:

  • steipete: Local grafted blame attributes the changed pairing-to-service boundary to Peter Steinberger, and PR metadata maps that current work to steipete; earlier ownership could not be recovered locally. (role: recent area contributor; confidence: low; commits: 08de6cc5d490; files: src/cli/connect-cli.ts, scripts/connect.sh, docs/plan/runners.md)

Rank-up moves

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

  • Refresh the exact three-way merge and owner-boundary review against current main before landing.

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 (2 earlier review cycles)
  • reviewed 2026-08-18T15:50:54.567Z sha aadb476 :: found issues before merge. :: [P1] Reject CLI versions that lack session-host support
  • reviewed 2026-08-18T17:52:01.774Z sha 08de6cc :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. 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. labels Aug 18, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof is complete on exact head 08de6cc5d4902f368f8f03782a2959da42012aeb.

The prior compatibility finding is covered by a real released binary: AWS run run_5b77e476e864 installed exact tag v2026.7.1-2, confirmed that CLI lacks session-host support, and observed the wrapper reject it with the actionable capability error before any request reached the join endpoint. The join target was absent from output and the lease/state were cleaned up.

The supported flow is covered end to end by AWS run run_d53855a2efee: clean Linux checkout, release-shaped exact-head tag, real single-use join URL, exact CLI install, real user systemd service, durable auth/endpoint and worker consent, preserved unrelated config, sessionHost=true, slots 2/2, service stop/unavailable and restart/reconnect, and bootstrap credential absent from command/config/state/output/logs. All temporary service, Gateway, user, tag, state, and lease resources were removed.

Local proof: 34 focused tests, shell syntax + ShellCheck, docs validation, full changed-file gate, git diff --check, and fresh autoreview clean. Exact-head CI is green. The PR body now contains the complete evidence and current production/test/docs LOC split.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Aug 18, 2026
@steipete
steipete merged commit 9924e2d into main Aug 18, 2026
176 checks passed
@steipete
steipete deleted the steipete/finish-runners-campaign branch August 18, 2026 23:08
@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 20, 2026
* feat(cli): prepare session-host onboarding

* fix(cli): gate session-host installer capability
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 maintainer Maintainer-authored PR 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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L 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