Skip to content

fix(daemon): avoid versioned pnpm paths in Gateway launchers - #167905

Merged
steipete merged 1 commit into
mainfrom
upd/upd-l1527
Oct 9, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/upd-l1527

Conversation

@steipete

@steipete steipete commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Windows pnpm-global Gateway launchers could record a versioned .pnpm/openclaw@... entrypoint. A package replacement then deleted that path, leaving the registered Scheduled Task unable to start the Gateway.

Closes #167835. Thanks @SMF12138 for the native Windows reproduction and measurements.

User Impact

Newly written launchers use the verified stable node_modules/openclaw package link, which survives package replacement. Node remains the direct launcher child, preserving task supervision.

For an installation already broken by an older launcher, run openclaw gateway install --force from the current installation. Forced install rebuilds the arguments and rewrites gateway.cmd; without --force, a registered task can return “already installed” without being rewritten.

Why This Change Was Made

Shared service argument planning now reuses the existing package-root and pnpm install-owner helpers, verifies that the stable link resolves to the invoking package, and chooses an accessible canonical entrypoint. Unverified or unrelated links retain the existing behavior.

This PR contains only the planner fix, its regression suite, and the recovery note. Doctor auto-repair for launchers whose package metadata disappeared is a named follow-up. That work must address maintenance reachability, fresh update admission, native locking, and activation after failed maintenance. No Doctor, service-audit, reconciliation, restoration, or baseline edits remain here.

The branch was rebased onto main at 164210c355ea5acd51ed290471d317547af48ac6 and updated with --force-with-lease to replace the earlier broader implementation. Auto-merge remains off.

Evidence

  • program-args.pnpm.test.ts passed three times: 4 tests per run; command wall times 24.12, 7.16, and 6.47 seconds. Vitest file durations were 20.64, 4.66, and 4.58 seconds; the cold run was dominated by compilation, with individual tests below one second. Commands used node scripts/run-vitest.mjs ... --maxWorkers=1.
  • The real Scheduled Task writer replaces a launcher pointing at a deleted generation, then the unchanged rewritten launcher resolves a later replacement package. Both pnpm store layouts and refusal of unverified/unrelated stable links are covered with Windows-style argument paths.
  • All 13 importer and recovery-command suites passed: 386 tests, 40.74 seconds total. These include the registered forced-install CLI entry point and existing forced-reinstall coverage. Source tracing confirms forced install calls the shared planner and Scheduled Task writer.
  • node scripts/check-changed.mjs --base 164210c355ea5acd51ed290471d317547af48ac6 passed in 631.64 seconds. Madge passed with 0 cycles in 11.39 seconds. git diff --check passed.
  • P1 Codex autoreview was attempted for the reduced diff and exited 1 without a verdict; lead review remains the review authority. No native Windows task-startup run was available. All proof ran locally; CI timings are pending on this head.

Numstat: production +21/-0, tests +144/-0, docs +6/-0; 3 files, +171/-0 total.

6   0   docs/platforms/windows.md
144 0   src/daemon/program-args.pnpm.test.ts
21  0   src/daemon/program-args.ts

@clawsweeper

clawsweeper Bot commented Oct 9, 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 commands Command implementations size: L labels Oct 9, 2026
@steipete
steipete marked this pull request as ready for review October 9, 2026 18:15
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 Oct 9, 2026
@clawsweeper

clawsweeper Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Gateway service launchers use pnpm’s verified stable package link instead of a version-specific package directory, keeping newly written launchers usable after package replacement.

Example: A pnpm-global installation replaces OpenClaw 2026.9.6 with a newer package.

  • Before: The saved launcher can reference the deleted [email protected] directory and fail to start the Gateway on port 18789.
  • After: The launcher references node_modules/openclaw/dist/index.js, which follows the replacement package.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused repair and meaningful filesystem regressions support correctness, while native service behavior remains unverified.
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: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A Windows Gateway installed through pnpm can stop starting after package replacement because its saved launcher points to deleted package files.
Reason: The patch addresses the linked issue’s central expectation that package replacement leave the registered service startable. It extends an established stable-path contract with a small existing-owner repair; automatic Doctor recovery remains explicitly outside this scope.

Merge readiness

✅ Ready for maintainer review

This PR addresses a source-proven launcher defect that remains on current main. The reduced scope removes the earlier Doctor recovery finding, and no concrete introduced bug was found.

Priority: P1
Reviewed head: 9bae390f3a9dea37bcb21c4aaca017b7d98f0273

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Native Windows proof is missing for real CLI installation and stale-launcher forced recovery, followed by package replacement and old-generation removal with preserved supervisor lineage and Gateway health, including latest-stable-to-head upgrade preservation.
Agent review details

How this fits together

Service installation turns the selected OpenClaw package and runtime into a saved operating-system launcher. On Windows, the Scheduled Task executes that launcher with Node directly supervising the Gateway.

flowchart TD
 A[Gateway service installation] --> B[Invoking package path]
 B --> C[Verify pnpm installation and stable link]
 C --> D{Link matches invoking package?}
 D -->|Yes| E[Stable package entrypoint]
 D -->|No| F[Existing entrypoint selection]
 E --> G[Saved service launcher]
 F --> G
 G --> H[Node runs Gateway]
Loading

Technical review

Best possible solution:

Keep stable-link selection in shared service argument planning and preserve the existing direct-Node launcher and forced-reinstall recovery owner.

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

Yes, source establishes the failure path: install from a pnpm generation, replace that package outside the managed updater, delete the old generation, and start the saved task. Native reporter observations corroborate it; this review did not execute target code.

Is this the best way to solve the issue?

Yes, the patch repairs the shared planner using existing pnpm ownership and canonical entrypoint helpers, rather than adding launcher-time scans or shim delegation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8eb960d42a70.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Introduced planner repair: The pinned introduced delta adds stable-link selection only when pnpm ownership is verified and both package roots resolve to the same directory; canonical entrypoint selection and the existing fallback remain intact. (src/daemon/program-args.ts:37, 9bae390f3a9d)
  • Current main still needs the repair: Current main searches the invoking path and its realpath without discovering the verified global package link when both inputs identify a pnpm generation. The latest release source has the same limitation. (src/daemon/program-args.ts:35, 8eb960d42a70)
  • Released resolver limitation: The v2026.9.9 resolver preserves an available original symlink but cannot discover that link from a generation-only invocation. (src/daemon/program-args.ts:36, bcfc88812a35)
  • Native reporter evidence: [Windows] gateway.cmd hardcodes the pnpm version path, so any package update leaves the Scheduled Task unstartable #167835 documents native Windows 11, Node 24.17.0, and pnpm 10.33.0 observations: unmanaged package replacement left the old launcher unchanged, produced missing-module errors, and prevented the Gateway from listening. The reporter confirms that shim delegation breaks supervisor lineage.
  • Meaningful filesystem regression coverage: The new suite drives the production argument planner and Scheduled Task writer, replaces real filesystem package links, removes retired generations, and checks that the unchanged launcher resolves replacement content. It covers both pnpm 10 store layouts and rejects unverified or unrelated links; it does not execute a native Scheduled Task. (src/daemon/program-args.pnpm.test.ts:42, 9bae390f3a9d)
  • Existing recovery owner and compatibility: Forced installation still builds arguments through the shared planner and existing service installer; the added recovery note accurately identifies the already-installed early return. No config, schema, launcher syntax, runtime choice, or task supervision contract changes. (src/cli/daemon-cli/install.ts:490, 9bae390f3a9d)

Likely related people:

  • Peter Steinberger: Raw commit f444e78 adds src/daemon/program-args.ts:44 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f444e788a719; files: src/daemon/program-args.ts)
  • George Zhang: Raw commit bfbeea0 adds src/daemon/program-args.ts:30 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bfbeea0f2034; files: src/daemon/program-args.ts)
  • Mariano: Raw commit 8dbe1b4 adds src/daemon/program-args.ts:28 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8dbe1b4f5a43; files: src/daemon/program-args.ts)

PR surface

Source +21, Tests +144, Docs +6. Total +171 across 3 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 1 21 0 +21
Tests 1 144 0 +144
Docs 1 6 0 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 171 0 +171

Review metrics

Metric Value Why it matters
Production versus test growth production +21; tests +144 The production growth is justified by reusing installation ownership checks, while the tests cover persisted launcher behavior across package replacement.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: The linked native Windows report establishes an installed Gateway becoming unavailable after pnpm package replacement.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-09T18:23:57.375Z sha 9485fc0 :: blocked before merge. :: [P2] Verify Gateway readiness after missing-entrypoint recovery

Reviewed October 9, 2026, 3:19 PM ET / 19:19 UTC (Revision 2).

@steipete steipete changed the title fix(windows): keep Gateway tasks startable after pnpm updates fix(daemon): avoid versioned pnpm paths in Gateway launchers Oct 9, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed commands Command implementations size: L labels Oct 9, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 9, 2026
@steipete
steipete merged commit 9b46148 into main Oct 9, 2026
199 of 221 checks passed
@steipete
steipete deleted the upd/upd-l1527 branch October 9, 2026 19:40
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 10, 2026
…penclaw#167905)

On a pnpm-global install, openclaw gateway install wrote the Windows Scheduled Task launcher (gateway.cmd) with the realpath of one pnpm store generation (.pnpm/openclaw@<version>/...). Replacing the package removed that generation, so the task launched a missing file, schtasks reported success, and the Gateway never started (about two hours down in the report). Service argument planning now persists the verified stable pnpm package link instead of the replaceable store generation, falling back to the previous behavior when the link cannot be verified. Installs already broken by an older launcher recover with openclaw gateway install --force. Doctor auto-repair of stale launchers is a separate follow-up. Refs openclaw#167835. Reported by @SMF12138.
RomneyDa pushed a commit that referenced this pull request Oct 10, 2026
…167905)

On a pnpm-global install, openclaw gateway install wrote the Windows Scheduled Task launcher (gateway.cmd) with the realpath of one pnpm store generation (.pnpm/openclaw@<version>/...). Replacing the package removed that generation, so the task launched a missing file, schtasks reported success, and the Gateway never started (about two hours down in the report). Service argument planning now persists the verified stable pnpm package link instead of the replaceable store generation, falling back to the previous behavior when the link cannot be verified. Installs already broken by an older launcher recover with openclaw gateway install --force. Doctor auto-repair of stale launchers is a separate follow-up. Refs #167835. Reported by @SMF12138.

(cherry picked from commit 9b46148)
obviyus added a commit that referenced this pull request Oct 11, 2026
## What Problem This Solves

Fixes node services installed through `npx openclaw connect <join-url> --service` or `npx openclaw node install` pointing at npm's disposable `_npx` cache.

## User Impact

The one-paste command installs the selected OpenClaw release into a durable npm prefix under the node's state directory before writing the service. Removing npm's exec cache no longer removes the service's executable. Installation prints the package version, chosen runtime, service command, and a fresh-npx node update command.

## Why This Change Was Made

The service argument resolver previously used the running package's resolved path. #167905 fixes pnpm's replaceable store-generation paths by selecting its existing stable link; npm exec has no stable link to select. This preserves that pnpm behavior and adds node-install promotion through the existing npm update owners (`resolveGlobalInstallTarget`, `runGlobalPackageUpdateSteps`, and their staged publication/rollback/cleanup).

There is one `<state-dir>/npm` prefix, not a prefix per release. The normal state-directory/profile resolver chooses its location. Run `npx -y openclaw@latest node install --force` on the node to update it, retaining the same profile/state-directory settings. An exact version or `@beta` can replace `@latest`. Reinstalling an already-selected version repairs damaged package files. No new settings or package manager.

This does not change `openclaw update` or its existing co-located Gateway selection behavior. Node auto-update still follows the node's npm channel, not the connected Gateway's version/build. The rebase preserves #168653's paired-credential filtering and explicit `--auth-from-env` service argument.

No overlap with Pash/Sarah changes.

## Evidence

Final code: `27b447dc07b737126124ff8847f2059cb8a4f921`. Packaged live proof ran on `292bd19fe934ecf4ee4e3b20b00a03a1b08f7933`; production feature code and docs are unchanged since that proof. The final revision only corrects regression-test platform handling and rebases onto green main.

- **Before:** the regression on baseline `e40606fdea96135758ec5bc0b1a355d08ead0c7e` selected `.npm/_npx/.../node_modules/openclaw/dist/index.js`. In the live isolated replay, published `[email protected]` completed real join-URL enrollment; deleting its npm exec cache made the saved command exit 1 with `MODULE_NOT_FOUND`.
- **After:** the canonical self-contained package passed `scripts/package-openclaw-for-docker.mjs --skip-build --allow-unreleased-changelog` and its tarball inventory/import-graph integrity check. Real `npm exec --package=<candidate.tgz> -- openclaw connect <join-url> --service` promoted that selected package into the node's state-owned npm prefix. Both actual launchd and systemd generators selected the durable entrypoint. After removing `_npx`, executing the persisted command as a separate process connected to the isolated Gateway. The published driver's device identity and node settings were unchanged.
- **Upgrade and repair:** seeded the durable prefix with published `[email protected]`, retained the enrolled node state, and invoked the candidate through fresh npx with `--profile upgrade node install --force`. The prefix became the candidate version. Overwriting its `dist/index.js` and repeating the same command restored the exact original file bytes. The runtime, device identity, and node settings remained unchanged; the repaired persisted command connected after deleting `_npx` again. The prefix contained only `bin` and `lib`, with one `openclaw` package rather than per-release directories.
- **Package identity:** the unpublished candidate shares the version string `2026.9.9` with the public release. An isolated loopback npm registry served the canonical candidate tarball for that version, while forwarding dependency requests to npm. This prevents accidentally testing promotion of the older public package with the same version string; no product behavior was mocked.
- **Focused checks:** 50 tests passed across `src/commands/node-daemon-install-npx.test.ts`, `src/commands/node-daemon-install-helpers.test.ts`, and `src/cli/node-cli/daemon.test.ts`. The new regression uses actual generators and executes their commands after cache deletion. The final portability correction keeps systemd coverage on non-Windows platforms and reads launchd artifacts only on macOS. That corrected regression passed (1.285 s test execution), and the `core-test-commands` type graph passed. Its unchanged durable-path assertion failed on the baseline as expected (pueue 2903).
- **Changed checks:** formatting, conflict/line-count/assertion/SQLite/mock-export ratchets, config docs, plugin boundaries, dependency guards, and the core type graph boundary passed. The prior head's local core typecheck stopped on unrelated `channel-presence-policy.ts:519` TS6133; the branch is now rebased onto the main fix rather than carrying a separate repair.
- **Independent review:** LAND on exact final head `27b447dc07b737126124ff8847f2059cb8a4f921`, including the corrected test, updater-step adapter, and paired-auth preservation.

Sanitized live results:

```text
before-cache-deleted: exit 1 (MODULE_NOT_FOUND)
after:  /state/npm/lib/node_modules/openclaw/dist/index.js
node host gateway connected: ws://127.0.0.1:<isolated-port>
upgrade: 2026.9.8 -> candidate 2026.9.9
sameVersionRepair: true
runtimePreserved: true
pairingAndSettingsPreserved: true
connectedAfterCacheDeletion: true
```

**Native-supervisor limitation:** supervisor activation was not verified. Native service installation reaches the existing systemd user-session/profile guards in the unprivileged container; macOS refuses native installation from an isolated HOME. The proof runs actual generated service arguments as a separate live node, not under an activated OS supervisor. Launchd XML was decoded in Linux and passed through the production generated-environment resolver; the macOS regression exercises the actual plist reader. No HOME-guard bypass, privileged container, existing Gateway, or real laptop installation was used.

**CI:** [final-head run 38097819645](https://github.com/openclaw/openclaw/actions/runs/38097819645) passed, including production types, test types, lint, source contracts, and the corrected Linux regression. All applicable PR checks finished with no failure, cancellation, or pending check. The final head is rebased onto green main; no inherited failure waiver or SDK budget change is needed. ClawSweeper is **ready, 5/6**, and the independent reviewer returned **LAND**, both on `27b447dc07b737126124ff8847f2059cb8a4f921`.

## Bounded cost

Only npx-backed node installation needs an additional npm installation. It uses one state-owned prefix and the existing updater's staging, verification, rollback, and cleanup; it does not accumulate per-version prefixes. Reuse verifies the installed package and advertised content inventory, so a same-version damaged package is repaired. Ordinary node execution and model/session paths are unchanged. Non-npx installation adds only entrypoint inspection and installation diagnostics.

Source +104/-2, tests +88/-0, docs +34/-0; net +224 across seven files. The growth reuses the existing package updater rather than adding another installation or state owner.

## Merge Danger

Two-way code change, with a durable npm installation left in the selected node state directory if reverted. A revert restores the old npx service-install behavior; it does not remove an already installed package. Blast radius is headless node service installation and its printed diagnostics; Gateway installation and pnpm launcher resolution are unchanged.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
…w#168644)

## What Problem This Solves

Fixes node services installed through `npx openclaw connect <join-url> --service` or `npx openclaw node install` pointing at npm's disposable `_npx` cache.

## User Impact

The one-paste command installs the selected OpenClaw release into a durable npm prefix under the node's state directory before writing the service. Removing npm's exec cache no longer removes the service's executable. Installation prints the package version, chosen runtime, service command, and a fresh-npx node update command.

## Why This Change Was Made

The service argument resolver previously used the running package's resolved path. openclaw#167905 fixes pnpm's replaceable store-generation paths by selecting its existing stable link; npm exec has no stable link to select. This preserves that pnpm behavior and adds node-install promotion through the existing npm update owners (`resolveGlobalInstallTarget`, `runGlobalPackageUpdateSteps`, and their staged publication/rollback/cleanup).

There is one `<state-dir>/npm` prefix, not a prefix per release. The normal state-directory/profile resolver chooses its location. Run `npx -y openclaw@latest node install --force` on the node to update it, retaining the same profile/state-directory settings. An exact version or `@beta` can replace `@latest`. Reinstalling an already-selected version repairs damaged package files. No new settings or package manager.

This does not change `openclaw update` or its existing co-located Gateway selection behavior. Node auto-update still follows the node's npm channel, not the connected Gateway's version/build. The rebase preserves openclaw#168653's paired-credential filtering and explicit `--auth-from-env` service argument.

No overlap with Pash/Sarah changes.

## Evidence

Final code: `27b447dc07b737126124ff8847f2059cb8a4f921`. Packaged live proof ran on `292bd19fe934ecf4ee4e3b20b00a03a1b08f7933`; production feature code and docs are unchanged since that proof. The final revision only corrects regression-test platform handling and rebases onto green main.

- **Before:** the regression on baseline `d1abe907cb7cfa63aeee7168099fabc81dd8309a` selected `.npm/_npx/.../node_modules/openclaw/dist/index.js`. In the live isolated replay, published `[email protected]` completed real join-URL enrollment; deleting its npm exec cache made the saved command exit 1 with `MODULE_NOT_FOUND`.
- **After:** the canonical self-contained package passed `scripts/package-openclaw-for-docker.mjs --skip-build --allow-unreleased-changelog` and its tarball inventory/import-graph integrity check. Real `npm exec --package=<candidate.tgz> -- openclaw connect <join-url> --service` promoted that selected package into the node's state-owned npm prefix. Both actual launchd and systemd generators selected the durable entrypoint. After removing `_npx`, executing the persisted command as a separate process connected to the isolated Gateway. The published driver's device identity and node settings were unchanged.
- **Upgrade and repair:** seeded the durable prefix with published `[email protected]`, retained the enrolled node state, and invoked the candidate through fresh npx with `--profile upgrade node install --force`. The prefix became the candidate version. Overwriting its `dist/index.js` and repeating the same command restored the exact original file bytes. The runtime, device identity, and node settings remained unchanged; the repaired persisted command connected after deleting `_npx` again. The prefix contained only `bin` and `lib`, with one `openclaw` package rather than per-release directories.
- **Package identity:** the unpublished candidate shares the version string `2026.9.9` with the public release. An isolated loopback npm registry served the canonical candidate tarball for that version, while forwarding dependency requests to npm. This prevents accidentally testing promotion of the older public package with the same version string; no product behavior was mocked.
- **Focused checks:** 50 tests passed across `src/commands/node-daemon-install-npx.test.ts`, `src/commands/node-daemon-install-helpers.test.ts`, and `src/cli/node-cli/daemon.test.ts`. The new regression uses actual generators and executes their commands after cache deletion. The final portability correction keeps systemd coverage on non-Windows platforms and reads launchd artifacts only on macOS. That corrected regression passed (1.285 s test execution), and the `core-test-commands` type graph passed. Its unchanged durable-path assertion failed on the baseline as expected (pueue 2903).
- **Changed checks:** formatting, conflict/line-count/assertion/SQLite/mock-export ratchets, config docs, plugin boundaries, dependency guards, and the core type graph boundary passed. The prior head's local core typecheck stopped on unrelated `channel-presence-policy.ts:519` TS6133; the branch is now rebased onto the main fix rather than carrying a separate repair.
- **Independent review:** LAND on exact final head `27b447dc07b737126124ff8847f2059cb8a4f921`, including the corrected test, updater-step adapter, and paired-auth preservation.

Sanitized live results:

```text
before-cache-deleted: exit 1 (MODULE_NOT_FOUND)
after:  /state/npm/lib/node_modules/openclaw/dist/index.js
node host gateway connected: ws://127.0.0.1:<isolated-port>
upgrade: 2026.9.8 -> candidate 2026.9.9
sameVersionRepair: true
runtimePreserved: true
pairingAndSettingsPreserved: true
connectedAfterCacheDeletion: true
```

**Native-supervisor limitation:** supervisor activation was not verified. Native service installation reaches the existing systemd user-session/profile guards in the unprivileged container; macOS refuses native installation from an isolated HOME. The proof runs actual generated service arguments as a separate live node, not under an activated OS supervisor. Launchd XML was decoded in Linux and passed through the production generated-environment resolver; the macOS regression exercises the actual plist reader. No HOME-guard bypass, privileged container, existing Gateway, or real laptop installation was used.

**CI:** [final-head run 38097819645](https://github.com/openclaw/openclaw/actions/runs/38097819645) passed, including production types, test types, lint, source contracts, and the corrected Linux regression. All applicable PR checks finished with no failure, cancellation, or pending check. The final head is rebased onto green main; no inherited failure waiver or SDK budget change is needed. ClawSweeper is **ready, 5/6**, and the independent reviewer returned **LAND**, both on `27b447dc07b737126124ff8847f2059cb8a4f921`.

## Bounded cost

Only npx-backed node installation needs an additional npm installation. It uses one state-owned prefix and the existing updater's staging, verification, rollback, and cleanup; it does not accumulate per-version prefixes. Reuse verifies the installed package and advertised content inventory, so a same-version damaged package is repaired. Ordinary node execution and model/session paths are unchanged. Non-npx installation adds only entrypoint inspection and installation diagnostics.

Source +104/-2, tests +88/-0, docs +34/-0; net +224 across seven files. The growth reuses the existing package updater rather than adding another installation or state owner.

## Merge Danger

Two-way code change, with a durable npm installation left in the selected node state directory if reverted. A revert restores the old npx service-install behavior; it does not remove an already installed package. Blast radius is headless node service installation and its printed diagnostics; Gateway installation and pnpm launcher resolution are unchanged.

Co-authored-by: Ayaan Zaidi <[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 gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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.

[Windows] gateway.cmd hardcodes the pnpm version path, so any package update leaves the Scheduled Task unstartable

1 participant