---
type: email
from: Sung-jin Brian Hong <notifications@github.com>
subject: [openai/openai-agents-python] feat: Support Anthropic extended

 thinking and interleaved thinking (PR #1744)
received: 2026-03-06 07:34:47
date_header: Mon, 15 Sep 2025 04:21:04 -0700
priority: normal
status: awaiting_approval
uid: 30434
---

## Email Content

**From:** Sung-jin Brian Hong <notifications@github.com>
**Subject:** [openai/openai-agents-python] feat: Support Anthropic extended

 thinking and interleaved thinking (PR #1744)
**Date:** Mon, 15 Sep 2025 04:21:04 -0700

### Body (preview)

Anthropic&#39;s API requires thinking blocks to be the first content in assistant messages when reasoning is enabled and tool calls are present.

ref: https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking



This change:

- Stores thinking text in ResponseReasoningItem.content field

- Stores signature in encrypted_content field for metadata

- Reconstructs thinking blocks when converting items-&gt;messages

- Handles both streaming and non-streaming cases

- Only affects Anthropic models with reasoning enabled

- Adds regression test to prevent future breakage



Fixes compatibility with Claude models when using tools with interleaved thinking.



This fixes #765 and #678 

You can view, comment on, or merge this pull request online at:



  https://github.com/openai/openai-agents-python/pull/1744



-- Commit Summary --



  * feat: Support Anthropic extended thinking and interleaved thinking



-- File Changes --



    M src/agents/models/chatcmpl_converter.py (71)

    M src/agents/models/chatcmpl_stream_handler.py (30)

    M tests/test_anthropic_thinking_blocks.py (117)



-- Patch Links --



https://github.com/openai/openai-agents-python/pull/1744.patch

https://github.com/openai/openai-agents-python/pull/1744.diff



-- 

Reply to this email directly or view it on GitHub:

https://github.com/openai/openai-agents-python/pull/1744

You are receiving this because you are subscribed to this thread.



Message ID: &lt;openai/openai-agents-python/pull/1744@github.com&gt;

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
