Bug Description
write_note with overwrite behaves differently from what the tool documents, and several sub-cases silently lose frontmatter keys:
- Documented-vs-actual on overwrite: the tool documents that overwriting replaces the note, but the server merge-preserves unrecognized frontmatter keys (a note carrying custom keys keeps them through an overwrite).
- Content-carried frontmatter is discarded on overwrite rather than merged.
- Malformed base discard: a base note with malformed frontmatter loses its keys silently during the overwrite path.
- Tag regeneration drops keys: regenerated tags can clobber unrecognized keys in the same write.
Net effect: callers cannot reason about which frontmatter survives a write_note — the four paths above give four different answers.
Steps To Reproduce
- Create a note with custom frontmatter keys (e.g.
custom_key: value) plus standard title/type/tags
- Call the
write_note MCP tool against the same title/path with overwrite: true, new content, and no mention of custom_key
- Repeat with: frontmatter embedded in the content block; a base note whose frontmatter is malformed; a write that regenerates tags
- Inspect the note file after each
Expected Behavior
One documented, test-pinned contract: overwrite either replaces (all keys gone unless re-supplied) or merges (unrecognized keys preserved) — consistently — and the tool's description matches the implementation. Silent key loss should never happen.
Actual Behavior
- Path 1:
custom_key survives (merge behavior) though the tool documents replacement
- Paths 2-4: keys are silently lost, no warning in the tool response
(Verified on a live 0.23.0 server; the four sub-cases are enumerated with the losing paths named in the original investigation.)
Environment
- OS: macOS 15 (arm64)
- Python version: 3.14 (uv-managed)
- Basic Memory version: 0.23.0
- Installation method:
uv tool install basic-memory==0.23.0
- Claude Desktop version: n/a (MCP tool calls via a stdio server)
Bug Description
write_notewithoverwritebehaves differently from what the tool documents, and several sub-cases silently lose frontmatter keys:Net effect: callers cannot reason about which frontmatter survives a
write_note— the four paths above give four different answers.Steps To Reproduce
custom_key: value) plus standardtitle/type/tagswrite_noteMCP tool against the same title/path withoverwrite: true, new content, and no mention ofcustom_keyExpected Behavior
One documented, test-pinned contract: overwrite either replaces (all keys gone unless re-supplied) or merges (unrecognized keys preserved) — consistently — and the tool's description matches the implementation. Silent key loss should never happen.
Actual Behavior
custom_keysurvives (merge behavior) though the tool documents replacement(Verified on a live 0.23.0 server; the four sub-cases are enumerated with the losing paths named in the original investigation.)
Environment
uv tool install basic-memory==0.23.0