v1.4.3
Bug Fix: Always Add tool_results After tool_use
Removes the if (! empty($toolResults)) guard that could skip adding a tool_result message after the assistant's tool_use blocks. The Anthropic API requires every tool_use block to have a corresponding tool_result in the immediately following user message — skipping it leaves the conversation in an invalid state.
Changes
- ReactLoop — always add tool_results message
- ReflectionLoop — same fix in both
generate()andrefine()methods - PlanExecuteLoop — same fix in
executeStep() - StreamingLoop — same fix