Skip to content

Commit 684abdb

Browse files
committed
fix: call _fix_tool_message_ordering for all anthropic models
1 parent 8dfac2a commit 684abdb

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():
273273
converted_messages = self._fix_tool_message_ordering(converted_messages)
274274

275275
if system_instructions:

0 commit comments

Comments
 (0)