Revert "gemma4: fix nothink case renderer (#15553)" (#15556)

This reverts commit 4d75f5da03.
This commit is contained in:
Devon Rifkin
2026-04-13 13:12:18 -07:00
committed by GitHub
parent a99e5d9c22
commit 5dfac387a6

View File

@@ -40,7 +40,6 @@ func (r *Gemma4Renderer) Render(messages []api.Message, tools []api.Tool, thinkV
// Emit system turn if there's a system/developer role, tools, or thinking.
hasThink := thinkValue != nil && thinkValue.Bool()
thinkingExplicitlyDisabled := thinkValue != nil && thinkValue.IsBool() && !thinkValue.Bool()
if hasSystemRole || len(tools) > 0 || hasThink {
sb.WriteString("<|turn>system\n")
if hasThink {
@@ -125,7 +124,7 @@ func (r *Gemma4Renderer) Render(messages []api.Message, tools []api.Tool, thinkV
// Generation prompt.
if prevMessageType != "tool_response" && prevMessageType != "tool_call" {
sb.WriteString("<|turn>model\n")
if !hasThink && !thinkingExplicitlyDisabled {
if !hasThink {
sb.WriteString("<|channel>thought\n<channel|>")
}
}