Skip to content

fix(win32): resolve Claude Code executable path for ACP spawn#289

Merged
steipete merged 2 commits into
openclaw:mainfrom
MikeChongCan:main
May 5, 2026
Merged

fix(win32): resolve Claude Code executable path for ACP spawn#289
steipete merged 2 commits into
openclaw:mainfrom
MikeChongCan:main

Conversation

@MikeChongCan
Copy link
Copy Markdown
Contributor

On Windows, when CLAUDE_CODE_EXECUTABLE is not already set, resolve claude.exe on PATH and inject it into the spawn environment before starting the ACP child process. This avoids path-resolution failures in environments where the shell's PATH lookup does not work the same way as Node's spawn.

Changes

  • Exports readWindowsEnvValue and resolveWindowsCommand from spawn-command-options.ts so they can be reused
  • Adds resolveClaudeCodeExecutable in agent-command.ts that resolves the absolute path to claude.exe on Windows
  • AcpClient calls resolveClaudeCodeExecutable before spawning a Claude ACP process and injects CLAUDE_CODE_EXECUTABLE when found
  • Adds full test coverage for resolveClaudeCodeExecutable

On Windows, when CLAUDE_CODE_EXECUTABLE is not already set, resolve the
claude.exe on PATH and inject it into the spawn env before starting the
ACP child process. This avoids path-resolution failures in environments
where the shell's PATH lookup does not work the same way as Node's spawn.

Exports readWindowsEnvValue and resolveWindowsCommand so they can be
reused from agent-command.ts, and adds resolveClaudeCodeExecutable with
full test coverage.
@steipete
Copy link
Copy Markdown
Contributor

steipete commented May 5, 2026

Maintainer triage: patch applies cleanly and CI is green. The remaining blocker is repo policy: this is a user-visible Windows/Claude ACP spawn fix, so please add a concise CHANGELOG.md entry under Unreleased / Fixes before merge.

@steipete steipete self-assigned this May 5, 2026
@steipete steipete merged commit 436fd4f into openclaw:main May 5, 2026
8 checks passed
@steipete
Copy link
Copy Markdown
Contributor

steipete commented May 5, 2026

Landed.\n\n- Gate: pnpm run check; GitHub CI green on "3637bce325a32bcf083626a3e9d4ee6534b19594"\n- Merge commit: 436fd4f\n\nThanks @MikeChongCan!

steipete pushed a commit that referenced this pull request May 5, 2026
Send session/close from AcpClient.closeSession instead of the experimental nes/close method.\n\nGate: pnpm run check locally on PR branch; rebased onto main after #289.\n\nThanks @hexsprite.
steipete pushed a commit that referenced this pull request May 5, 2026
…tion

Recognize Windows .cmd/.bat ACP agent wrappers when translating WSL cwd, including non-C drive installs.\n\nGate: pnpm run check locally on PR branch; rebased onto main after #289 and #291.\n\nThanks @solomonneas.
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.

2 participants