Skip to content

chore: upgrade @anthropic-ai/claude-agent-sdk from 0.2.56 to 0.2.71#13339

Merged
GeorgeDong32 merged 2 commits intomainfrom
chore/upgrade-claude-agent-sdk-0.2.71
Mar 9, 2026
Merged

chore: upgrade @anthropic-ai/claude-agent-sdk from 0.2.56 to 0.2.71#13339
GeorgeDong32 merged 2 commits intomainfrom
chore/upgrade-claude-agent-sdk-0.2.71

Conversation

@vaayne
Copy link
Copy Markdown
Collaborator

@vaayne vaayne commented Mar 9, 2026

What this PR does

Before this PR:

@anthropic-ai/claude-agent-sdk was pinned at version 0.2.56.

After this PR:

Upgraded to 0.2.71. The postinstall regex patch (spawn→fork for IPC) applies successfully on the new version (3/3 patches matched). Also fixed cli.js resolution since the new version removed ./cli.js from its exports field.

Why we need it and why it was done in this way

Keep the SDK up to date with the latest bug fixes and improvements from Anthropic.

The following tradeoffs were made: N/A

The following alternatives were considered: N/A

Breaking changes

None. The SDK's Node engine requirement (≥18) is compatible with the project. The cli.js file still exists in the package — only the exports mapping was removed, so the resolution path was updated to use path.join(path.dirname(require.resolve(...)), 'cli.js').

Special notes for your reviewer

  • The postinstall script (scripts/patch-claude-agent-sdk.ts) applies 3 regex patches to sdk.mjs. All 3 matched successfully on version 0.2.71.
  • cli.js resolution in ClaudeCodeService constructor was updated since the new SDK version no longer lists ./cli.js in its package.json exports field.

Checklist

  • PR: The PR description is expressive enough and will help future contributors
  • Code: Write code that humans can understand and Keep it simple
  • Refactor: You have left the code cleaner than you found it (Boy Scout Rule)
  • Upgrade: Impact of this change on upgrade flows was considered and addressed if required
  • Documentation: Not required — no user-facing feature or behavior change
  • Self-review: I have reviewed my own code before requesting review from others

Release note

NONE

The pnpm static patch was for version 0.1.76 and has been unused since
the SDK moved to 0.2.x. Patching is handled by the postinstall script.

Signed-off-by: Vaayne <[email protected]>
Copy link
Copy Markdown
Collaborator

@GeorgeDong32 GeorgeDong32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This review was translated by Claude.

Code Review Summary

Approved - High-quality dependency upgrade PR

Changes Review

File Assessment
✅ Standard version upgrade (0.2.56 → 0.2.71)
✅ Dependency lock file update normal
✅ Obsolete patch files correctly deleted
✅ SDK exports changes correctly adapted

Key Changes Verification

cli.js Path Resolution:

  • SDK new version removed ./dist/** mapping in exports
  • Using * replacement approach is correct
  • Takes into account both dev environment and asar packaging scenarios

Patch Mechanism:

  • Project uses semantic regex patch script (patch-sdk.cjs)
  • More resilient than static .patch files, adapts to SDK version changes

CI Status

All checks passed ✅


Reviewed with Claude Code

@GeorgeDong32 GeorgeDong32 merged commit 781e041 into main Mar 9, 2026
10 checks passed
@GeorgeDong32 GeorgeDong32 deleted the chore/upgrade-claude-agent-sdk-0.2.71 branch March 9, 2026 15:37
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.

3 participants