Skip to content

Commit 16b927c

Browse files
committed
Fix s_full.py consistency: auto_compact keeps newest messages, nag reminder appends after tool_results
Two issues found during post-merge audit: 1. auto_compact used [:80000] (oldest) instead of [-80000:] (newest), inconsistent with s06 2. nag reminder used insert(0,...) instead of append(), inconsistent with s03
1 parent def7c9a commit 16b927c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

agents/s_full.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def auto_compact(messages: list) -> list:
246246
with open(path, "w") as f:
247247
for msg in messages:
248248
f.write(json.dumps(msg, default=str) + "\n")
249-
conv_text = json.dumps(messages, default=str)[:80000]
249+
conv_text = json.dumps(messages, default=str)[-80000:]
250250
resp = client.messages.create(
251251
model=MODEL,
252252
messages=[{"role": "user", "content": f"Summarize for continuity:\n{conv_text}"}],
@@ -697,7 +697,7 @@ def agent_loop(messages: list):
697697
# s03: nag reminder (only when todo workflow is active)
698698
rounds_without_todo = 0 if used_todo else rounds_without_todo + 1
699699
if TODO.has_open_items() and rounds_without_todo >= 3:
700-
results.insert(0, {"type": "text", "text": "<reminder>Update your todos.</reminder>"})
700+
results.append({"type": "text", "text": "<reminder>Update your todos.</reminder>"})
701701
messages.append({"role": "user", "content": results})
702702
# s06: manual compress
703703
if manual_compress:

0 commit comments

Comments
 (0)