Skip to content

Commit c9bbbeb

Browse files
phernandezclaude
andcommitted
fix: pass auth headers to get_active_project in status command
The status command was failing in cloud mode with "Not authenticated" because it wasn't passing auth headers to get_active_project(). get_active_project makes API calls to validate the project, which require authentication in cloud mode. Fixed by passing auth_headers to get_active_project call on line 140. Fixes authentication error when running `bm status --project main` in cloud mode. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: phernandez <paul@basicmachines.co>
1 parent e0e4e40 commit c9bbbeb

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

src/basic_memory/cli/commands/status.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -129,25 +129,21 @@ def display_changes(
129129
async def run_status(project: Optional[str] = None, verbose: bool = False): # pragma: no cover
130130
"""Check sync status of files vs database."""
131131

132-
try:
133-
from basic_memory.config import ConfigManager
132+
from basic_memory.config import ConfigManager
134133

135-
config = ConfigManager().config
136-
auth_headers = {}
137-
if config.cloud_mode_enabled:
138-
auth_headers = await get_authenticated_headers()
134+
config = ConfigManager().config
135+
auth_headers = {}
136+
if config.cloud_mode_enabled:
137+
auth_headers = await get_authenticated_headers()
139138

140-
project_item = await get_active_project(client, project, None)
141-
response = await call_post(
142-
client, f"{project_item.project_url}/project/status", headers=auth_headers
143-
)
144-
sync_report = SyncReportResponse.model_validate(response.json())
139+
project_item = await get_active_project(client, project, None, auth_headers)
140+
response = await call_post(
141+
client, f"{project_item.project_url}/project/status", headers=auth_headers
142+
)
143+
sync_report = SyncReportResponse.model_validate(response.json())
145144

146-
display_changes(project_item.name, "Status", sync_report, verbose)
145+
display_changes(project_item.name, "Status", sync_report, verbose)
147146

148-
except (ValueError, ToolError) as e:
149-
console.print(f"[red]✗ Error: {e}[/red]")
150-
raise typer.Exit(1)
151147

152148

153149
@app.command()

0 commit comments

Comments
 (0)