If the Claude binary path setting starts with ~ (for example ~/bin/claude), every V2 Claude turn fails with "Claude Code native binary not found at ~/bin/claude". ClaudeDriver expands the path for its own probes (binaryPath: expandHomePath(config.binaryPath)). createClaudeAdapterV2 spread the raw config into the adapter's settings instead, and makeClaudeQueryOptions passes that value straight to the Agent SDK as pathToClaudeCodeExecutable.
This PR stands on its own. The same fix for Codex is in #13470.
Change#
createClaudeAdapterV2 now sets binaryPath: expandHomePath(config.binaryPath) when it builds the adapter's settings. That is the same helper the driver uses.
Verification#
- Checked that the SDK does not expand
~ itself (@anthropic-ai/claude-agent-sdk 0.3.276, the bundled version). I ran the real query() with HOME set to a temp directory holding an executable stub at $HOME/bin/claude:
pathToClaudeCodeExecutable: "~/bin/claude" fails with Claude Code native binary not found at ~/bin/claude, and the stub never runs.
- The absolute path to the same stub launches it.
- New test in
ClaudeAdapterV2.test.ts ("expands ~ in the configured binary path for the SDK"). It builds the adapter through createClaudeAdapterV2 with binaryPath: "~/bin/claude", starts a turn, and asserts that the query runner received <homedir>/bin/claude as pathToClaudeCodeExecutable.
- Revert check: without the fix, the test fails with
expected [ '~/bin/claude' ] to deeply equal [ '/home/julius/bin/claude' ].
vp test run src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts: 123 passed.
vp exec tsc --noEmit -p . in apps/server: no errors.
vp lint on the two touched files: no new warnings. The existing unused layer warning in ClaudeAdapterV2.ts is unrelated.
- Not run: repo-wide checks, and a full live Claude session. The SDK check above already covers the part that fails.
Model: Claude Opus 5.5 (Claude Code)
🤖 Generated with Claude Code
Approvability#
Verdict: Approved at
a9d2cdeMacroscope's review found this PR approvable — This is a narrowly scoped Claude V2 bug fix that expands
~only for the configured executable path before SDK startup, with a focused regression test and no default, schema, deployment, or static-analysis changes.Notes:
- No code objects were reviewed. Approvability was decided on eligibility alone.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).