lucianommartins commited on
Commit
f3667db
·
verified ·
1 Parent(s): 74cdce6

fix: scope preserve_thinking to tool-call turns only

Browse files
Files changed (1) hide show
  1. chat_template.jinja +1 -1
chat_template.jinja CHANGED
@@ -230,7 +230,7 @@
230
 
231
  {#- Render reasoning/reasoning_content as thinking channel -#}
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 -%}
 
230
 
231
  {#- Render reasoning/reasoning_content as thinking channel -#}
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 and message.get('tool_calls')) -%}
234
  {%- if thinking_text and thinking_gate -%}
235
  {{- '<|channel>thought\n' + thinking_text + '\n<channel|>' -}}
236
  {%- endif -%}