Skip to content

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

Closed

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

  1. added
    live[Component] This issue is related to live, voice and video chat
    on May 22, 2026
  2. added theissue type on May 22, 2026
  3. llalitkumarrr commented on May 25, 2026

    @llalitkumarrr
    Collaborator

    Hello @smetanokr ,

    Could you try configuring the thinking using planner and let us know if it works for you?

  4. added
    request clarification[Status] The maintainer need clarification or more information from the author
    on May 25, 2026
  5. adk-bot commented on Jun 1, 2026

    @adk-bot
    Collaborator

    This issue has been automatically marked as stale because it has not had recent activity for 7 days after a maintainer requested clarification. It will be closed if no further activity occurs within 7 days.

  6. added
    stale[Status] Issues which have been marked inactive since there is no user response
    on Jun 1, 2026
  7. smetanokr commented on Jun 7, 2026

    @smetanokr
    Author

    sorry for late response @llalitkumarrr !

    Verified fix via PR #5905. Using GenerateContentConfig(thinking_config=...) with a LiveGemini subclass now correctly forwards thinking_config into LiveConnectConfig before the websocket connection is established. The is not None guard in the PR preserves existing behavior when no thinking config is set. Tested with thinking_level and include_thoughts — both reach the API now.

  8. removed
    stale[Status] Issues which have been marked inactive since there is no user response
    on Jun 8, 2026
  9. added a commit that references this issue on Jun 18, 2026
    71d8c84
  10. added a commit that references this issue on Aug 11, 2026
    a5107f0
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