Skip to content

Commit 9a7b760

Browse files
declan-scaleclaude
andcommitted
fix: cap openai <2.45 for openai-agents 0.14.x compatibility
openai 2.45.0 made `InputTokensDetails.cache_write_tokens` a required field, but openai-agents 0.14.x (the latest release) still constructs `InputTokensDetails(cached_tokens=0)` in agents/usage.py. As a result every `Runner.run_streamed` call raises a pydantic ValidationError at context setup, before any LLM request. The repo's own uv.lock pins openai 2.40.0 so unit tests pass, but the tutorial agents resolve their dependencies fresh (no lockfile) and pick up openai 2.45.0, which is why the "Test Tutorial Agents" workflow fails on every branch for all openai-agents based tutorials (010_multiturn, 020_streaming, temporal openai-agents tools/HIL, state_machine, and the other-SDKs base tutorial). Capping openai <2.45 in the agentex-sdk deps makes fresh resolves land on openai 2.44.0, which is compatible. Drop the ceiling once openai-agents ships a fix. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 619c9c2 commit 9a7b760

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

adk/pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ dependencies = [
4141
# LLM provider integrations
4242
"litellm>=1.83.7,<2",
4343
"openai-agents>=0.14.3,<0.15",
44-
"openai>=2.2,<3", # Required by openai-agents; litellm now supports openai 2.x (issue #13711 resolved: https://github.com/BerriAI/litellm/issues/13711)
44+
# Cap <2.45: openai 2.45.0 makes InputTokensDetails.cache_write_tokens a
45+
# required field, but openai-agents 0.14.x still builds
46+
# InputTokensDetails(cached_tokens=0) (agents/usage.py), so every
47+
# Runner.run_streamed raises a pydantic ValidationError at context setup.
48+
# openai-agents 0.14.8 is the latest release, so there is no newer version
49+
# to bump to; drop this ceiling once openai-agents ships a fix.
50+
# litellm now supports openai 2.x (issue #13711 resolved: https://github.com/BerriAI/litellm/issues/13711)
51+
"openai>=2.2,<2.45",
4552
"claude-agent-sdk>=0.1.0",
4653
"pydantic-ai-slim>=1.0,<2",
4754
"langgraph-checkpoint>=2.0.0",

uv.lock

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

0 commit comments

Comments
 (0)