fix: resolve project state inconsistency between MCP and CLI (#149)

Signed-off-by: phernandez <paul@basicmachines.co>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Paul Hernandez <phernandez@users.noreply.github.com>
This commit is contained in:
Paul Hernandez
2025-06-19 21:24:51 -05:00
committed by GitHub
parent 7be001ca68
commit 35e4f73ae8
5 changed files with 209 additions and 8 deletions
+3 -7
View File
@@ -120,7 +120,7 @@ def set_default_project(
try:
project_name = generate_permalink(name)
response = asyncio.run(call_put(client, f"projects/{project_name}/default"))
response = asyncio.run(call_put(client, f"/projects/{project_name}/default"))
result = ProjectStatusResponse.model_validate(response.json())
console.print(f"[green]{result.message}[/green]")
@@ -128,12 +128,8 @@ def set_default_project(
console.print(f"[red]Error setting default project: {str(e)}[/red]")
raise typer.Exit(1)
# Reload configuration to apply the change
from importlib import reload
from basic_memory import config as config_module
reload(config_module)
# The API call above should have updated both config and MCP session
# No need for manual reload - the project service handles this automatically
console.print("[green]Project activated for current session[/green]")