mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-04-30 23:05:51 +00:00
Fix assistant messages without tool calls not being saved to session
This commit is contained in:
parent
9e806d7159
commit
f2e0847d64
@ -225,7 +225,16 @@ class AgentLoop:
|
|||||||
messages, tool_call.id, tool_call.name, result
|
messages, tool_call.id, tool_call.name, result
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
final_content = self._strip_think(response.content)
|
clean = self._strip_think(response.content)
|
||||||
|
if on_progress and clean:
|
||||||
|
await on_progress(clean)
|
||||||
|
messages = self.context.add_assistant_message(
|
||||||
|
messages,
|
||||||
|
clean,
|
||||||
|
tool_calls=None,
|
||||||
|
reasoning_content=response.reasoning_content,
|
||||||
|
)
|
||||||
|
final_content = clean
|
||||||
break
|
break
|
||||||
|
|
||||||
if final_content is None and iteration >= self.max_iterations:
|
if final_content is None and iteration >= self.max_iterations:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user