Files
AutoGPT/autogpt_platform/backend
Zamil Majdy 604165fdc6 fix(copilot): merge split assistant messages to prevent Anthropic API errors
Long-running tool flows created two consecutive assistant messages (one
with text, one with tool_calls), causing Anthropic's API to reject the
request with "unexpected tool_use_id found in tool_result blocks".

- Add defensive merge of consecutive assistant messages in to_openai_messages()
- Fix _yield_tool_call to add tool_calls to existing assistant instead of creating new one
- Use extend instead of assign for accumulated_tool_calls to prevent overwrites
2026-02-11 16:10:05 +04:00
..