From 929ee094995f716bfa9cff6d69cdd5b1bd6dd7d9 Mon Sep 17 00:00:00 2001 From: 04cb <0x04cb@gmail.com> Date: Tue, 31 Mar 2026 08:53:44 +0800 Subject: [PATCH] fix(utils): ensure reasoning_content present with thinking_blocks (#2579) --- nanobot/utils/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nanobot/utils/helpers.py b/nanobot/utils/helpers.py index a10a4f18b..a7c2c2574 100644 --- a/nanobot/utils/helpers.py +++ b/nanobot/utils/helpers.py @@ -124,8 +124,8 @@ def build_assistant_message( msg: dict[str, Any] = {"role": "assistant", "content": content} if tool_calls: msg["tool_calls"] = tool_calls - if reasoning_content is not None: - msg["reasoning_content"] = reasoning_content + if reasoning_content is not None or thinking_blocks: + msg["reasoning_content"] = reasoning_content if reasoning_content is not None else "" if thinking_blocks: msg["thinking_blocks"] = thinking_blocks return msg