Skip to content

Your lightweight open-source personal agent.

Merge remote-tracking branch 'origin/main' into pr-1874

Re-bin9fc74bde9ac2
diff --cc nanobot/agent/subagent.py
index 0049f9a23,21b8b32da..eb3b3b056
--- a/nanobot/agent/subagent.py
+++ b/nanobot/agent/subagent.py
@@@ -130,19 -125,23 +125,16 @@@ class SubagentManager
)
if response.has_tool_calls:
- # Add assistant message with tool calls
tool_call_dicts = [
- {
- "id": tc.id,
- "type": "function",
- "function": {
- "name": tc.name,
- "arguments": json.dumps(tc.arguments, ensure_ascii=False),
- },
- }
+ tc.to_openai_tool_call()
for tc in response.tool_calls
]
- messages.append({
- "role": "assistant",
- "content": response.content or "",
- "tool_calls": tool_call_dicts,
- })
+ messages.append(build_assistant_message(
+ response.content or "",
+ tool_calls=tool_call_dicts,
+ reasoning_content=response.reasoning_content,
+ thinking_blocks=response.thinking_blocks,
+ ))
# Execute tools
for tool_call in response.tool_calls: