fix: sanitize backticks in code_run output & simplify subagent turn header

This commit is contained in:
Liang Jiaqing committed 2026-04-29 18:26:16 +08:00
1 parent d626c9f02c
commit 6a3eecc07e
2 files changed
+5 -2

No files matched your search

+4 -2
View File
@@ -46,8 +46,10 @@ def agent_runner_loop(client, system_prompt, user_input, handler, tools_schema,
]
turn = 0; handler.max_turns = max_turns
while turn < handler.max_turns:
turn += 1; md = '**' if verbose else ''
yield f"{md}LLM Running (Turn {turn}) ...{md}\n\n"
turn += 1; turnstr = f'LLM Running (Turn {turn}) ...'
if handler.parent.task_dir: turnstr = f'Turn {turn} ...'
if verbose: turnstr = f'**{turnstr}**'
yield f"\n\n{turnstr}\n\n"
if turn%10 == 0: client.last_tools = '' # 每10轮重置一次工具描述,避免上下文过大导致的模型性能下降
response_gen = client.chat(messages=messages, tools=tools_schema)
if verbose: