fix(providers): adapt to claude-agent-sdk 0.2.121 native-binary auto-resolve#1472
fix(providers): adapt to claude-agent-sdk 0.2.121 native-binary auto-resolve#1472dsorensen wants to merge 1 commit intocoleam00:devfrom
Conversation
…resolve claude-agent-sdk 0.2.121 stopped shipping a bundled cli.js and now resolves to a native platform binary by default. The dev-mode short-circuit in resolveClaudeBinaryPath returned undefined so the SDK auto-resolved that native binary, but shouldPassNoEnvFile then misclassified the spawned executable and forwarded `--no-env-file`, which the native binary rejects (it crashes on the unknown flag). Drop the dev-mode short-circuit so dev follows the same env → config → autodetect chain as binary mode. The resolved path then flows into shouldPassNoEnvFile, which correctly suppresses --no-env-file for native binaries. Test changes: - packages/providers/src/claude/binary-resolver-dev.test.ts: rewritten as a regression check that dev mode honors env and config (no short-circuit). - packages/providers/src/claude/provider.test.ts: mock the resolver to return undefined so executableArgs assertions don't depend on whether the test host has a native Claude binary installed at ~/.local/bin/claude. Lockfile: bumps @anthropic-ai/claude-agent-sdk ^0.2.74 → ^0.2.121. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe Claude binary resolver no longer applies dev-mode special handling, now consistently following an environment-variable-first resolution chain across all modes. Dependency on Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
We are already running 0.2.121 |
Summary
@anthropic-ai/claude-agent-sdkfrom^0.2.74→^0.2.121.resolveClaudeBinaryPathso dev follows the same env → config → autodetect chain as binary mode.shouldPassNoEnvFilenow sees the real resolved path and correctly suppresses--no-env-filefor native installs.Why
claude-agent-sdk 0.2.121 stopped shipping a bundled
cli.jsand now resolves to a native platform binary by default. Dev mode used to returnundefinedand let the SDK auto-resolve — but with 0.2.121 the SDK auto-resolves to the native binary, andshouldPassNoEnvFile(undefined)then returnstrue, so--no-env-fileis forwarded to a native binary that rejects unknown flags. Result: every Claude workflow node fails with exit code 1 immediately on spawn.Reproduced in three back-to-back ai_demo workflow runs and confirmed against direct
sendQueryrepro (#878 in session memory).Test plan
bun run validatepasses locally (type-check, lint, format, all package test suites).binary-resolver-dev.test.tsrewritten as a regression check that dev mode honors env / config (no short-circuit). New assertions are mode-agnostic.provider.test.tsmocks./binary-resolverto returnundefinedso existingexecutableArgs: ['--no-env-file']assertions don't depend on whether the test host has a native Claude install at~/.local/bin/claude.archon workflow run claude-plan-full-sdlcagainst any of the three ai_demo projects no longer hits the--no-env-filecrash on the first node spawn.Notes
🤖 Generated with Claude Code
Summary by CodeRabbit
Dependencies
Improvements