From 002551d50ace5ff2eb43b14141b84e0e109f994a Mon Sep 17 00:00:00 2001 From: Cameron Pfiffer Date: Thu, 5 Mar 2026 19:49:17 -0800 Subject: [PATCH] feat: archive outbox.yaml to outbox_archive/ instead of deleting it to preserve execution logs --- src/void_tools/cli.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/void_tools/cli.py b/src/void_tools/cli.py index bab6028..7087493 100644 --- a/src/void_tools/cli.py +++ b/src/void_tools/cli.py @@ -516,10 +516,19 @@ def cmd_dispatch(args): except Exception as e: print(f"Error updating inbox.yaml: {e}") - # Always delete the outbox file after successful dispatch to prevent stale state loops + # Move the outbox file to an archive directory instead of deleting it try: - os.remove(args.file) - print(f"Cleared {args.file} to prevent state desynchronization.") + import datetime + import shutil + + archive_dir = "outbox_archive" + os.makedirs(archive_dir, exist_ok=True) + + timestamp = datetime.datetime.now(datetime.UTC).strftime('%Y%m%d_%H%M%S') + archive_path = os.path.join(archive_dir, f"{timestamp}_outbox.yaml") + + shutil.move(args.file, archive_path) + print(f"Archived {args.file} to {archive_path} to prevent state desynchronization.") # If any memfs updates happened, trigger a git add/commit in the background agent_id = os.getenv("AGENT_ID") -- 2.51.2