fix(memories): check read-only access on both names when renaming

This commit is contained in:
maxwang authored and Dr. Dominik Jain committed 2026-09-21 13:28:24 +02:00
1 parent 4b726894d0
commit 37718d3588
2 files changed
+3

No files matched your search

+2
View File
@@ -60,6 +60,8 @@ Status of the `main` branch. Changes prior to the next official version change w
replaced by a regular file (#1958)
* Memories:
- Fix: `move_memory` / rename only checked write access on the destination name, so a tool-context
rename could relocate a read-only memory; both source and destination are now checked
- Fix: `save_memory`/`edit_memory` wrote directly to the memory file with `open(path, "w")`, which
truncates it before the new content is written; a crash, OOM kill, or full disk partway through
the write could destroy the previous, valid content instead of just losing the update. Both now
+1
View File
@@ -330,6 +330,7 @@ class MemoryManager:
new_name = self._sanitize_name(new_name)
self._check_not_ignored(old_name)
self._check_not_ignored(new_name)
self._check_write_access(old_name, is_tool_context)
self._check_write_access(new_name, is_tool_context)
old_path = self.get_memory_file_path(old_name)