diff --git a/src/void_tools/cli.py b/src/void_tools/cli.py index a5460f2..e8c1bb1 100644 --- a/src/void_tools/cli.py +++ b/src/void_tools/cli.py @@ -192,6 +192,13 @@ def cmd_dispatch(args): print("Marked notifications as seen.") except Exception as e: print(f"Error marking seen: {e}") + + # Always delete the outbox file after successful dispatch to prevent stale state loops + try: + os.remove(args.file) + print(f"Cleared {args.file} to prevent state desynchronization.") + except Exception as e: + print(f"Failed to clear outbox file: {e}") def cmd_notifications(args): client = get_client()