fix: don't count unknown tool calls toward tool_call_count

This commit is contained in:
ymq 2026-08-10 17:58:42 +08:00
parent 91dabd7b4c
commit 92af7603e0

View File

@ -185,7 +185,8 @@ class AgentExecutor:
}, ensure_ascii=False) + "\n"
result = await self._execute_tool(tool_name, tool_params)
self._tool_call_count += 1
if not result.startswith("未知工具"):
self._tool_call_count += 1
yield json.dumps({
"type": "tool_result", "tool": tool_name,