---
type: email
from: Sung-jin Brian Hong <notifications@github.com>
subject: [openai/openai-agents-python] fix(chatcmpl): preserve text content

 when adding Anthropic thinking blocks to tool calls (PR #1784)
received: 2026-03-06 07:41:04
date_header: Mon, 22 Sep 2025 04:18:50 -0700
priority: normal
status: awaiting_approval
uid: 31023
---

## Email Content

**From:** Sung-jin Brian Hong <notifications@github.com>
**Subject:** [openai/openai-agents-python] fix(chatcmpl): preserve text content

 when adding Anthropic thinking blocks to tool calls (PR #1784)
**Date:** Mon, 22 Sep 2025 04:18:50 -0700

### Body (preview)

In the case of Anthropic Claude with extended thinking, this ensures that existing text content is properly converted to content array format before appending thinking blocks, preventing overwriting of original assistant message content.



This happens in a rare case where there is a (output text, thinking block, tool call) all in one response. Error message is like below:



```

litellm.BadRequestError: BedrockException - {&quot;message&quot;:&quot;The model returned the following errors: messages.1.content.49: `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.&quot;}

```



The error is misleading because the actual reason is because we didn&#39;t provide the text content along side the thinking blocks.



This rarely happens. But in our agent evaluation suite, this happens when doing agents handoffs to a reflection style agent.

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



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



-- Commit Summary --



  * fix(chatcmpl): preserve text content when adding Anthropic thinking blocks to tool calls



-- File Changes --



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

    M tests/test_anthropic_thinking_blocks.py (17)



-- Patch Links --



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

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



-- 

Reply to this email directly or view it on GitHub:

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

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



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

---

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