Skip to content

fix(acpx): fall back to PATH node for shebang wrappers - #58614

Merged
fabianwilliams merged 1 commit into
openclaw:mainfrom
zssggle-rgb:fix/acpx-node-shebang-fallback
Apr 1, 2026
Merged

fabianwilliams merged 1 commit into
openclaw:mainfrom
zssggle-rgb:fix/acpx-node-shebang-fallback

Conversation

@zssggle-rgb

Copy link
Copy Markdown
Contributor

Summary

  • resolve node from PATH when process.execPath is not executable
  • keep node-shebang ACPX wrappers launchable in degraded environments

Problem
A node-shebang acpx command could still fail to launch when process.execPath was stale or missing, even if a working node binary was available on PATH.

Validation

  • pnpm exec vitest run extensions/acpx/src/runtime-internals/process.test.ts
  • pnpm lint extensions/acpx/src/runtime-internals/process.ts extensions/acpx/src/runtime-internals/process.test.ts

Note

  • local full pre-commit check is currently blocked on upstream main by an unrelated unused import in src/agents/pi-embedded-runner/run/attempt.test.ts

@greptile-apps

greptile-apps Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a graceful fallback in the node-shebang ACPX wrapper launch path so that when process.execPath is stale or missing (e.g. after a Node version upgrade), the runtime will try to resolve node from PATH before giving up. The implementation is minimal and focused: a new resolveNodeExecPath helper is inserted at the single call-site that previously used runtime.execPath directly, and a new integration test covers the fallback scenario with real temp files.

  • Adds resolveNodeExecPath(runtime) which validates execPath is executable before using it, then falls back to resolveExecutableFromPath("node", runtime), and finally falls back to the original runtime.execPath (preserving pre-PR failure semantics when no node is available anywhere).
  • Only applied on the non-Windows, node-shebang code path — Windows resolution is unaffected.
  • New test correctly constructs a temp directory with a node-shebang script and a fake node binary, passes a missing execPath, and asserts the PATH-resolved binary is chosen.

Confidence Score: 5/5

  • This PR is safe to merge; the change is narrowly scoped, introduces no regressions, and is covered by a new integration test.
  • The implementation is correct: the fallback chain is well-ordered, the final fallback to runtime.execPath preserves pre-PR failure semantics when no node is available at all, and the change only affects the non-Windows node-shebang path. No P0 or P1 issues were found. The added synchronous I/O (statSync/accessSync on execPath) is negligible in a spawn-time context.
  • No files require special attention.

Reviews (1): Last reviewed commit: "fix(acpx): fall back to PATH node for sh..." | Re-trigger Greptile

@fabianwilliams fabianwilliams left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — reviewed code, tests, and approach. Clean implementation.

@fabianwilliams
fabianwilliams merged commit 187d3ed into openclaw:main Apr 1, 2026
41 of 43 checks passed
steipete pushed a commit to Mlightsnow/openclaw that referenced this pull request Apr 1, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
Nachx639 pushed a commit to Nachx639/clawdbot that referenced this pull request Jun 17, 2026
vixco pushed a commit to vixco/openclaw that referenced this pull request Aug 16, 2026
globalcaos pushed a commit to globalcaos/tinkerclaw that referenced this pull request Sep 29, 2026
lhfer pushed a commit to lhfer/openclaw that referenced this pull request Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants