Skip to content

fix(memory): stop remember and the memory tool from losing or reviving memories - #585

Merged
kevintseng merged 4 commits into
mainfrom
codex/rebuild-m6-memory-safety
Oct 5, 2026
Merged

kevintseng merged 4 commits into
mainfrom
codex/rebuild-m6-memory-safety

Conversation

@kevintseng

Copy link
Copy Markdown
Collaborator

Four ways a memory could be lost or come back without being asked:

  • remember with replace: true and no content emptied the memory. A call that only meant to fix the title or tags (name + replace + title) cleared every observation, and the error text and the docs recommended exactly that call. It is now refused over MCP, HTTP and the CLI (an empty observations list too); the message says to send the observations the memory already has with the new title.
  • MCP remember with a plain project:<name> tag skipped the session binding, so the memory was filed under a project no briefing reads. It is now stored under the bound project id and reported in retagged, as the tool description already said. A bare project: tag is refused on every transport.
  • The memory tool showed and reactivated deleted memories. view, str_replace, insert and a second delete on a deleted path now say it does not exist; create over the path still brings it back on purpose.
  • A memory tool edit that left the text unchanged raised the memory's confidence and reset every observation's time. It is now a no-op. (A real edit still does both; that needs a storage change and stays open in Editing a memory through the memory tool keeps raising its confidence #531.)

Verified locally: npm run verify green for the final tree; each fix has a test that fails when the fix is reverted.

Refs #531

…g memories

- remember with replace and no observations or note (or an empty list) is
  refused over MCP, HTTP and the CLI; before, it emptied the memory.
- Over MCP, a project:<name> tag with no project argument is stored as the
  bound project id and reported in retagged; a bare project: tag is refused
  on every transport.
- The memory tool treats a deleted memory as gone: view, str_replace, insert
  and a second delete no longer show or reactivate it.
- A memory tool edit that leaves the text unchanged no longer raises its
  confidence or resets its observation times.
- The MCP and exported schemas now say a replace without observations is
  refused (minItems: 1), so an agent reading the schema no longer sends a
  call the server rejects.
- The memory tool treats an edit that leaves the text the same as no edit,
  also when one stored observation holds a newline.
@kevintseng
kevintseng merged commit 48ec41f into main Oct 5, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant