Skip to content

Runner.runAsync terminates prematurely after tool execution with Gemini 3 Flash (gemini-3-flash-preview) #48

@victorbash400

Description

@victorbash400

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.

Image

(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.

Image

(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

  1. Initialize LlmAgent with model: 'gemini-3-flash-preview'
  2. Enable thinkingConfig
  3. Give a prompt that requires a tool call (e.g., "list files in this directory")
  4. Observe that the Runner.runAsync generator 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions