From 29e0a5d2673acfe0d2d9b721efcdbb5f1870e4e7 Mon Sep 17 00:00:00 2001 From: Abhijit Bhattacharjee Date: Tue, 17 Feb 2026 20:22:52 -0800 Subject: [PATCH] common : fix gpt-oss Jinja error when assistant message has both content and thinking with tool calls Erase `content` from the adjusted message after copying `reasoning_content` to `thinking`, so the gpt-oss template does not see both fields on tool-call messages. Regression from #16937. Fixes #19701 Co-Authored-By: Claude Opus 4.6 --- common/chat.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/common/chat.cpp b/common/chat.cpp index 47a34d58228f..b1f531e898bf 100644 --- a/common/chat.cpp +++ b/common/chat.cpp @@ -2032,6 +2032,7 @@ static common_chat_params common_chat_params_init_gpt_oss(const common_chat_temp if (has_reasoning_content && has_tool_calls) { auto adjusted_message = msg; adjusted_message["thinking"] = msg.at("reasoning_content"); + adjusted_message.erase("content"); adjusted_messages.push_back(adjusted_message); } else { adjusted_messages.push_back(msg);