Repository navigation
Conversation
Add regression coverage for basicmachines-co#1811: same name with a different path must fail, while the same directory stays idempotent. Update the manual page and integration cases that previously encoded the bug. Signed-off-by: MbappeWU <MbappeWU@users.noreply.github.com>
When create_memory_project finds an existing name, compare normalized paths the same way the API add_project path does. Equal paths keep the idempotent re-index success. Different paths fail fast with both paths named and without re-indexing. Fixes basicmachines-co#1811 Signed-off-by: MbappeWU <MbappeWU@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
I have read the CLA Document and I hereby sign the CLA |
|
@CLAassistant check |
|
Thanks @MbappeWU — fork PRs don't run our test suite, so I've moved this to an in-repo branch in #1846 with your two commits kept as authored. I added one commit on top: the mismatch is raised as an |
|
Thanks @phernandez — appreciated you carrying the commits into #1846 and for the extra mismatch-as-error follow-up. Happy to help if anything else is needed on that branch. |
Problem
create_memory_projecttreated any existing project name as an idempotent success. When the caller passed the same name with a different path, the tool returned✓ Project already exists, re-indexed the stored project, and silently ignored the requested path (#1811).Approach
Mirror the path check already used by API
add_project:os.path.abspath(os.path.expanduser(...)).already_exists=True).# Error) and JSON (error: PATH_MISMATCH,already_exists: false).Also update the man page and the integration cases that previously encoded the buggy success path.
Verification
uv run pytestfor the new unit tests, the partial-create retry test,test_create_project_duplicate_name, andtest_create_memory_project_json_output_is_idempotent→ 6 passed.tests/mcp/test_tool_project_management.pyreported 43 passed during local development.ruff check/ruff format/ty checkon touched Python files clean. Repo-widejust fast-checkstill hits pre-existing unresolvedpymilvusimports unrelated to this change.Fixes #1811