fix: reset rounds_since_todo on each session

This commit is contained in:
ggttyy1 2026-07-11 18:36:19 +08:00
parent a9cafe953a
commit 4faf3e4c52
3 changed files with 3 additions and 0 deletions

View file

@ -236,6 +236,7 @@ rounds_since_todo = 0
def agent_loop(messages: list):
global rounds_since_todo
rounds_since_todo = 0 # 每轮新对话从0开始计数
while True:
# s05: nag reminder — inject if model hasn't updated todos for 3 rounds
if rounds_since_todo >= 3 and messages:

View file

@ -316,6 +316,7 @@ rounds_since_todo = 0
def agent_loop(messages: list):
global rounds_since_todo
rounds_since_todo = 0 # 每轮新对话从0开始计数
while True:
# s05: nag reminder
if rounds_since_todo >= 3 and messages:

View file

@ -360,6 +360,7 @@ rounds_since_todo = 0
def agent_loop(messages: list):
global rounds_since_todo
rounds_since_todo = 0 # 每轮新对话从0开始计数
while True:
if rounds_since_todo >= 3 and messages:
messages.append({"role": "user",