fix: rag remove_directory expands ~ so it matches the indexed path (#1305)
This commit is contained in:
parent
5452bc96b1
commit
1a763b0539
1 changed files with 3 additions and 0 deletions
|
|
@ -120,6 +120,9 @@ async def call_tool(name: str, arguments: dict) -> list[TextContent]:
|
||||||
directory = arguments.get("directory", "").strip()
|
directory = arguments.get("directory", "").strip()
|
||||||
if not directory:
|
if not directory:
|
||||||
return [TextContent(type="text", text="Error: remove_directory needs a directory path")]
|
return [TextContent(type="text", text="Error: remove_directory needs a directory path")]
|
||||||
|
# Expand ~ to match add_directory, which indexes the expanded path.
|
||||||
|
# Without this, removing "~/docs" never matches the stored absolute path.
|
||||||
|
directory = os.path.expanduser(directory)
|
||||||
if not _personal_docs_manager:
|
if not _personal_docs_manager:
|
||||||
return [TextContent(type="text", text="Error: Personal docs manager not available")]
|
return [TextContent(type="text", text="Error: Personal docs manager not available")]
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue