From 84268edf017c927a55b95f9e22cf223c5b79cdf3 Mon Sep 17 00:00:00 2001 From: wylab Date: Sat, 14 Feb 2026 18:45:35 +0100 Subject: [PATCH] Fix memory consolidation truncation: set max_tokens=16384 Consolidation was failing because max_tokens defaulted to 4096, causing Haiku's response to be truncated mid-JSON (finish_reason=max_tokens). Co-Authored-By: Claude Opus 4.6 --- nanobot/agent/loop.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nanobot/agent/loop.py b/nanobot/agent/loop.py index 6cecd46..0edc619 100644 --- a/nanobot/agent/loop.py +++ b/nanobot/agent/loop.py @@ -426,6 +426,7 @@ Respond with ONLY valid JSON, no markdown fences.""" ], model="claude-haiku-4-5", thinking_budget=0, + max_tokens=16384, ) text = (response.content or "").strip() if text.startswith("```"):