@@ -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
0 commit comments