Skip to content

create_memory_project reports success for an existing name with a different path #1811

Closed

Description

@phernandez

Found during live testing of main at 0276799.

create_memory_project(project_name="bm-live-throwaway-1842", project_path="<dir>/throwaway-proj-2"), when that name already exists at <dir>/throwaway-proj, returns:

✓ Project already exists: bm-live-throwaway-1842
• Path: <dir>/throwaway-proj

The requested path is silently ignored and the result is reported as a success. Calling again with the same name and the same path is a reasonable no-op. With a different path, the tool should refuse, or at least warn that the existing project points somewhere else.

Activity

  1. added
    bug
    on Oct 23, 2026
  2. claude commented on Oct 23, 2026

    @claude
    Contributor

    Claude finished @phernandez's task in 22s —— View job


    Triage

    • Type: Bug
    • Component: MCP tools (create_memory_project). Not cloud-specific.
    • Priority: Medium. The tool reports success while ignoring the requested path, which can mislead an LLM or user. No data loss.
    • Complexity: Simple.
    • Duplicates: I searched for related open and closed issues and found none.

    Findings: In src/basic_memory/mcp/tools/project_management.py (around lines 632–678), the existing_match branch is taken whenever the name matches. It re-requests indexing and returns "✓ Project already exists" without comparing existing_match.path to the requested project_path. This matches the report.

    Likely fix direction:

    • Compare the requested path with existing_match.path, normalized (expanded and resolved).
    • If the paths are equal, keep the current idempotent no-op.
    • If they differ, fail fast with an error naming both paths. Refusing is better than warning, since the caller asked for something that didn't happen.
    • Handle the output_format == "json" branch the same way.
    • Add a regression test for a same-name, different-path call. Keep the same-name, same-path test as the no-op case.
    • Cloud projects may store paths differently, so check how existing_match.path is stored before comparing.

    No reproduction steps are needed; the report is clear. I did not implement a fix, per triage scope.

  3. added a commit that references this issue on Oct 28, 2026
    efd1570
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions