Skip to content

Python: feat(claude): bump claude-agent-sdk to 0.2.87#6248

Open
giles17 wants to merge 3 commits into
microsoft:mainfrom
giles17:claude-sdk-bump-0.2.87
Open

Python: feat(claude): bump claude-agent-sdk to 0.2.87#6248
giles17 wants to merge 3 commits into
microsoft:mainfrom
giles17:claude-sdk-bump-0.2.87

Conversation

@giles17
Copy link
Copy Markdown
Contributor

@giles17 giles17 commented Jun 1, 2026

Summary

Upgrade claude-agent-sdk dependency from >=0.1.36,<0.1.49 to >=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

  • pyproject.toml — bumped version pin
  • _agent.py — added "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), added TaskBudget type import
  • uv.lock — resolved new dependency

Notable upstream additions (0.1.49 to 0.2.87)

  • SessionStore adapter for external transcript mirroring
  • Skills option for enabling/disabling skills
  • Hook event streaming
  • Deferred tool use (PreToolUse hooks can defer decisions)
  • Strict MCP config mode
  • Task budget for token pacing
  • xhigh effort level (Opus 4.7)
  • Security fix: mcp dependency floor raised to >=1.23.0 (CVE-2025-66416)

Validation

  • 61 unit tests pass
  • Lint (ruff) passes
  • Mypy type-checking passes

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>
Copilot AI review requested due to automatic review settings June 1, 2026 18:51
@moonbox3 moonbox3 added the python label Jun 1, 2026
@giles17 giles17 changed the title feat(claude): bump claude-agent-sdk to 0.2.87 Python: bump claude-agent-sdk to 0.2.87 Jun 1, 2026
@github-actions github-actions Bot changed the title Python: bump claude-agent-sdk to 0.2.87 Python: feat(claude): bump claude-agent-sdk to 0.2.87 Jun 1, 2026
@moonbox3
Copy link
Copy Markdown
Contributor

moonbox3 commented Jun 1, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/claude/agent_framework_claude
   _agent.py3192891%407–408, 412, 424, 432–434, 436–437, 467–469, 488, 492, 494, 498, 507, 553, 556, 596, 601–602, 676, 763, 789–792
TOTAL37795442088% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
7508 34 💤 0 ❌ 0 🔥 2m 3s ⏱️

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-sdk requirement to >=0.2.87,<0.3 (and refresh uv.lock resolution).
  • Extend ClaudeAgentOptions to include the new xhigh effort level and additional upstream SDK options (e.g., skills, session_id, task_budget, etc.).
  • Add the TaskBudget type 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.

Comment thread python/packages/claude/agent_framework_claude/_agent.py
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

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_id option and the existing resume mechanism — 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 ClaudeAgentOptions keys through the same type used by run(..., options=...) without wiring those keys into the per-run path. That means callers can now pass session-related/runtime-looking options such as session_id, continue_conversation, or fork_session and get no effect, which is a design mismatch worth fixing before merge.


Automated review by giles17's agents

Comment thread python/packages/claude/agent_framework_claude/_agent.py
Comment thread python/packages/claude/pyproject.toml Outdated
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",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

in the note you said, 0.1 to 0.2 was additive only, so do we need to raise the lower limit?

giles17 and others added 2 commits June 2, 2026 10:56
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants