Fixing Bedrock ToolResult Ordering Errors
A tool executed successfully, but Bedrock rejected the next message because toolResult IDs did not match the preceding toolUse order. INC-004 is easy to create when tools run in parallel. Async completion order is not protocol order, and checkpoint restore or middleware can shuffle result blocks. The fix is to derive result order from the assistant's toolUseId sequence, fill missing results with…
We haven't written up this one. Dev.to has the full story — the link below goes straight to it.