Python: feat(claude): bump claude-agent-sdk to 0.2.87#6248
Conversation
Upgrade claude-agent-sdk dependency from >=0.1.36,<0.1.49 to >=0.2.87,<0.3. Changes: - Bump version pin in pyproject.toml - Add 'xhigh' effort level to ClaudeAgentOptions (Opus 4.7 specific) - Expose new upstream SDK options: skills, session_id, task_budget, include_hook_events, strict_mcp_config, continue_conversation, fork_session - Add TaskBudget type import - Update uv.lock Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
This PR updates the Python Claude integration to use claude-agent-sdk v0.2.87 and surfaces newly available upstream configuration options in the ClaudeAgentOptions type to keep the integration aligned with the SDK’s expanded feature set.
Changes:
- Bump
claude-agent-sdkrequirement to>=0.2.87,<0.3(and refreshuv.lockresolution). - Extend
ClaudeAgentOptionsto include the newxhigheffort level and additional upstream SDK options (e.g.,skills,session_id,task_budget, etc.). - Add the
TaskBudgettype import for typing support.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/uv.lock | Updates the resolved dependency graph for claude-agent-sdk 0.2.87 (including new transitive deps like sniffio). |
| python/packages/claude/pyproject.toml | Bumps the claude-agent-sdk dependency constraint for the Claude integration package. |
| python/packages/claude/agent_framework_claude/_agent.py | Expands ClaudeAgentOptions typing surface to match new upstream SDK options and effort levels. |
There was a problem hiding this comment.
Automated Code Review
Reviewers: 4 | Confidence: 91%
✓ Correctness
Clean dependency bump from claude-agent-sdk 0.1.x to 0.2.87. The changes are limited to: (1) widened version pin in pyproject.toml/uv.lock, (2) new TypedDict fields in ClaudeAgentOptions that pass through the existing options forwarding mechanism at _prepare_client_options lines 479-481, and (3) a TaskBudget type import in the TYPE_CHECKING block. The pass-through pattern (
for key, value in self._default_options.items(): opts[key] = value) handles the new options without any additional logic. No correctness issues found.
✓ Security Reliability
Clean dependency bump from claude-agent-sdk 0.1.x to 0.2.87 with new typed configuration options exposed in ClaudeAgentOptions TypedDict. All new fields are optional, properly typed, and pass through as structured kwargs to SDKOptions (no string interpolation or shell execution). The resolved mcp dependency (1.27.2) addresses the noted CVE. No security or reliability concerns identified.
✓ Test Coverage
The PR adds 7 new passthrough options and a new effort level to the ClaudeAgentOptions TypedDict. These are forwarded to the SDK via an existing generic loop (lines 479-481) that is already tested implicitly. While there are no dedicated tests for the new options individually, the forwarding mechanism is covered by existing tests (e.g., test_prepare_client_options_with_instructions). The one gap worth noting is the potential interaction between the new
session_idoption and the existingresumemechanism — if both are set, both would be forwarded to the SDK — but this is a pre-existing design concern, not a regression introduced by this PR.
✗ Design Approach
The SDK bump itself looks fine, but the change currently exposes several new
ClaudeAgentOptionskeys through the same type used byrun(..., options=...)without wiring those keys into the per-run path. That means callers can now pass session-related/runtime-looking options such assession_id,continue_conversation, orfork_sessionand get no effect, which is a design mismatch worth fixing before merge.
Automated review by giles17's agents
| dependencies = [ | ||
| "agent-framework-core>=1.6.0,<2", | ||
| "claude-agent-sdk>=0.1.36,<0.1.49", | ||
| "claude-agent-sdk>=0.2.87,<0.3", |
There was a problem hiding this comment.
in the note you said, 0.1 to 0.2 was additive only, so do we need to raise the lower limit?
Keep the lower bound at 0.1.36 since the 0.1→0.2 transition was additive and our code works on older versions as long as new options aren't used. This avoids forcing unnecessary upgrades on existing users. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Upgrade
claude-agent-sdkdependency from>=0.1.36,<0.1.49to>=0.2.87,<0.3.The 0.1.x to 0.2.x version jump was additive only (no breaking changes). All APIs we consume remain backward-compatible.
Changes
"xhigh"effort level (Opus 4.7), exposed 7 new upstream SDK options (skills,session_id,task_budget,include_hook_events,strict_mcp_config,continue_conversation,fork_session), addedTaskBudgettype importNotable upstream additions (0.1.49 to 0.2.87)
xhigheffort level (Opus 4.7)mcpdependency floor raised to>=1.23.0(CVE-2025-66416)Validation