From 16b927c8ee7befa07caf8844d22f86ffef0aea05 Mon Sep 17 00:00:00 2001 From: CrazyBoyM Date: Mon, 30 Mar 2026 00:09:37 +0800 Subject: [PATCH] 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 --- agents/s_full.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agents/s_full.py b/agents/s_full.py index 43fce1d..e2f887b 100644 --- a/agents/s_full.py +++ b/agents/s_full.py @@ -246,7 +246,7 @@ def auto_compact(messages: list) -> list: with open(path, "w") as f: for msg in messages: f.write(json.dumps(msg, default=str) + "\n") - conv_text = json.dumps(messages, default=str)[:80000] + conv_text = json.dumps(messages, default=str)[-80000:] resp = client.messages.create( model=MODEL, messages=[{"role": "user", "content": f"Summarize for continuity:\n{conv_text}"}], @@ -697,7 +697,7 @@ def agent_loop(messages: list): # s03: nag reminder (only when todo workflow is active) rounds_without_todo = 0 if used_todo else rounds_without_todo + 1 if TODO.has_open_items() and rounds_without_todo >= 3: - results.insert(0, {"type": "text", "text": "Update your todos."}) + results.append({"type": "text", "text": "Update your todos."}) messages.append({"role": "user", "content": results}) # s06: manual compress if manual_compress: