Skip to content

deps(runner): bump anthropic 0.86.0, claude-agent-sdk 0.1.50#985

Merged
jeremyeder merged 3 commits intomainfrom
deps/bump-sdk-versions
Mar 25, 2026
Merged

deps(runner): bump anthropic 0.86.0, claude-agent-sdk 0.1.50#985
jeremyeder merged 3 commits intomainfrom
deps/bump-sdk-versions

Conversation

@jeremyeder
Copy link
Copy Markdown
Contributor

Summary

  • Bump anthropic[vertex]: 0.68.0 → 0.86.0
  • Bump claude-agent-sdk: 0.1.23 → 0.1.50
  • Lockfile regenerated via uv lock

Test plan

  • Runner pod starts successfully with new SDK versions
  • Claude session creation and streaming works end-to-end
  • Vertex AI (Gemini) path unaffected by anthropic bump
  • No import errors or deprecation warnings at startup

🤖 Generated with Claude Code

@jeremyeder jeremyeder added the dependencies Pull requests that update a dependency file label Mar 23, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 17efb5f6-9083-4a08-90d3-06c30a8b7b52

📥 Commits

Reviewing files that changed from the base of the PR and between 2530986 and 754c748.

⛔ Files ignored due to path filters (1)
  • components/runners/ambient-runner/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • components/runners/ambient-runner/ag_ui_claude_sdk/adapter.py
  • components/runners/ambient-runner/ag_ui_claude_sdk/config.py
  • components/runners/ambient-runner/ag_ui_claude_sdk/utils.py
  • components/runners/ambient-runner/pyproject.toml

Walkthrough

Raised ambient-runner optional claude dependency minimums; added and migrate a new per-run forwarded prop thinking; updated AG-UI Claude adapter event formatting and thinking-block cleanup behavior; adjusted forwarded-props handling and config to accept and convert legacy max_thinking_tokens.

Changes

Cohort / File(s) Summary
Dependency Version Updates
components/runners/ambient-runner/pyproject.toml
Raised optional claude dependency minimums: anthropic[vertex] >=0.68.0>=0.86.0; claude-agent-sdk >=0.1.23>=0.1.50.
AG-UI Claude adapter
components/runners/ambient-runner/ag_ui_claude_sdk/adapter.py
Documented thinking in forwarded_props; reformatted emitted AG-UI reasoning events to consistent multi-line keyword-argument style; include messageId=current_reasoning_id in cleanup END events and clear current_reasoning_id after emitting them.
Forwarded props config
components/runners/ambient-runner/ag_ui_claude_sdk/config.py
Added "thinking" to ALLOWED_FORWARDED_PROPS; marked max_thinking_tokens as legacy and documented structured thinking options.
Forwarded-props migration logic
components/runners/ambient-runner/ag_ui_claude_sdk/utils.py
apply_forwarded_props now migrates deprecated max_thinking_tokens into thinking = ThinkingConfigEnabled(budget_tokens=...) when thinking is absent, removes legacy key, and logs a warning; remaining whitelisting/merge behavior unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: dependency version bumps for anthropic and claude-agent-sdk with specific versions.
Description check ✅ Passed The description clearly relates to the changeset, specifying version bumps, lockfile regeneration, and a test plan aligned with the code changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deps/bump-sdk-versions

Comment @coderabbitai help to get the list of available commands and usage tips.

@jeremyeder
Copy link
Copy Markdown
Contributor Author

SDK Feature Analysis

anthropic[vertex] 0.68.0 -> 0.86.0 | claude-agent-sdk 0.1.23 -> 0.1.50

TL;DR

  • 1 deprecation to migrate (max_thinking_tokens -> ThinkingConfig)
  • 8 opt-in features available for adoption in the runner
  • 7 bug fixes relevant to our usage (streaming, MCP init, large agent defs)
  • Bundled Claude CLI: 2.1.22 -> 2.1.81

Action Required

  • MIGRATE -- max_thinking_tokens is now deprecated in favor of ThinkingConfig types (ThinkingConfigAdaptive, ThinkingConfigEnabled, ThinkingConfigDisabled). The new thinking field takes precedence. (claude-agent-sdk 0.1.36, #565)

Opt-in Features to Evaluate

These are available but require code changes to adopt:

  • Effort option (v0.1.36): effort field on ClaudeAgentOptions -- "low", "medium", "high", "max" #565
  • MCP tool annotations (v0.1.31): @tool decorator annotations param -- readOnlyHint, destructiveHint, etc. #551
  • Session info (v0.1.50): tag, created_at on SDKSessionInfo, get_session_info() #667
  • AgentDefinition (v0.1.49): skills, memory, mcpServers fields #684
  • Session history (v0.1.46): list_sessions(), get_session_messages() #622
  • ResultMessage stop_reason (v0.1.46): inspect why a turn ended #619
  • Hook enhancements (v0.1.46): agent_id, agent_type on tool-lifecycle hooks #628
  • Enhanced hook types (v0.1.29): tool_use_id, subagent fields on hook I/O types #545

Notable Bug Fixes (claude-agent-sdk)

Fix Version Impact
MCP init race condition 0.1.46 String prompts closed stdin before MCP servers registered
Unknown message crash 0.1.40 rate_limit_event etc. no longer crash sessions
Large agent definitions 0.1.31 Payloads exceeding ARG_MAX now sent via stdin
AssistantMessage.error 0.1.28 Error field was reading from wrong data path
Fine-grained streaming 0.1.48-0.1.49 input_json_delta events fixed, then env-var workaround removed

anthropic SDK Highlights (0.68.0 -> 0.86.0)

Feature Version
Structured Outputs (beta -> GA) 0.73.0 -> 0.77.0
Automatic caching (top-level cache control) 0.83.0
Filesystem memory tools 0.86.0
Claude Opus 4.6 + adaptive thinking 0.78.0
Claude Sonnet 4.6 0.80.0
Context management + autocompaction 0.69.0, 0.72.0, 0.75.0
MCP conversion helpers 0.84.0
Thinking display setting (GA) 0.85.0
Bundled Claude CLI versions (27 releases)
SDK CLI SDK CLI
0.1.50 2.1.81 0.1.37 2.1.44
0.1.49 2.1.77 0.1.36 2.1.42
0.1.48 2.1.71 0.1.35 2.1.39
0.1.47 2.1.70 0.1.34 2.1.38
0.1.46 2.1.69 0.1.33 2.1.37
0.1.45 2.1.63 0.1.32 2.1.36
0.1.44 2.1.59 0.1.31 2.1.33
0.1.43 2.1.56 0.1.30 2.1.32
0.1.42 2.1.55 0.1.29 2.1.31
0.1.41 2.1.52 0.1.28 2.1.30
0.1.40 2.1.51 0.1.27 2.1.29
0.1.39 2.1.49 0.1.26 2.1.27
0.1.38 2.1.47 0.1.25 2.1.23
0.1.24 2.1.22

@jeremyeder jeremyeder marked this pull request as ready for review March 23, 2026 13:13
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@components/runners/ambient-runner/pyproject.toml`:
- Around line 23-24: The code still uses the deprecated max_thinking_tokens
option; change all usages to the new thinking config pattern (ThinkingConfig or
ThinkingConfig*) before bumping claude-agent-sdk to >=0.1.50: in
ag_ui_claude_sdk.config (where max_thinking_tokens is defined/loaded) replace
that field with a thinking object built from the SDK's ThinkingConfig* type, and
in ag_ui_claude_sdk.adapter (where max_thinking_tokens is passed, e.g., at the
call site around line 140) construct and pass the corresponding
thinking=ThinkingConfig(...) instance instead of max_thinking_tokens; ensure
imports for the SDK ThinkingConfig type are added/updated and any tests or
defaults are adjusted to the new structure so runtime startup uses thinking
consistently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 389f4991-fe11-4313-8c1d-313d97211942

📥 Commits

Reviewing files that changed from the base of the PR and between 7af078a and 238db46.

⛔ Files ignored due to path filters (1)
  • components/runners/ambient-runner/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • components/runners/ambient-runner/pyproject.toml

Comment on lines +23 to +24
"anthropic[vertex]>=0.86.0",
"claude-agent-sdk>=0.1.50",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== 1) Find deprecated option usage =="
rg -n -C2 '\bmax_thinking_tokens\b' -g '!**/tests/**' || true

echo
echo "== 2) Find new thinking config usage/imports =="
rg -n -C2 '\bThinkingConfig(Adaptive|Enabled|Disabled)\b|\bthinking\s*=' -g '!**/tests/**' || true

echo
echo "== 3) Find claude-agent-sdk callsites/options objects for manual inspection =="
rg -n -C3 'ClaudeAgentOptions|claude-agent-sdk|create_session|session|thinking' components/runners/ambient-runner || true

Repository: ambient-code/platform

Length of output: 50378


Migrate max_thinking_tokens to thinking config before merging claude-agent-sdk>=0.1.50.

The codebase still references the deprecated max_thinking_tokens parameter in ag_ui_claude_sdk/config.py (line 19) and ag_ui_claude_sdk/adapter.py (line 140), but the SDK version bump to >=0.1.50 removes support for this option. Update all usages to the new thinking + ThinkingConfig* pattern to prevent startup errors or runtime incompatibility.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/runners/ambient-runner/pyproject.toml` around lines 23 - 24, The
code still uses the deprecated max_thinking_tokens option; change all usages to
the new thinking config pattern (ThinkingConfig or ThinkingConfig*) before
bumping claude-agent-sdk to >=0.1.50: in ag_ui_claude_sdk.config (where
max_thinking_tokens is defined/loaded) replace that field with a thinking object
built from the SDK's ThinkingConfig* type, and in ag_ui_claude_sdk.adapter
(where max_thinking_tokens is passed, e.g., at the call site around line 140)
construct and pass the corresponding thinking=ThinkingConfig(...) instance
instead of max_thinking_tokens; ensure imports for the SDK ThinkingConfig type
are added/updated and any tests or defaults are adjusted to the new structure so
runtime startup uses thinking consistently.

@ambient-code ambient-code bot added this to the Review Queue milestone Mar 23, 2026
jeremyeder added a commit that referenced this pull request Mar 23, 2026
Address CodeRabbit review feedback on PR #985: add the new `thinking`
config (adaptive/enabled/disabled) to ALLOWED_FORWARDED_PROPS so
clients can use the preferred API alongside the legacy
`max_thinking_tokens` option.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jeremyeder added a commit that referenced this pull request Mar 23, 2026
Address CodeRabbit review feedback on PR #985: add the new `thinking`
config (adaptive/enabled/disabled) to ALLOWED_FORWARDED_PROPS so
clients can use the preferred API alongside the legacy
`max_thinking_tokens` option.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jeremyeder jeremyeder force-pushed the deps/bump-sdk-versions branch from 2482dc1 to 5ed09ec Compare March 23, 2026 21:08
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@components/runners/ambient-runner/ag_ui_claude_sdk/adapter.py`:
- Around line 1134-1137: The end-event yields are missing the reasoning message
identifier causing clients to orphan in-flight reasoning blocks; update the two
yields that produce ReasoningMessageEndEvent and ReasoningEndEvent (around the
symbols thread_id, run_id, ts) to include the message identifier field
(messageId or message_id as used elsewhere in this module) so the emitted end
events match the start events' ID; locate the block emitting
ReasoningMessageEndEvent and ReasoningEndEvent and add messageId=message_id (or
the correct local variable name) to both event constructors.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8feba351-e733-49a6-ab46-5be02e37664b

📥 Commits

Reviewing files that changed from the base of the PR and between 238db46 and 5ed09ec.

⛔ Files ignored due to path filters (1)
  • components/runners/ambient-runner/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • components/runners/ambient-runner/ag_ui_claude_sdk/adapter.py
  • components/runners/ambient-runner/ag_ui_claude_sdk/config.py
  • components/runners/ambient-runner/pyproject.toml

Ambient Code Bot and others added 3 commits March 24, 2026 09:22
Bump SDK dependencies for the ambient runner:
- anthropic[vertex]: 0.68.0 -> 0.86.0
- claude-agent-sdk: 0.1.23 -> 0.1.50

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address CodeRabbit review feedback on PR #985: add the new `thinking`
config (adaptive/enabled/disabled) to ALLOWED_FORWARDED_PROPS so
clients can use the preferred API alongside the legacy
`max_thinking_tokens` option.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add messageId to reasoning cleanup end events so clients can correlate
  start/end events and avoid orphaning in-flight reasoning blocks
- Auto-migrate deprecated max_thinking_tokens to ThinkingConfigEnabled
  in forwarded_props for forward compatibility with SDK changes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jeremyeder jeremyeder force-pushed the deps/bump-sdk-versions branch from 2530986 to 754c748 Compare March 24, 2026 13:22
@jeremyeder
Copy link
Copy Markdown
Contributor Author

image

@jeremyeder jeremyeder merged commit c69a397 into main Mar 25, 2026
27 checks passed
@jeremyeder jeremyeder deleted the deps/bump-sdk-versions branch March 25, 2026 20:49
@ambient-code ambient-code bot removed this from the Review Queue milestone Mar 26, 2026
jeremyeder added a commit to jeremyeder/platform that referenced this pull request Mar 26, 2026
…-code#985)

## Summary

- Bump `anthropic[vertex]`: 0.68.0 → 0.86.0
- Bump `claude-agent-sdk`: 0.1.23 → 0.1.50
- Lockfile regenerated via `uv lock`

## Test plan

- [ ] Runner pod starts successfully with new SDK versions
- [ ] Claude session creation and streaming works end-to-end
- [ ] Vertex AI (Gemini) path unaffected by anthropic bump
- [ ] No import errors or deprecation warnings at startup

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Ambient Code Bot <bot@ambient-code.local>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant