extract-tool-call-returns-first-match

IN premise

When LLM output contains multiple JSON objects with a `"tool"` key, `extract_tool_call()` returns only the first valid match and ignores the rest; malformed JSON lines are silently skipped.

Summary

The tool call extraction logic is greedy — it stops after finding the first valid tool invocation in the model's output and discards any subsequent ones. This means if a model response contains multiple tool calls, only the first will be executed, and any parsing failures along the way produce no errors or warnings.

Details

Sourceentries/2026/04/29/tests-test_ask.md