Files
g3/crates/g3-core
Dhanji R. Prasanna 58cbf3431a Fix auto-continue bug: don't mark tool calls consumed prematurely
The bug: When the LLM emitted multiple tool calls in one response (e.g.,
str_replace followed by shell), only the first tool was executed. The
remaining tools were lost because mark_tool_calls_consumed() was called
BEFORE processing, marking ALL tools as consumed even when only ONE was
being processed.

This caused has_unexecuted_tool_call() to return false after executing
the first tool, so the parser was reset and the remaining tool calls
were discarded. The auto-continue logic never triggered because it
thought all tools had been handled.

The fix: Remove the premature mark_tool_calls_consumed() call. The
existing logic at line 4696-4699 already handles marking tools as
consumed AFTER execution, and correctly checks for remaining unexecuted
tools before deciding whether to reset the parser.
2025-12-22 16:24:11 +11:00
..
2025-11-27 21:00:02 +11:00