fix: double-default display in project list + stale test updates

Use config.default_project as single source of truth for the Default
column in `bm project list`, removing checks against local DB and cloud
API is_default fields that could independently mark multiple projects.

Also updates tests that were out of date after get_project_mode changed
to default unknown projects to CLOUD:
- test_get_client_local_project_uses_asgi_transport: register "main" as LOCAL
- test_run_filters_cloud_projects_each_cycle: register local project in config
- test_new_project_addition_scenario: register projects as LOCAL in config
- test_get_project_mode_defaults_to_cloud: assert new CLOUD default

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: phernandez <paul@basicmachines.co>
This commit is contained in:
phernandez
2026-02-22 00:33:25 -06:00
parent 56cefbaafd
commit 6ff39076a0
9 changed files with 121 additions and 201 deletions
+4 -2
View File
@@ -425,10 +425,12 @@ class BasicMemoryConfig(BaseSettings):
def get_project_mode(self, project_name: str) -> ProjectMode:
"""Get the routing mode for a project.
Returns the per-project mode if set, otherwise LOCAL.
Returns the per-project mode if set.
Unknown projects (not in local config) default to CLOUD —
local projects are always registered in config.
"""
entry = self.projects.get(project_name)
return entry.mode if entry else ProjectMode.LOCAL
return entry.mode if entry else ProjectMode.CLOUD
def set_project_mode(self, project_name: str, mode: ProjectMode) -> None:
"""Set the routing mode for a project.