Skip to content

bug(mcp): mem_update cannot satisfy the project requirement, so every update fails with "expected_project must be a valid non-empty project name" #2415

Open

Description

@JpadcTools

📝 Bug Description

mem_update fails on every observation with:

expected_project must be a valid non-empty project name

mem_save works against the same server, the same session and the same project, so the project is resolvable in that context. The mem_update tool schema exposes id, content, title, type, scope and topic_key, but no project parameter, and passing a project alongside those arguments produces the same error, so the caller has no way to satisfy the requirement the server is enforcing.

The failure is permanent for a given observation: it does not depend on the payload, only on the operation.

🔄 Steps to Reproduce

  1. From a git repository whose root resolves to a project (the memory tool reports the project correctly for that working directory).
  2. mem_save with a title and content → succeeds, returns an observation id.
  3. mem_update with {"id": <that id>} and any subset of content / title → fails with expected_project must be a valid non-empty project name.
  4. mem_update with {"id": <that id>, "project": "<same project the tool reports>"} → same error.

✅ Expected Behavior

An update to an existing observation succeeds whenever the project is resolvable, exactly as mem_save does in the same session and working directory. If a project is genuinely required, the operation should either accept it as a parameter or resolve it the same way mem_save resolves it.

❌ Actual Behavior

mem_update is unusable and reports a parameter requirement that its own contract gives the caller no way to meet.

🖥️ Environment

  • engram 3.7.2
  • Pi runtime, memory tools exposed by gentle-engram (mem_*), gentle-pi 1.6.0
  • Linux (WSL2), x86_64

📎 Additional context

The two related shapes are worth distinguishing from this one:

  • mem_delete works for the same observations.
  • The closed report about ownership (project_mismatch when expected_project does not match the stored owner) is a different observable: that one is answered with a mismatch, this one with a validation failure about the value being missing or empty.

Consistent observation across several updates in one session: mem_save (which accepts an optional project) succeeds; mem_update (which does not accept one) never does.

Activity

  1. dnlrsls commented on Nov 21, 2026

    @dnlrsls
    Member

    Maintainer triage

    On Windows with a disposable store, I compared two npm-published Pi extensions against the official Engram 3.7.2 Windows amd64 binary. The release ZIP matched GitHub's published SHA-256. The fixture registered each package's native tools and sent their real requests to the released HTTP server.

    Pi extension Tool schema and result
    gentle-engram@0.1.16 The six reported fields match exactly. mem_save succeeds. mem_update sends PATCH without expected_project and receives the reported HTTP 400, including when either project or expected_project is supplied. The stored content stays intact. This package also omits the owner on delete in the fixture.
    gentle-engram@0.8.0 The schema exposes expected_project. A correct owner returns HTTP 200 and updates the observation. Missing owner or project alone returns 400. A different owner returns 409 and preserves the updated content.

    The matching 3.7.2/0.8.0 pair works for this operation. The failing cross-version control is evidence of one mechanism that produces the reported schema and error. The active extension in the reported WSL2 setup still needs to be identified, especially since delete works there. Four focused tests from canonical main ef8f2978d5d1f09b13ab5b4d93329d805e187349 also passed, including the real HTTP mutation tests.

    Could you share the loaded gentle-engram package version/source shown by your Pi configuration, and whether the failing call comes from the direct mem_update tool, tool search, or codemode? Please omit credentials and private paths. With a schema that exposes the field, call mem_update with id, expected_project set to the observation's existing owner, and the fields to change.

  2. added
    type:bug
    status:approved
    and removed
    status:needs-review
    on Nov 21, 2026
  3. self-assigned this
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

status:approvedtype:bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions