Skip to content

Thinking tokens are not attached in between turns to Claude with extended thinking #2195

@willkoh

Description

@willkoh

Please read this first

  • Have you read the custom model provider docs, including the 'Common issues' section? Model provider docs Yes
  • Have you searched for related issues? Others may have faced similar issues. Yes

Describe the question

Although preserve_thinking_tokens is a param for Converter.items_to_messages, it doesn't attach the thinking tokens unless there was a tool call.

I have a fix for this in a local branch with tests but I don't have permission to push the branch up.

Debug information

  • Agents SDK version: v0.6.3
  • Python version: 3.12

Repro steps

Enable thinking for Anthropic models using LitellmModel.

Expected behavior

Thinking tokens are attached to the assistant message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions