From fdcc92eeea2012d35a195222fb451ea0a6791e93 Mon Sep 17 00:00:00 2001 From: victortaelin Date: Sat, 25 Jul 2026 17:12:11 -0300 Subject: [PATCH] wake always ends with 'awake.', even when the memory fits one part AGENTS.md tells the agent to run parts until one says 'awake.' A one-part memory printed no terminator, so the word never arrived. --- memo | 4 +++- test.py | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/memo b/memo index bc45c61..357e4c5 100755 --- a/memo +++ b/memo @@ -339,7 +339,9 @@ def cmd_wake(d, args): print("\n".join(parts[k - 1])) if k < len(parts): print("next: memo wake %d %d" % (k + 1, T)) - elif len(parts) > 1: + else: + # always, even for a one-part memory: the contract an agent is given + # is "run parts until one says awake", so it must always arrive print("awake.") diff --git a/test.py b/test.py index 2cf353d..37f9a0e 100755 --- a/test.py +++ b/test.py @@ -250,6 +250,12 @@ r = subprocess.run(memo + ["recall", "right after a torn write"], env=env2, capture_output=True, text=True) check("#%d " % P in r.stdout, "the memory after a torn write reads wrong") +# a memory small enough to fit one part must still end with the terminator +# the agent was told to wait for +r = subprocess.run(memo + ["wake"], env=env2, capture_output=True, text=True) +check(r.stdout.rstrip().endswith("awake."), + "a one-part wake never says `awake.`:\n" + r.stdout) + shutil.rmtree(d2) shutil.rmtree(d) print("\n%d passed, %d failed" % (ok, fail))