fix: long-term memory bug

This commit is contained in:
saboteur7
2026-01-30 11:31:13 +08:00
parent bb850bb6c5
commit 5a466d0ff6
12 changed files with 202 additions and 295 deletions

View File

@@ -46,6 +46,7 @@ class Edit(BaseTool):
def __init__(self, config: dict = None):
self.config = config or {}
self.cwd = self.config.get("cwd", os.getcwd())
self.memory_manager = self.config.get("memory_manager", None)
def execute(self, args: Dict[str, Any]) -> ToolResult:
"""
@@ -141,6 +142,14 @@ class Edit(BaseTool):
"first_changed_line": diff_result['first_changed_line']
}
# Notify memory manager if file is in memory directory
if self.memory_manager and "memory/" in path:
try:
self.memory_manager.mark_dirty()
except Exception as e:
# Don't fail the edit if memory notification fails
pass
return ToolResult.success(result)
except UnicodeDecodeError: