Skip to content

Commit cf1b933

Browse files
authored
Fix: call _fix_tool_message_ordering for all Anthropic models (openai#1936)
1 parent 8dfac2a commit cf1b933

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/agents/extensions/models/litellm_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ async def _fetch_response(
269269
)
270270

271271
# Fix for interleaved thinking bug: reorder messages to ensure tool_use comes before tool_result # noqa: E501
272-
if preserve_thinking_blocks:
272+
if 'anthropic' in self.model.lower() or 'claude' in self.model.lower():
273273
converted_messages = self._fix_tool_message_ordering(converted_messages)
274274

275275
if system_instructions:

0 commit comments

Comments
 (0)