Skip to content

thinking_config silently ignored in Runner.run_live() for streaming models #5805

Description

@smetanokr

Describe the Bug:

thinking_config set via Agent(generate_content_config=types.GenerateContentConfig(thinking_config=...)) is silently ignored for live/streaming models using Runner.run_live(). The ADK's Gemini.connect() (google_adk/models/google_llm.py) only forwards system_instruction and tools from llm_request.config (a GenerateContentConfig) to llm_request.live_connect_config (a LiveConnectConfig), even though LiveConnectConfig declares the same thinking_config field.

Steps to Reproduce:

  1. Create a live streaming agent with thinking_config set:
    agent = Agent(
        name="live_agent",
        model=SomeGeminiLiveModel(),
        instruction="You are a helpful assistant.",
        generate_content_config=types.GenerateContentConfig(
            thinking_config=types.ThinkingConfig(
                thinking_level=types.ThinkingLevel.LOW,
                include_thoughts=True,
            )
        ),
    )
  2. Run with Runner.run_live().
  3. Observe that the live model does not exhibit thinking behavior — no part.thought events are emitted.

Expected Behavior:

thinking_config set on the Agent's generate_content_config should be forwarded to the live connection so that the model uses thinking during streaming. The LiveConnectConfig class already supports the field — it just isn't populated by the framework.

Observed Behavior:

The thinking_config is correctly stored in llm_request.config.thinking_config (the GenerateContentConfig), but Gemini.connect() in google_llm.py only copies system_instruction and tools to llm_request.live_connect_config. The thinking_config field is never transferred, so it is silently dropped for all live/streaming sessions.

Environment Details:

  • ADK Library Version (pip show google-adk): google-adk==2.0.0
  • Desktop OS: Linux
  • Python Version (python -V): Python 3.14

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: gemini-3.1-flash-live-preview (any live-capable Gemini model)

🟡 Optional Information

Regression:
N/A — first time testing live thinking config.

Logs:

The relevant code path in google_adk/models/google_llm.py in the connect() method:

# Only these two fields are forwarded:
llm_request.live_connect_config.system_instruction = types.Content(...)
llm_request.live_connect_config.tools = llm_request.config.tools

# thinking_config is never copied across, despite LiveConnectConfig having the field.

Minimal Reproduction Code:

import os
from google.adk.agents import Agent, LiveRequestQueue, RunConfig
from google.adk.runners import Runner
from google.adk.sessions import InMemorySessionService
from google.genai import types

agent = Agent(
    name="live_agent",
    model=os.getenv("MODEL_LIVE"),
    instruction="You are a helpful assistant.",
    generate_content_config=types.GenerateContentConfig(
        thinking_config=types.ThinkingConfig(
            thinking_level=types.ThinkingLevel.LOW,
            include_thoughts=True,
        )
    ),
)

session_service = InMemorySessionService()
runner = Runner(
    agent=agent,
    app_name="test",
    session_service=session_service,
)

live_request_queue = LiveRequestQueue()

async def run():
    async for event in runner.run_live(
        user_id="user",
        session_id="session",
        live_request_queue=live_request_queue,
        run_config=RunConfig(
            output_audio_transcription=types.AudioTranscriptionConfig(),
            input_audio_transcription=types.AudioTranscriptionConfig(),
        ),
    ):
        # No part.thought events will appear despite thinking_config being set
        if event.content and event.content.parts:
            for part in event.content.parts:
                if part.thought:
                    print("THOUGHT:", part.text)

How often has this issue occurred?:

  • Always (100%)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

live[Component] This issue is related to live, voice and video chatrequest clarification[Status] The maintainer need clarification or more information from the author

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions