fix: AI loop prevention (no tools on last iteration), calendar button first, mail filter in toolbar, AI folder rename query invalidation
Check Cross-Plugin Imports / check (push) Has been cancelled

This commit is contained in:
Agent Zero
2026-07-30 11:33:45 +02:00
parent 124846ae3b
commit acea622a0f
4 changed files with 73 additions and 49 deletions
@@ -451,9 +451,12 @@ async def stream_chat(
# Agent loop: LLM → tool calls → execute → feed back → repeat
max_iterations = 5
for iteration in range(max_iterations):
# Add tools to params if available
if tool_schemas:
# Add tools to params if available, but NOT on the last iteration
# to force the LLM to give a final answer instead of looping
if tool_schemas and iteration < max_iterations - 1:
params["tools"] = tool_schemas
elif "tools" in params:
del params["tools"]
# Stream LLM response
collected_content = ""