From 48036d01e318c16bda3974e7cf32287f6c41d78c Mon Sep 17 00:00:00 2001 From: "Dhanji R. Prasanna" Date: Wed, 7 Jan 2026 10:37:30 +1100 Subject: [PATCH] fix(g3-core): disable auto-continue in interactive mode Auto-continue was incorrectly triggering when the LLM asked questions in interactive/chat mode. Now auto-continue only activates when is_autonomous is true, allowing proper back-and-forth conversation in interactive mode. Agent: fowler --- crates/g3-core/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/g3-core/src/lib.rs b/crates/g3-core/src/lib.rs index e3b87c3..7ca10e7 100644 --- a/crates/g3-core/src/lib.rs +++ b/crates/g3-core/src/lib.rs @@ -2658,9 +2658,11 @@ impl Agent { // This ensures we don't return control when the LLM clearly intended to call a tool // Note: We removed the redundant condition (any_tool_executed && is_empty_response) // because it's already covered by (any_tool_executed && !final_output_called) - let should_auto_continue = (any_tool_executed && !final_output_called) + // Auto-continue is only enabled in autonomous mode - in interactive mode, + // the user may be asking questions and we should return control to them + let should_auto_continue = self.is_autonomous && ((any_tool_executed && !final_output_called) || has_incomplete_tool_call - || has_unexecuted_tool_call; + || has_unexecuted_tool_call); if should_auto_continue { if auto_summary_attempts < MAX_AUTO_SUMMARY_ATTEMPTS { auto_summary_attempts += 1;