Skip to content

bug: compiled binary cannot invoke Claude Code — SDK cli.js path hardcoded to CI runner filesystem #1210

@symrho

Description

@symrho

Description

The compiled Archon binary (all platforms, tested on v0.3.6 darwin-arm64) cannot execute any workflow with provider: claude. The @anthropic-ai/claude-agent-sdk path resolution falls back to a hardcoded file:// URI from the GitHub Actions build environment.

Error

error: Module not found "/Users/runner/work/Archon/Archon/node_modules/.bun/
@anthropic-ai+claude-agent-sdk@0.2.89+27912429049419a2/node_modules/
@anthropic-ai/claude-agent-sdk/cli.js"

Repeats 3× per retry, then the node fails. All provider: claude workflow nodes are affected.

Root cause

The SDK integration code in the compiled binary contains:

let _ = n.pathToClaudeCodeExecutable;
if (!_) {
  let HR = fileURLToPath(
    "file:///Users/runner/work/Archon/Archon/node_modules/.bun/" +
    "@anthropic-ai+claude-agent-sdk@0.2.89+.../sdk.mjs"
  );
  _ = path.join(path.dirname(HR), "cli.js");
}

pathToClaudeCodeExecutable is never set by the workflow runner, so it always falls through to the import.meta.url-derived path. Inside a bun build --compile binary, import.meta.url is frozen to the CI runner's filesystem (/Users/runner/work/Archon/Archon/...), which doesn't exist on end-user machines.

This is the same class of issue as #986 (build-time vs runtime resolution), but #986 only fixed bundled-build.ts constants — the SDK module path was not addressed.

Related: #1176 proposes claudeBinaryPath config, which would be the user-facing workaround.

Reproduction

curl -fsSL https://archon.diy/install | bash
archon version  # works — v0.3.6, Build: binary

mkdir -p .archon/workflows && cat > .archon/workflows/test.yaml << 'EOF'
name: test
provider: claude
nodes:
  - id: hello
    prompt: "Say hello"
EOF

archon workflow run test "say hello"
# → error: Module not found "/Users/runner/work/Archon/Archon/..."

Workaround

Create a symlink farm at the expected path pointing to the real SDK in the Bun cache:

sudo mkdir -p "/Users/runner/work/Archon/Archon/node_modules/.bun/@anthropic-ai+claude-agent-sdk@0.2.89+27912429049419a2/node_modules/@anthropic-ai"
sudo chown -R $(whoami):staff /Users/runner
ln -s "$HOME/.bun/install/cache/@anthropic-ai/claude-agent-sdk@0.2.89@@@1" \
  "/Users/runner/work/Archon/Archon/node_modules/.bun/@anthropic-ai+claude-agent-sdk@0.2.89+27912429049419a2/node_modules/@anthropic-ai/claude-agent-sdk"

This breaks if the SDK version changes in a future Archon release.

Environment

  • Archon v0.3.6 (darwin-arm64 binary, installed via curl -fsSL https://archon.diy/install | bash)
  • Claude Code installed and on PATH
  • macOS 26.3 (darwin-arm64)

Suggested fix

Set pathToClaudeCodeExecutable to a runtime-resolved path before calling the SDK. Options:

  1. Resolve which claude at runtime (simplest — Claude Code is a prerequisite anyway)
  2. Implement feat: add claudeBinaryPath config option for custom Claude Code install paths #1176 (claudeBinaryPath config) and use it as the primary resolution path
  3. Ship cli.js as an embedded asset inside the compiled binary

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions