lucianommartins commited on
Commit
116c59c
·
verified ·
1 Parent(s): 89ef9a8

fix: render thinking channel regardless of tool_calls presence

Browse files

Remove message.get('tool_calls') guard from thinking channel
rendering. Reasoning on assistant messages without tool_calls
(e.g. final answer after a tool chain) was silently dropped
from conversation history.

Ref: https://github.com/vllm-project/vllm/pull/45553

Files changed (1) hide show
  1. chat_template.jinja +1 -1
chat_template.jinja CHANGED
@@ -231,7 +231,7 @@
231
  {#- Render reasoning/reasoning_content as thinking channel (tool-call turns only) -#}
232
  {%- set thinking_text = message.get('reasoning') or message.get('reasoning_content') -%}
233
  {%- set thinking_gate = (loop.index0 > ns_turn.last_user_idx) or preserve_thinking -%}
234
- {%- if thinking_text and thinking_gate and message.get('tool_calls') -%}
235
  {{- '<|channel>thought\n' + thinking_text + '\n<channel|>' -}}
236
  {%- endif -%}
237
 
 
231
  {#- Render reasoning/reasoning_content as thinking channel (tool-call turns only) -#}
232
  {%- set thinking_text = message.get('reasoning') or message.get('reasoning_content') -%}
233
  {%- set thinking_gate = (loop.index0 > ns_turn.last_user_idx) or preserve_thinking -%}
234
+ {%- if thinking_text and thinking_gate -%}
235
  {{- '<|channel>thought\n' + thinking_text + '\n<channel|>' -}}
236
  {%- endif -%}
237