Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge remote-tracking branch 'up/main' into fix-memory-delete-root-alias
# Conflicts:
#	src/anthropic/lib/tools/_beta_builtin_memory_tool.py
  • Loading branch information
Kayvan-Zahiri committed Nov 9, 2026
commit 1b98312d59e1c5ef88de8afe03b7caa7add14da1
9 changes: 2 additions & 7 deletions src/anthropic/lib/tools/_beta_builtin_memory_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,10 +880,7 @@ async def delete(self, command: BetaMemoryTool20250818DeleteCommand) -> str:
await self._ensure_memory_root()
full_path = await self._validate_path(command.path)

# AsyncPath.resolve() is a coroutine, so the comparison drops to Path here
# the way _validate_path already does. Awaiting it instead would compare an
# AsyncPath against a Path and never match.
if Path(str(full_path)) == Path(str(self.memory_root)).resolve():
if full_path == await self.memory_root.resolve():
raise ToolError("Cannot delete the /memories directory itself")

try:
Expand All @@ -904,9 +901,7 @@ async def rename(self, command: BetaMemoryTool20250818RenameCommand) -> str:
old_full_path = await self._validate_path(command.old_path)
new_full_path = await self._validate_path(command.new_path)

# AsyncPath.resolve() is a coroutine, so the comparison drops to Path here
# the way _validate_path already does.
if Path(str(old_full_path)) == Path(str(self.memory_root)).resolve():
if old_full_path == await self.memory_root.resolve():
raise ToolError("Cannot rename the /memories directory itself")

if await new_full_path.exists():
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.