Skip to content

fix: wire CLAUDE_CODE_EXECUTABLE so adapter uses pinned claude-code#447

Merged
thepagent merged 1 commit intoopenabdev:mainfrom
chaodu-agent:fix/wire-claude-code-executable
Apr 18, 2026
Merged

fix: wire CLAUDE_CODE_EXECUTABLE so adapter uses pinned claude-code#447
thepagent merged 1 commit intoopenabdev:mainfrom
chaodu-agent:fix/wire-claude-code-executable

Conversation

@chaodu-agent
Copy link
Copy Markdown
Collaborator

Summary

Set ENV CLAUDE_CODE_EXECUTABLE=/usr/local/bin/claude in Dockerfile.claude so claude-agent-acp actually uses the globally installed (and version-pinned) @anthropic-ai/claude-code binary instead of its own bundled SDK cli.js.

Problem

As documented in #418, claude-agent-acp never invokes the globally installed /usr/local/bin/claude. The adapter resolves its CLI path via claudeCliPath() which, for non-static npm installs, always falls through to the SDK-bundled cli.js. This means:

Fix

The adapter checks CLAUDE_CODE_EXECUTABLE env var first (since claude-agent-acp@0.6.0). Setting it to /usr/local/bin/claude makes the pinned version load-bearing.

Changes

-# Install claude-agent-acp adapter and Claude Code CLI
+# Install claude-agent-acp adapter and Claude Code CLI.
+# Without CLAUDE_CODE_EXECUTABLE the adapter uses its own bundled SDK cli.js,
+# ignoring the globally installed claude-code binary (see #418).
 ARG CLAUDE_CODE_VERSION=2.1.104
 RUN npm install -g @agentclientprotocol/claude-agent-acp@0.25.0 @anthropic-ai/claude-code@${CLAUDE_CODE_VERSION} --retry 3
+ENV CLAUDE_CODE_EXECUTABLE=/usr/local/bin/claude

How to verify

docker build -f Dockerfile.claude -t openab-claude:test .
docker run --rm --entrypoint sh openab-claude:test -c '
  echo "CLAUDE_CODE_EXECUTABLE=$CLAUDE_CODE_EXECUTABLE"
  claude --version
'

Then confirm the adapter uses the global binary:

# In a running container with a session:
lsof -p $(pgrep -f claude-agent-acp) | grep cli.js
# Should show /usr/local/lib/node_modules/@anthropic-ai/claude-code/cli.js

Fixes #418

Discord Discussion URL: https://discord.com/channels/1490282656913559670/1495058349241405522

claude-agent-acp uses its bundled SDK cli.js by default, ignoring the
globally installed @anthropic-ai/claude-code binary. Set
CLAUDE_CODE_EXECUTABLE=/usr/local/bin/claude so the adapter actually
runs the version pinned by CLAUDE_CODE_VERSION.

Fixes openabdev#418
@chaodu-agent chaodu-agent requested a review from thepagent as a code owner April 18, 2026 13:53
@thepagent
Copy link
Copy Markdown
Collaborator

✅ Validated locally

Built Dockerfile.claude on arm64 (OrbStack) and verified:

$ echo "CLAUDE_CODE_EXECUTABLE=$CLAUDE_CODE_EXECUTABLE"
CLAUDE_CODE_EXECUTABLE=/usr/local/bin/claude

$ ls -la $CLAUDE_CODE_EXECUTABLE
lrwxrwxrwx 1 root root 52 ... /usr/local/bin/claude -> ../lib/node_modules/@anthropic-ai/claude-code/cli.js

$ claude --version
2.1.104 (Claude Code)

$ which claude-agent-acp
/usr/local/bin/claude-agent-acp
Check Result
CLAUDE_CODE_EXECUTABLE env set in image /usr/local/bin/claude
Binary exists and is correct version 2.1.104
claude-agent-acp installed
Docker build clean

LGTM 👍

@thepagent thepagent merged commit 1cbcc21 into openabdev:main Apr 18, 2026
9 checks passed
brettchien added a commit to brettchien/openab that referenced this pull request Apr 19, 2026
Before this change, `openab-claude:0.7.8-beta.7` ships:
  - claude-agent-acp@0.25.0 — hardcoded model list, no Opus 4.7
  - claude-code@2.1.104     — knows up to Opus 4.6 only
  - ENV CLAUDE_CODE_EXECUTABLE=/usr/local/bin/claude (openabdev#447)

With openabdev#447 making the pinned claude-code binary load-bearing, neither
the adapter's availableModels nor the CLI's model resolver knows about
Opus 4.7 — users get Sonnet 4.6 regardless of ANTHROPIC_MODEL=opus.

This PR:
  - introduces `CLAUDE_AGENT_ACP_VERSION` ARG (pattern parity with
    `CLAUDE_CODE_VERSION` from openabdev#326/openabdev#412)
  - bumps adapter 0.25.0 → 0.29.2 (brings claude-agent-sdk 0.2.111+
    whose availableModels includes Opus 4.7)
  - bumps claude-code 2.1.104 → 2.1.114

anthropics/claude-code#49512 (parallel-mkdir ENOENT race) was filed
against 2.1.112 and is still OPEN but has zero comments. Inspection
of the 2.1.114 install shows the CLI moved to a per-platform native
binary (openabdev#2.1.113) and session state relocated from
`/tmp/claude-<uid>/…/tasks/` to `$HOME/.claude/{projects,tasks}/`,
so the vulnerable filesystem layout no longer exists — binary-grep
for `/home-//tasks` returns 0 matches. 50 parallel `claude -p` calls
as the same user (40ms stagger) produced 0/50 errors, 0 bytes stderr,
and no `/tmp/claude-*` directories.

Refs openabdev#326, openabdev#412, openabdev#418, openabdev#447
Closes nothing explicitly (no issue filed; repro + rationale in body).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Dockerfile.claude installs @anthropic-ai/claude-code but claude-agent-acp adapter never uses it

2 participants