Skip to content

[BUG] Anthropic models emitting thinking blocks (Claude Sonnet 5 by default) fail all requests: google-adk 1.31.1 lock predates ThinkingBlock support #2136

Description

@Prefix

📋 Prerequisites

  • I have searched the existing issues to avoid creating a duplicate (checked content_block_to_part, anthropic_llm, ThinkingBlock, adaptive thinking, google-adk, claude-sonnet-5)
  • By submitting this issue, I agree to follow the Code of Conduct
  • I am using the latest version of the software (0.9.9; also verified the lockfile on main)
  • I can consistently reproduce this issue

🎯 Affected Service(s)

App Service (python runtime / kagent-adk agent pods)

🚦 Impact/Severity

Blocker (for any Agent configured with an Anthropic model that emits thinking blocks; Claude Sonnet 5 does so by default)

🐛 Bug Description

Python-runtime Declarative Agents fail every request with NotImplementedError: Not supported yet. when the configured Anthropic model returns thinking content blocks. Claude Sonnet 5 runs adaptive thinking by default, so pointing an Agent at it makes the agent unusable out of the box.

Root cause is the pinned google-adk version, not kagent code. python/uv.lock resolves google-adk 1.31.1, whose content_block_to_part() only handles text and tool_use blocks. ThinkingBlock and RedactedThinkingBlock support was added upstream in google-adk 1.32.0 (commit google/adk-python@16952bd3, "feat: Add support for Anthropic's thinking blocks" - see the fixed content_block_to_part). The dependency spec in python/packages/kagent-adk/pyproject.toml (google-adk>=1.28.1,<2) already allows the fixed versions; only the lock is behind.

🔄 Steps To Reproduce

  1. Create a Declarative Agent (python runtime) with a provider: Anthropic ModelConfig pointing at Claude Sonnet 5.
  2. Send an investigation-style A2A message (note: trivial one-liners may not trigger adaptive thinking and can appear to work; prompts with a system prompt plus a task like "investigate X" reliably produce a thinking block).
  3. Observe the task fail immediately.

🤔 Expected Behavior

The agent handles the thinking content block (or at minimum degrades gracefully) and returns its answer.

📱 Actual Behavior

A2A task completes within seconds in state failed with message "Not supported yet." and no artifacts. Every request against the model fails the same way.

💻 Environment

  • Application version: kagent 0.9.9 (helm chart 0.9.9), python runtime
  • python/uv.lock google-adk: 1.31.1 (same on main as of 2026-07-02)
  • Kubernetes: EKS, v1.32
  • Model: Claude Sonnet 5 via an Anthropic-schema ModelConfig (any thinking-emitting Anthropic model reproduces)

🔍 Additional Context

  • Worked before with Claude Sonnet 4.6 (does not emit thinking blocks unless requested); started failing immediately on switching the ModelConfig to Sonnet 5.
  • Dependabot proposed exactly the needed bump in chore(deps): bump the python-google-ai group in /python with 2 updates #1832 (google-adk 1.31.1 -> 1.33.0) but the PR was auto-closed after a dependencies label configuration error ("Looks like these dependencies are updatable in another way"), and no replacement update was opened, so the bump silently fell through.
  • Workaround we run today: suppress thinking before the request reaches the model (inject {"thinking": {"type": "disabled"}} at a gateway in front of the provider; Sonnet 5 accepts explicit disabled). Works, but forfeits reasoning quality, so a lock bump is much preferable.

📋 Logs

kagent_adk.kagent.adk._agent_executor - ERROR - Error handling A2A request: Not supported yet.
  File "/.kagent/packages/kagent-adk/src/kagent/adk/_agent_executor.py", line 599, in _handle_request
  File ".../google/adk/runners.py", line 632, in run_async
  File ".../google/adk/flows/llm_flows/base_llm_flow.py", line 1261, in _call_llm_async
  File ".../google/adk/models/anthropic_llm.py", line 414, in generate_content_async
  File ".../google/adk/models/anthropic_llm.py", line 247, in message_to_generate_content_response
  File ".../google/adk/models/anthropic_llm.py", line 232, in content_block_to_part
    raise NotImplementedError("Not supported yet.")

🔧 CLI Bug Report

Not attached: the kagent bug-report output would include internals of our production cluster. The root cause is already isolated to google/adk/models/anthropic_llm.py:232 with the full traceback above; happy to provide specific redacted details on request.

📷 Screenshots

N/A (API-level failure, full traceback in Logs).

🙋 Are you willing to contribute?

  • I am willing to submit a PR to fix this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions