From 6445b3b0cfb6fc03cdb0ef19a33e4b7a2a0ddc2d Mon Sep 17 00:00:00 2001 From: Alfredo Arenas Date: Thu, 2 Apr 2026 09:03:19 -0600 Subject: [PATCH] fix(helpers): repair corrupted split_message and ensure content never None Fix accidental line corruption in split_message() where 'break' was merged with unrelated code during manual editing. The actual fix: build_assistant_message() now returns content or "" instead of content (which could be None), preventing providers like MiMo V2 Omni from rejecting tool-call messages with missing text field. Fixes #2519 --- nanobot/utils/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nanobot/utils/helpers.py b/nanobot/utils/helpers.py index 86dc205e4..1f14cb36e 100644 --- a/nanobot/utils/helpers.py +++ b/nanobot/utils/helpers.py @@ -252,7 +252,7 @@ def split_message(content: str, max_len: int = 2000) -> list[str]: while content: if len(content) <= max_len: chunks.append(content) - breakmsg: dict[str, Any] = {"role": "assistant", "content": content} + break cut = content[:max_len] # Try to break at newline first, then space, then hard break pos = cut.rfind('\n')