fix: make rounds_since_todo a local variable

This commit is contained in:
ggttyy1
2026-07-11 19:47:55 +08:00
parent 4faf3e4c52
commit ffe1fef0b5
3 changed files with 3 additions and 12 deletions

View File

@@ -356,11 +356,8 @@ register_hook("Stop", summary_hook)
# agent_loop — same as s05-s06 + nag reminder
# ═══════════════════════════════════════════════════════════
rounds_since_todo = 0
def agent_loop(messages: list):
global rounds_since_todo
rounds_since_todo = 0 # 每轮新对话从0开始计数
rounds_since_todo = 0
while True:
if rounds_since_todo >= 3 and messages:
messages.append({"role": "user",