[GH-ISSUE #6403] Capability packages cannot resolve the Claude Agent SDK native binary #3580

Closed
opened 2026-10-21 06:04:29 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Gunterlie on GitHub (Sep 20, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6403

Originally assigned to: @Gunterlie on GitHub.

What happens

Capability packages cannot use the Claude subscription provider. Every call fails with:

Native CLI binary for win32-x64 not found. Reinstall @anthropic-ai/claude-agent-sdk
without --omit=optional, or set options.pathToClaudeCodeExecutable.

Reported on Engine 2.4.6 staging, SDK 0.3.273, Windows 10 x64, pnpm, from the Slurp2 agent
package. The Engine's own provider works on the same install.

This is not Windows-specific. The same sibling is missing on a Linux production install, so the
package-side Claude subscription path is broken there too — it just has not been exercised yet.

Why

The SDK locates its native binary with createRequire(import.meta.url), so the lookup starts
wherever the SDK module sits. All eight platform binaries are declared as
optionalDependencies of @anthropic-ai/claude-agent-sdk.

There are two trees on the Engine, and only one of them has the platform sibling:

/app/.pnpm/@anthropic-ai+claude-agent-sdk@0.3.273_.../node_modules/@anthropic-ai/
  claude-agent-sdk
  claude-agent-sdk-linux-x64      <- present; the Engine resolves through here

/app/data/capability-packages/node_modules/@anthropic-ai/
  claude-agent-sdk
  sdk                             <- no platform sibling, and none nested either

Capability packages resolve against the second tree. It was provisioned without optional
dependencies, so the platform package is absent and the lookup fails.

Verified on a production Engine container:

$ ls /app/data/capability-packages/node_modules/@anthropic-ai/
claude-agent-sdk
sdk

$ ls /app/data/capability-packages/node_modules/@anthropic-ai/claude-agent-sdk/node_modules/@anthropic-ai/
ls: cannot access ...: No such file or directory

$ find /app -maxdepth 6 -name claude-agent-sdk-linux-x64 -not -path '*/data/*'
/app/.pnpm/node_modules/@anthropic-ai/claude-agent-sdk-linux-x64
/app/.pnpm/@anthropic-ai+claude-agent-sdk@0.3.273_.../node_modules/@anthropic-ai/claude-agent-sdk-linux-x64
/app/.pnpm/@anthropic-ai+claude-agent-sdk-linux-x64@0.3.273/node_modules/@anthropic-ai/claude-agent-sdk-linux-x64

Suggested fix

Provision the capability-package tree so the resolved SDK has its platform sibling. Either
install it with optional dependencies included, or link
data/capability-packages/node_modules/@anthropic-ai/claude-agent-sdk into the pnpm store
instead of laying down a flat copy. The reporter confirms a junction fixes it on Windows.

Fixing provisioning fixes every capability package at once.

Why not fixed in Marinara-Agents

Two package-side approaches were checked and rejected:

  • Externalizing @anthropic-ai/claude-agent-sdk from the package bundle (the existing
    --external:undici precedent) only moves the lookup into
    data/capability-packages/node_modules/@anthropic-ai/claude-agent-sdk/, which is the tree that
    is also missing the sibling. Same failure.
  • Passing options.pathToClaudeCodeExecutable is not reachable: packages do not vendor
    claude-subscription.provider.ts; the Agents builder pulls it from the Engine worktree at
    bundle time.
Originally created by @Gunterlie on GitHub (Sep 20, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6403 Originally assigned to: @Gunterlie on GitHub. ## What happens Capability packages cannot use the Claude subscription provider. Every call fails with: ``` Native CLI binary for win32-x64 not found. Reinstall @anthropic-ai/claude-agent-sdk without --omit=optional, or set options.pathToClaudeCodeExecutable. ``` Reported on Engine 2.4.6 staging, SDK 0.3.273, Windows 10 x64, pnpm, from the Slurp2 agent package. The Engine's own provider works on the same install. This is not Windows-specific. The same sibling is missing on a Linux production install, so the package-side Claude subscription path is broken there too — it just has not been exercised yet. ## Why The SDK locates its native binary with `createRequire(import.meta.url)`, so the lookup starts wherever the SDK module sits. All eight platform binaries are declared as `optionalDependencies` of `@anthropic-ai/claude-agent-sdk`. There are two trees on the Engine, and only one of them has the platform sibling: ``` /app/.pnpm/@anthropic-ai+claude-agent-sdk@0.3.273_.../node_modules/@anthropic-ai/ claude-agent-sdk claude-agent-sdk-linux-x64 <- present; the Engine resolves through here /app/data/capability-packages/node_modules/@anthropic-ai/ claude-agent-sdk sdk <- no platform sibling, and none nested either ``` Capability packages resolve against the second tree. It was provisioned without optional dependencies, so the platform package is absent and the lookup fails. Verified on a production Engine container: ``` $ ls /app/data/capability-packages/node_modules/@anthropic-ai/ claude-agent-sdk sdk $ ls /app/data/capability-packages/node_modules/@anthropic-ai/claude-agent-sdk/node_modules/@anthropic-ai/ ls: cannot access ...: No such file or directory $ find /app -maxdepth 6 -name claude-agent-sdk-linux-x64 -not -path '*/data/*' /app/.pnpm/node_modules/@anthropic-ai/claude-agent-sdk-linux-x64 /app/.pnpm/@anthropic-ai+claude-agent-sdk@0.3.273_.../node_modules/@anthropic-ai/claude-agent-sdk-linux-x64 /app/.pnpm/@anthropic-ai+claude-agent-sdk-linux-x64@0.3.273/node_modules/@anthropic-ai/claude-agent-sdk-linux-x64 ``` ## Suggested fix Provision the capability-package tree so the resolved SDK has its platform sibling. Either install it with optional dependencies included, or link `data/capability-packages/node_modules/@anthropic-ai/claude-agent-sdk` into the pnpm store instead of laying down a flat copy. The reporter confirms a junction fixes it on Windows. Fixing provisioning fixes every capability package at once. ## Why not fixed in Marinara-Agents Two package-side approaches were checked and rejected: - Externalizing `@anthropic-ai/claude-agent-sdk` from the package bundle (the existing `--external:undici` precedent) only moves the lookup into `data/capability-packages/node_modules/@anthropic-ai/claude-agent-sdk/`, which is the tree that is also missing the sibling. Same failure. - Passing `options.pathToClaudeCodeExecutable` is not reachable: packages do not vendor `claude-subscription.provider.ts`; the Agents builder pulls it from the Engine worktree at bundle time.
bsakaguchi 2026-10-21 06:04:29 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Sep 20, 2026):

Codex is taking this in #6420 for @SpicyMarinara as part of the requested issue sweep. I am tracing the existing flow and will add focused regression evidence before merging to staging.

<!-- gh-comment-id:5748722486 --> @SpicyMarinara commented on GitHub (Sep 20, 2026): Codex is taking this in #6420 for @SpicyMarinara as part of the requested issue sweep. I am tracing the existing flow and will add focused regression evidence before merging to staging.
Author
Owner

@SpicyMarinara commented on GitHub (Sep 20, 2026):

Resolved by #6420, merged into staging at 49faeabfe4. Required checks and CodeRabbit passed before merge.

<!-- gh-comment-id:5749555722 --> @SpicyMarinara commented on GitHub (Sep 20, 2026): Resolved by #6420, merged into staging at 49faeabfe42b02d3648e29e226b773d4a33259ce. Required checks and CodeRabbit passed before merge.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3580
No description provided.