fix(agents): support parallel tool calls and improve recovery prompt#945
fix(agents): support parallel tool calls and improve recovery prompt#945theonlychant wants to merge 4 commits into
Conversation
|
@claude review this PR. |
PR reviewThanks for tackling #944 — the underlying problem (silent failures on multi- 🟡 Code/description mismatchThe PR description says the fix uses "a per-instance queue ( 🟡 Large duplicated execution block
🟡 Dead
|
…ation Signed-off-by: theonlychant <[email protected]>
|
@claude review this PR |
… calls Signed-off-by: theonlychant <[email protected]>
|
I fixed the unit-tests and lint errors here you can tell me if you like the changes here or I need to close this PR @kovtcharov |
|
@theonlychant — thanks for jumping on #944 quickly; the underlying problem was real and you got a working fix into a PR within hours, which is genuinely useful. To answer your question on #946: yes, closing this one is the right call. #946 is the more comprehensive landing and is already approved, so duplicate review attention here just adds noise. A few things #946 covers that this PR doesn't, for context (not asks):
Please go ahead and close this one. Thanks again for taking a swing — the bug report on #944 itself was thorough enough to make both PRs possible in the same window. |
Summary
Adds support for parallel
tool_callsinAgent._parse_responseusinga per-instance queue (Option A from #944), and makes the recovery prompt
context-aware for parallel-call failures vs malformed argument failures.
Why
Tool-calling models like Gemma-4-E4B-it-GGUF (GAIA's default since #865)
routinely emit multiple
tool_callsin a single response for multi-intentinputs. The previous code raised
NotImplementedErroron any response withmore than one tool call, causing all tools to fail silently after three
retries. This fix dispatches parallel calls sequentially without requiring
an extra LLM round-trip per call.
Linked issue
Closes #944
Changes
_parse_responsenow queues extra tool calls in_pending_tool_callsinstead of raising
NotImplementedErrorprocess_querydrains the queue before re-prompting the LLMdifferent message than malformed argument failures
one error, and a parallel-then-conversational turn
Test plan
pytest tests/unit/- all passing locallypython util/lint.py --all- no failuresall tool calls fire
Checklist
Closes #944).