-
Notifications
You must be signed in to change notification settings - Fork 63
Description
Bug Report: Runner.runAsync terminates prematurely after tool execution with gemini-3-flash-preview
Environment
- Operating System: macOS Tahoe 26.2
- Library:
@google/adk(Version 0.2.1) - Node.js: >= 20.0.0
- google/genai version 1.32.0.
Description
When using gemini-3-flash-preview with the ADK Runner framework, the agent triggers a tool call (e.g., ls or read_file), and the Runner successfully executes the tool and injects the response. However, instead of performing a follow-up synthesis turn to process these results and respond to the user, the Gemini 3 Flash stream terminates immediately with finishReason: 'STOP'.
Comparison & Evidence
1. Gemini 3 Flash (Failure Case)
The model calls the tool, receives the output, and then the stream simply ends. No synthesis text is ever generated.
(Note: Screenshot shows the log ending with run_complete immediately after function_response without any following text content.)
2. Gemini 2.5 Flash (Success Case)
The model correctly continues the conversation after the tool result is injected, providing a summary of what it found.
(Note: Screenshot shows the model continuing with a text response after the tool completes.)
Observed Logs (Simplified)
// Gemini 3 Flash Log Trace
[stream] function_call ['ls']
[stream] tool_output received (403 chars)
[stream] event { hasContent: true, fc: [], fr: [], finishReason: 'STOP' }
// ^ Model stops here instead of generating text describing the files.
[stream] run_complete { aborted: false, hasResponse: true, finishReason: 'STOP' }Steps to Reproduce
- Initialize
LlmAgentwithmodel: 'gemini-3-flash-preview' - Enable
thinkingConfig - Give a prompt that requires a tool call (e.g., "list files in this directory")
- Observe that the
Runner.runAsyncgenerator closes immediately after the function response is yielded, before any synthesis text is produced
Expected Behavior
The Runner should ensure that a follow-up turn is executed to allow the model to summarize or act upon the tool output, matching the behavior seen in gemini-2.5-flash.