Skip to content

Commit a500f0f

Browse files
authored
Merge branch 'main' into perf/cli-version-fastpath
2 parents 90fa5c5 + 51e251a commit a500f0f

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

src/basic_memory/api/app.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ async def lifespan(app: FastAPI): # pragma: no cover
8282
# Legacy web app proxy paths (compat with /proxy/projects/projects)
8383
app.include_router(v2_project, prefix="/proxy/projects")
8484

85+
# Legacy v1 compat: older CLI versions call GET /projects/projects
86+
app.include_router(v2_project, prefix="/projects")
87+
8588
# V2 routers are the only public API surface
8689

8790

tests/api/v2/test_project_router.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,3 +340,26 @@ async def test_resolve_project_empty_identifier(client: AsyncClient, v2_projects
340340
response = await client.post(f"{v2_projects_url}/resolve", json=resolve_data)
341341

342342
assert response.status_code == 422 # Validation error
343+
344+
345+
# --- Legacy v1 compatibility tests ---
346+
347+
348+
@pytest.mark.asyncio
349+
async def test_legacy_v1_list_projects_endpoint(client: AsyncClient, test_project: Project):
350+
"""Test that the legacy /projects/projects endpoint still works for older CLI versions.
351+
352+
This endpoint was removed when we migrated to v2 but older versions of
353+
basic-memory-cloud CLI still call it for `bm project list`.
354+
"""
355+
# The legacy v1 endpoint was at /projects/projects
356+
response = await client.get("/projects/projects/")
357+
358+
assert response.status_code == 200
359+
data = response.json()
360+
assert "projects" in data
361+
assert "default_project" in data
362+
363+
# Verify the test project is in the list
364+
project_names = [p["name"] for p in data["projects"]]
365+
assert test_project.name in project_names

0 commit comments

Comments
 (0)