non-verbose output: exhaust stream silently, yield content only; add plan_sop; subagent_sop cleanup

This commit is contained in:
Jiaqing Liang
2026-03-02 23:06:07 +08:00
parent d010ab1995
commit 5c3193f326
4 changed files with 28 additions and 3 deletions

View File

@@ -54,8 +54,12 @@ def agent_runner_loop(client, system_prompt, user_input, handler, tools_schema,
yield f"**LLM Running (Turn {turn+1}) ...**\n\n"
if (turn+1) % 10 == 0: client.last_tools = '' # 每10轮重置一次工具描述避免上下文过大导致的模型性能下降
response_gen = client.chat(messages=messages, tools=tools_schema)
response = yield from response_gen
if verbose: yield '\n\n'
if verbose:
response = yield from response_gen
yield '\n\n'
else:
response = exhaust(response_gen)
yield response.content
if not response.tool_calls:
tool_name, args = 'no_tool', {}