From 58b2e896423ffb255fa8b3a2c6b283dd99d7dbad Mon Sep 17 00:00:00 2001 From: Luciano Martins <22145370+lucianommartins@users.noreply.github.com> Date: Wed, 17 Jun 2026 17:44:15 -0300 Subject: [PATCH] [Bugfix][Gemma4] Render reasoning on assistant turns without tool_calls (#45867) Signed-off-by: Luciano Martins Co-authored-by: Luciano Martins --- examples/tool_chat_template_gemma4.jinja | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/tool_chat_template_gemma4.jinja b/examples/tool_chat_template_gemma4.jinja index 9d603aa0b06..6ce01e6479a 100644 --- a/examples/tool_chat_template_gemma4.jinja +++ b/examples/tool_chat_template_gemma4.jinja @@ -231,10 +231,10 @@ {%- endif -%} {%- endif -%} - {#- Render reasoning/reasoning_content as thinking channel (tool-call turns only) -#} + {#- Render reasoning/reasoning_content as thinking channel -#} {%- set thinking_text = message.get('reasoning') or message.get('reasoning_content') -%} {%- set thinking_gate = (loop.index0 > ns_turn.last_user_idx) or preserve_thinking -%} - {%- if thinking_text and thinking_gate and message.get('tool_calls') -%} + {%- if thinking_text and thinking_gate -%} {{- '<|channel>thought\n' + thinking_text + '\n' -}} {%- endif -%}