From 61f658e04519ea7e711e6be707765bfd8ee9257d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20S=C3=A1nchez=20Vall=C3=A9s?= Date: Wed, 4 Mar 2026 12:11:18 +0100 Subject: [PATCH] add reasoning content to on progress message --- nanobot/agent/loop.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nanobot/agent/loop.py b/nanobot/agent/loop.py index 65a62e5..5eea6e6 100644 --- a/nanobot/agent/loop.py +++ b/nanobot/agent/loop.py @@ -202,9 +202,16 @@ class AgentLoop: if response.has_tool_calls: if on_progress: - clean = self._strip_think(response.content) - if clean: - await on_progress(clean) + thoughts = [ + self._strip_think(response.content), + response.reasoning_content, + *(f"Thinking [{b.get('signature', '...')}]:\n{b.get('thought', '...')}" + for b in (response.thinking_blocks or []) if isinstance(b, dict) and "signature" in b) + ] + + if combined := "\n\n".join(filter(None, thoughts)): + await on_progress(combined) + await on_progress(self._tool_hint(response.tool_calls), tool_hint=True) tool_call_dicts = [