chore: minor tweaks - fix newline replace scope, relax turn limits, wording

This commit is contained in:
Liang Jiaqing
2026-02-22 23:59:16 +08:00
parent 2b4ac28c7e
commit d7608a01f3
4 changed files with 5 additions and 5 deletions

View File

@@ -85,9 +85,9 @@ def agent_runner_loop(client, system_prompt, user_input, handler, tools_schema,
datastr = json.dumps(outcome.data, ensure_ascii=False, default=json_default) if type(outcome.data) in [dict, list] else str(outcome.data)
next_prompt += f"<tool_result>\n{datastr}\n</tool_result>\n\n"
next_prompt += outcome.next_prompt
if (turn+1) % 5 == 0:
if (turn+1) % 7 == 0:
next_prompt += f"\n\n[DANGER] 已连续执行第 {turn+1} 轮。禁止无效重试。若无有效进展必须切换策略1. 探测物理边界 2. 请求用户协助。"
if (turn+1) % 25 == 0:
if (turn+1) % 30 == 0:
next_prompt += f"\n\n### [DANGER] 已连续执行第 {turn+1} 轮。你必须总结情况进行ask_user不允许继续重试。"
messages = [{"role": "user", "content": next_prompt}]
return {'result': 'MAX_TURNS_EXCEEDED'}