Skip to content

Commit 089a45a

Browse files
committed
Fix for file removal of unresolved memories
1 parent 496327a commit 089a45a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

memory_management.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,11 @@ def delete_unresolved_memory_files(self):
112112
content = json.load(f)
113113
if content.get("resolution_status") == "RESOLVED":
114114
continue
115+
else:
116+
os.remove(file_path)
115117
except (json.JSONDecodeError, OSError):
116118
# Not a valid JSON file, unlikely to be a valid memory file, delete it
117119
console.error(f"Memory file is not a valid JSON file: {file_name}. Deleting it.")
118120
os.remove(file_path)
119-
os.remove(file_path)
121+
120122
console.debug(f"Deleted temporary memory file: {file_name}")

0 commit comments

Comments
 (0)