Each iteration of the tool-calling loop was appending the assistant's tool_use blocks to conversationMessages but not the corresponding tool_result blocks. On the next iteration, Claude saw orphaned tool_use IDs without matching tool_results, causing a 400 error. Now tool_result blocks are appended directly to conversationMessages after each iteration, so the full conversation is always well-formed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| app | ||
| components | ||
| hooks | ||
| lib | ||
| stores | ||
| types | ||
| middleware.ts | ||