Repository navigation
thinking_config silently ignored in Runner.run_live() for streaming models #5805
Description
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:
- Create a live streaming agent with
thinking_configset: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, ) ), )
- Run with
Runner.run_live(). - Observe that the live model does not exhibit thinking behavior — no
part.thoughtevents 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
llalitkumarrr commentedon May 25, 2026
Hello @smetanokr ,
Could you try configuring the thinking using planner and let us know if it works for you?
adk-bot commentedon Jun 1, 2026
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.
smetanokr commentedon Jun 7, 2026
sorry for late response @llalitkumarrr !
Verified fix via PR #5905. Using
GenerateContentConfig(thinking_config=...)with aLiveGeminisubclass now correctly forwardsthinking_configintoLiveConnectConfigbefore the websocket connection is established. Theis not Noneguard in the PR preserves existing behavior when no thinking config is set. Tested withthinking_levelandinclude_thoughts— both reach the API now.fix(live): forward thinking config
fix(live): forward thinking config