Files
crewAI/lib
Devin AI b125e572c4 fix(bedrock): group consecutive tool results into single user message
When a Bedrock model makes multiple parallel tool calls, the Converse API
requires all toolResult blocks to be sent in a single user message.
Previously each tool result created a separate user message, causing a
ValidationException.

This fix detects consecutive tool result messages and appends them to
the same user message, producing the expected structure:
  Message 0: user (prompt)
  Message 1: assistant (toolUse A, toolUse B)
  Message 2: user (toolResult A, toolResult B)  ← grouped

Fixes #4749

Co-Authored-By: João <joao@crewai.com>
2026-03-06 15:47:36 +00:00
..