Skip to content

Commit 1286850

Browse files
authored
Merge pull request #461 from ggttyy1/fix/rounds-since-todo
fix: reset rounds_since_todo on each session
2 parents d04e064 + ffe1fef commit 1286850

3 files changed

Lines changed: 3 additions & 9 deletions

File tree

‎s05_todo_write/code.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,8 @@ def summary_hook(messages: list):
232232
# agent_loop — same as s04 + nag reminder counter
233233
# ═══════════════════════════════════════════════════════════
234234

235-
rounds_since_todo = 0
236-
237235
def agent_loop(messages: list):
238-
global rounds_since_todo
236+
rounds_since_todo = 0
239237
while True:
240238
# s05: nag reminder — inject if model hasn't updated todos for 3 rounds
241239
if rounds_since_todo >= 3 and messages:

‎s06_subagent/code.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,8 @@ def summary_hook(messages: list):
312312
# agent_loop — same as s05 + nag reminder, task auto-dispatches
313313
# ═══════════════════════════════════════════════════════════
314314

315-
rounds_since_todo = 0
316-
317315
def agent_loop(messages: list):
318-
global rounds_since_todo
316+
rounds_since_todo = 0
319317
while True:
320318
# s05: nag reminder
321319
if rounds_since_todo >= 3 and messages:

‎s07_skill_loading/code.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,8 @@ def summary_hook(messages: list):
356356
# agent_loop — same as s05-s06 + nag reminder
357357
# ═══════════════════════════════════════════════════════════
358358

359-
rounds_since_todo = 0
360-
361359
def agent_loop(messages: list):
362-
global rounds_since_todo
360+
rounds_since_todo = 0
363361
while True:
364362
if rounds_since_todo >= 3 and messages:
365363
messages.append({"role": "user",

0 commit comments

Comments
 (0)