Skip to content

fix: expose OpenClaw CLI to gateway-spawned agent shells - #125

Open
szymo wants to merge 1 commit into
chrysb:mainfrom
szymo:fix/openclaw-cli-agent-path
Open

fix: expose OpenClaw CLI to gateway-spawned agent shells#125
szymo wants to merge 1 commit into
chrysb:mainfrom
szymo:fix/openclaw-cli-agent-path

Conversation

@szymo

@szymo szymo commented Aug 31, 2026

Copy link
Copy Markdown

Problem

AlphaClaw starts with /app/node_modules/.bin on PATH, but gateway-spawned agent shells can receive a minimal PATH without that directory. openclaw then fails with exit 127 even though the bundled package and Gateway are healthy. Agents may fall back to stale paths such as /app/openclaw.mjs, producing MODULE_NOT_FOUND.

Fix

  • Resolve the installed OpenClaw package entrypoint without assuming npm hoisting layout.
  • Atomically install or refresh /usr/local/bin/openclaw during AlphaClaw startup.
  • Preserve an unmanaged regular launcher.
  • Verify the launcher with openclaw --version and emit a clear warning if setup fails.
  • Document the launcher behavior.

Validation

  • npm test: 732 passed; one unrelated existing failure in openclaw-codex-migration.test.js (SQLite verification does not find imported profile).
  • Focused startup/Gateway suite: 54 passed.
  • New runtime helper suite: 5 passed.
  • Real deployment reproduction: isolated OpenClaw cron executed openclaw --version with exit 0 after the launcher was present.

The startup operation is idempotent and refreshes stale symlinks after package updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant