Merge pull request #461 from ggttyy1/fix/rounds-since-todo

fix: reset rounds_since_todo on each session
This commit is contained in:
Yang Haoran
2026-07-28 21:57:01 +08:00
committed by GitHub
3 changed files with 3 additions and 9 deletions

View File

@@ -232,10 +232,8 @@ register_hook("Stop", summary_hook)
# agent_loop — same as s04 + nag reminder counter # agent_loop — same as s04 + nag reminder counter
# ═══════════════════════════════════════════════════════════ # ═══════════════════════════════════════════════════════════
rounds_since_todo = 0
def agent_loop(messages: list): def agent_loop(messages: list):
global rounds_since_todo rounds_since_todo = 0
while True: while True:
# s05: nag reminder — inject if model hasn't updated todos for 3 rounds # s05: nag reminder — inject if model hasn't updated todos for 3 rounds
if rounds_since_todo >= 3 and messages: if rounds_since_todo >= 3 and messages:

View File

@@ -312,10 +312,8 @@ register_hook("Stop", summary_hook)
# agent_loop — same as s05 + nag reminder, task auto-dispatches # agent_loop — same as s05 + nag reminder, task auto-dispatches
# ═══════════════════════════════════════════════════════════ # ═══════════════════════════════════════════════════════════
rounds_since_todo = 0
def agent_loop(messages: list): def agent_loop(messages: list):
global rounds_since_todo rounds_since_todo = 0
while True: while True:
# s05: nag reminder # s05: nag reminder
if rounds_since_todo >= 3 and messages: if rounds_since_todo >= 3 and messages:

View File

@@ -356,10 +356,8 @@ register_hook("Stop", summary_hook)
# agent_loop — same as s05-s06 + nag reminder # agent_loop — same as s05-s06 + nag reminder
# ═══════════════════════════════════════════════════════════ # ═══════════════════════════════════════════════════════════
rounds_since_todo = 0
def agent_loop(messages: list): def agent_loop(messages: list):
global rounds_since_todo rounds_since_todo = 0
while True: while True:
if rounds_since_todo >= 3 and messages: if rounds_since_todo >= 3 and messages:
messages.append({"role": "user", messages.append({"role": "user",