Skip to content

[Bug]: thinking.display="summarized" not set for Claude Opus 4.7, causing silent loss of reasoning content #25965

Description

@minimAluminiumalism

Summary

Claude Opus 4.7 (released 2026-04-16) introduced a silent breaking change: thinking content is omitted by default. Callers must explicitly set thinking.display = "summarized" to restore the visible reasoning summary that was the default on Opus 4.6.

LiteLLM _map_reasoning_effort() in litellm/llms/anthropic/chat/transformation.py builds the thinking dict for Claude 4.6+ models but does not set the display field. Result: any litellm.completion(model="claude-opus-4-7", reasoning_effort=...) returns HTTP 200, charges thinking tokens, ships an empty thinking_blocks[].thinking field, and reasoning_content == "". No error is raised. Existing 4.6 code that relies on reasoning_content silently degrades after switching to 4.7.

Reproduction

litellm @ HEAD (f69b9d6, 2026-04-17), vertex_ai/claude-opus-4-7, locations/global endpoint:

import litellm

resp = litellm.completion(
    model="vertex_ai/claude-opus-4-7",
    vertex_credentials="<sa.json>",
    vertex_project="<project>",
    vertex_location="global",
    messages=[{"role": "user", "content": "<any prompt that needs reasoning>"}],
    max_tokens=4096,
    reasoning_effort="max",   # also requires #25958 patch to not raise
)
msg = resp.choices[0].message
print(repr(getattr(msg, "reasoning_content", None)))
print(msg.thinking_blocks)

Actual:

""
[{"type": "thinking", "thinking": "", "signature": "<1992 bytes>"}]

Expected: reasoning_content contains the human-readable summary.

Direct curl to Vertex AI confirms upstream returns the summary when display: "summarized" is explicitly set.

Root cause

litellm/llms/anthropic/chat/transformation.py:

if AnthropicConfig._is_claude_4_6_model(model) or AnthropicConfig._is_claude_4_7_model(model):
    return AnthropicThinkingParam(
        type="adaptive",
        # missing: display="summarized"
    )

AnthropicThinkingParam TypedDict in litellm/types/llms/anthropic.py is also missing the display field.

Suggested fix

  1. Add display: NotRequired[Literal["omitted", "summarized"]] to AnthropicThinkingParam.
  2. In _map_reasoning_effort for the 4.6/4.7 branch, set display="summarized" to preserve pre-4.7 behavior.
  3. Optionally allow opting out via a litellm setting for users that prefer the new omitted default for latency.

References

Environment

  • LiteLLM: main @ f69b9d6 (also reproducible on PyPI 1.83.9)
  • Provider: vertex_ai (the anthropic direct path is also affected; verified via transform_request unit-level inspection)
  • Model: claude-opus-4-7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions