Skip to content

Commit c69a397

Browse files
jeremyederAmbient Code Botclaude
authored
deps(runner): bump anthropic 0.86.0, claude-agent-sdk 0.1.50 (#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>
1 parent 9971336 commit c69a397

5 files changed

Lines changed: 58 additions & 25 deletions

File tree

components/runners/ambient-runner/ag_ui_claude_sdk/adapter.py

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class ClaudeAgentAdapter:
137137
Forwarded Props Support:
138138
Per-run overrides for execution control without changing agent identity.
139139
Whitelisted keys include: resume, fork_session, model, temperature, max_tokens,
140-
max_thinking_tokens, max_turns, max_budget_usd, output_format, etc.
140+
thinking, max_thinking_tokens, max_turns, max_budget_usd, output_format, etc.
141141
142142
Example:
143143
RunAgentInput(
@@ -770,12 +770,16 @@ def flush_pending_msg():
770770
current_reasoning_id = str(uuid.uuid4())
771771
ts = now_ms()
772772
yield ReasoningStartEvent(
773-
threadId=thread_id, runId=run_id,
774-
messageId=current_reasoning_id, timestamp=ts,
773+
threadId=thread_id,
774+
runId=run_id,
775+
messageId=current_reasoning_id,
776+
timestamp=ts,
775777
)
776778
yield ReasoningMessageStartEvent(
777-
threadId=thread_id, runId=run_id,
778-
messageId=current_reasoning_id, timestamp=ts,
779+
threadId=thread_id,
780+
runId=run_id,
781+
messageId=current_reasoning_id,
782+
timestamp=ts,
779783
)
780784
elif block_type == "tool_use":
781785
# Tool call starting - emit TOOL_CALL_START
@@ -807,12 +811,16 @@ def flush_pending_msg():
807811
in_thinking_block = False
808812
ts = now_ms()
809813
yield ReasoningMessageEndEvent(
810-
threadId=thread_id, runId=run_id,
811-
messageId=current_reasoning_id, timestamp=ts,
814+
threadId=thread_id,
815+
runId=run_id,
816+
messageId=current_reasoning_id,
817+
timestamp=ts,
812818
)
813819
yield ReasoningEndEvent(
814-
threadId=thread_id, runId=run_id,
815-
messageId=current_reasoning_id, timestamp=ts,
820+
threadId=thread_id,
821+
runId=run_id,
822+
messageId=current_reasoning_id,
823+
timestamp=ts,
816824
)
817825

818826
# Persist thinking content as ReasoningMessage per AG-UI spec.
@@ -1124,12 +1132,19 @@ def flush_pending_msg():
11241132
logger.debug("Cleanup: closing hanging thinking block")
11251133
ts = now_ms()
11261134
yield ReasoningMessageEndEvent(
1127-
threadId=thread_id, runId=run_id, timestamp=ts
1135+
threadId=thread_id,
1136+
runId=run_id,
1137+
messageId=current_reasoning_id,
1138+
timestamp=ts,
11281139
)
11291140
yield ReasoningEndEvent(
1130-
threadId=thread_id, runId=run_id, timestamp=ts
1141+
threadId=thread_id,
1142+
runId=run_id,
1143+
messageId=current_reasoning_id,
1144+
timestamp=ts,
11311145
)
11321146
in_thinking_block = False
1147+
current_reasoning_id = None
11331148

11341149
if has_streamed_text and current_message_id:
11351150
logger.debug(

components/runners/ambient-runner/ag_ui_claude_sdk/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"fallback_model", # Fallback if primary fails
1717
"temperature", # Sampling temperature
1818
"max_tokens", # Response length limit
19-
"max_thinking_tokens", # Reasoning depth limit
19+
"max_thinking_tokens", # Reasoning depth limit (legacy, prefer thinking)
20+
"thinking", # Thinking config: {"type": "adaptive"} | {"type": "enabled", "budget_tokens": N} | {"type": "disabled"}
2021
"max_turns", # Conversation turn limit
2122
"max_budget_usd", # Cost limit per run
2223
# Output control

components/runners/ambient-runner/ag_ui_claude_sdk/utils.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,22 @@ def apply_forwarded_props(
300300
if not forwarded_props or not isinstance(forwarded_props, dict):
301301
return merged_kwargs
302302

303+
# Migrate deprecated max_thinking_tokens → thinking config
304+
if (
305+
"max_thinking_tokens" in forwarded_props
306+
and "thinking" not in forwarded_props
307+
and forwarded_props["max_thinking_tokens"] is not None
308+
):
309+
from claude_agent_sdk.types import ThinkingConfigEnabled
310+
311+
budget = forwarded_props.pop("max_thinking_tokens")
312+
forwarded_props["thinking"] = ThinkingConfigEnabled(budget_tokens=budget)
313+
logger.warning(
314+
"max_thinking_tokens is deprecated; converted to "
315+
"thinking=ThinkingConfigEnabled(budget_tokens=%d)",
316+
budget,
317+
)
318+
303319
applied_count = 0
304320
for key, value in forwarded_props.items():
305321
# Only apply whitelisted keys

components/runners/ambient-runner/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ dependencies = [
2020

2121
[project.optional-dependencies]
2222
claude = [
23-
"anthropic[vertex]>=0.68.0",
24-
"claude-agent-sdk>=0.1.23",
23+
"anthropic[vertex]>=0.86.0",
24+
"claude-agent-sdk>=0.1.50",
2525
]
2626
observability = [
2727
"langfuse>=3.0.0",

components/runners/ambient-runner/uv.lock

Lines changed: 12 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)