fix(cli): show configured project in list when uncredentialed (#1003)#1010
Open
rudi193-cmd wants to merge 1 commit into
Open
fix(cli): show configured project in list when uncredentialed (#1003)#1010rudi193-cmd wants to merge 1 commit into
rudi193-cmd wants to merge 1 commit into
Conversation
…achines-co#1003) `bm project list` seeded its table rows only from live query results — the cloud query (skipped when no credentials are present) and the local query. `config.projects` was used only to enrich existing rows, never to create one, so a cloud-mode project with no cloud credentials on the machine was surfaced by neither query and rendered an empty table. Meanwhile `bm project add` reads the DB and reports the same project already exists, so the two commands disagreed about whether the project existed. Seed a local-keyed row from `config.projects` for any configured project not already surfaced, scoped to the local-inclusive view so a `--cloud` or `--workspace`-filtered listing stays deliberately narrow. Adds a regression test covering the cloud-mode-without-credentials case. Fixes basicmachines-co#1003 Signed-off-by: rudi193-cmd <rudi193@gmail.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bm project listrenders an empty table even when a project exists inconfig.jsonand the local DB, whilebm project addreports the same project already exists — the two commands disagree about whether the project exists (#1003).Root cause
In
src/basic_memory/cli/commands/project.py,list_projects()seeds its table rows (row_names_by_key) exclusively from live query results:_has_cloud_credentials(config)and skipped when no credentials are present, andmode: cloudproject.config.projectsis consulted only to enrich rows that already exist (configured_names_by_permalink), never to create one. So a cloud-mode project with no cloud credentials on the machine is surfaced by neither query → empty table. Meanwhilebm project addreads the DB, finds the project, and reports "already exists".Fix
Seed a local-keyed row from
config.projectsfor any configured project not already surfaced by a query. The existing row-building logic already derives the correct display (cloud CLI route, https MCP) from the config entry.The fallback is scoped to the local-inclusive view — it is skipped for a pure
--cloudlisting (nolocal_result) and for a--workspace-filtered view, since those are deliberately narrowed and configured local projects must not leak into them.Test
Adds
test_project_list_shows_configured_project_without_cloud_credentialstotests/cli/test_project_list_and_ls.py: a cloud-mode project in config with_has_cloud_credentialsfalse and an empty local list now renders the project instead of an empty table. Verified the test fails onmain(empty table →StopIteration) and passes with the fix.Verification
tests/cli/test_project_list_and_ls.py— 14 passedtests/cli(full) — 414 passedruff check+ruff format --check— cleanty checkon the changed file — cleanFixes #1003