Skip to content

Commit 013864e

Browse files
phernandezclaude
andauthored
fix(cli): use resolved project path in doctor command (#667)
Signed-off-by: phernandez <paul@basicmachines.co> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent dd91b49 commit 013864e

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/basic_memory/cli/commands/doctor.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ async def run_doctor() -> None:
5454
if not status.new_project:
5555
raise ValueError("Failed to create doctor project")
5656
project_id = status.new_project.external_id
57+
# Use the resolved path from the server — when project_root is configured,
58+
# the actual project directory differs from the requested temp_path
59+
project_path = Path(status.new_project.path)
5760
console.print(f"[green]OK[/green] Created doctor project: {project_name}")
5861

5962
# --- DB -> File: create an entity via API ---
@@ -68,7 +71,7 @@ async def run_doctor() -> None:
6871
)
6972
api_result = await knowledge_client.create_entity(api_note.model_dump(), fast=False)
7073

71-
api_file = temp_path / api_result.file_path
74+
api_file = project_path / api_result.file_path
7275
if not api_file.exists():
7376
raise ValueError(f"API note file missing: {api_result.file_path}")
7477

@@ -79,7 +82,7 @@ async def run_doctor() -> None:
7982
console.print("[green]OK[/green] API write created file")
8083

8184
# --- File -> DB: write markdown file directly, then sync ---
82-
parser = EntityParser(temp_path)
85+
parser = EntityParser(project_path)
8386
processor = MarkdownProcessor(parser)
8487
manual_markdown = EntityMarkdown(
8588
frontmatter=EntityFrontmatter(
@@ -93,7 +96,7 @@ async def run_doctor() -> None:
9396
content=f"# {manual_note_title}\n\n- [note] File to DB check",
9497
)
9598

96-
manual_path = temp_path / "doctor" / "manual-note.md"
99+
manual_path = project_path / "doctor" / "manual-note.md"
97100
await processor.write_file(manual_path, manual_markdown)
98101
console.print("[green]OK[/green] Manual file written")
99102

test-int/mcp/test_string_params_integration.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,7 @@ async def test_canvas_nodes_edges_as_string(mcp_server, app, test_project):
148148
"height": 100,
149149
}
150150
]
151-
edges = [
152-
{"id": "e1", "fromNode": "n1", "toNode": "n1", "label": "self"}
153-
]
151+
edges = [{"id": "e1", "fromNode": "n1", "toNode": "n1", "label": "self"}]
154152

155153
async with Client(mcp_server) as client:
156154
result = await client.call_tool(

tests/mcp/test_tool_edit_note.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Tests for the edit_note MCP tool."""
22

3-
43
import pytest
54

65
from basic_memory.mcp.tools.edit_note import edit_note

tests/test_coerce.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
These must fail until the helpers are implemented in utils.py.
44
"""
55

6-
76
from basic_memory.utils import coerce_list, coerce_dict
87

98

0 commit comments

Comments
 (0)