Files
codebase-memory-mcp/tests
Amir Fathi 7a674af80a fix(mcp): resolve index_repository's repo_path from a known project name
handle_index_repository requires repo_path and errors with
"repo_path is required" if it is absent. list_projects only ever
advertises the project NAME, never repo_path, and every read tool
accepts that name back through get_project_arg's project/project_name/
project_id/projectName aliases -- but index_repository did not, so
re-indexing an already-indexed project by the name list_projects gave
you had no resolution path and failed immediately.

Add resolved_repo_path_from_project_arg(): a query-only lookup of the
project's own stored root_path, tried when repo_path is absent before
giving up. It never touches srv->store or srv->current_project, so it
cannot disturb whatever project the server already has cached, and an
unresolvable name still falls through to the original, correct
"repo_path is required" error.

Verified in a clean ubuntu:24.04 container (TEST_SUITES=mcp make -f
Makefile.cbm test-focused): the new
tool_index_repository_resolves_root_path_from_project_name_issue1211
fails on unpatched main (strstr(resp, "repo_path is required") is
not NULL) and passes with the fix; the companion
tool_index_repository_unknown_project_name_still_requires_repo_path
guards the fallback stays exact for a name that was never indexed.
Full mcp suite: 179 passed on both sides, with one pre-existing,
unrelated failure (tool_detect_changes_contained_commands_clean_up_error_and_success,
test_mcp.c:5814) reproducing identically on unmodified origin/main.
scripts/lint.sh --ci and scripts/security-audit.sh both clean.

Fixes #1211

Signed-off-by: Amir Fathi <amirfathi.me@gmail.com>
2026-07-25 07:17:26 +00:00
..
2026-07-08 00:05:19 +05:30
2026-07-08 00:05:19 +05:30
2026-06-28 13:05:05 +02:00