Skip to content

fix(mcp): document that bm_write overwrite keeps frontmatter keys - #2111

Merged
phernandez merged 1 commit into
mainfrom
fix/1653-bm-write-overwrite-frontmatter
Nov 13, 2026
Merged

phernandez merged 1 commit into
mainfrom
fix/1653-bm-write-overwrite-frontmatter

Conversation

@phernandez

Copy link
Copy Markdown
Member

Fixes #1653.

What #1653 reported, checked on main

#1653 was filed against write_note in 0.23.0. On main, through bm_write:

Case Result on main
Overwrite with new content that leaves out custom_key custom_key is kept
Overwrite whose content carries its own frontmatter merged with the existing keys; nothing dropped
Overwrite with tags= tags replaced, other keys kept
Malformed frontmatter in the write refused with INVALID_ARGUMENTS; nothing written

No case loses keys silently anymore. What remains is the first point of the issue: the merge is intentional (note_preparation.py: "Partial writers such as write_note overwrite keep the merge"; only whole-document saves replace the frontmatter, #1768), but the tool said content was "Saved as given" and overwrite would "Replace a note".

Change

  • bm_write's description, content and overwrite fields now say that overwrite replaces the body and keeps frontmatter keys the new content or arguments don't set.
  • bm-write(3) DESCRIPTION says the same and explains how to remove a key: edit the frontmatter text with bm_edit. The PARAMETERS block was regenerated with just man-regen.
  • New test test_overwrite_replaces_the_body_and_keeps_frontmatter_it_does_not_set pins the merge: a left-out key is kept, keys set by the content, tags and metadata take their new values, and a find_replace on the frontmatter removes a key.

Verification

  • tests/mcp/test_tool_bm_write.py, tests/test_man_pages.py and tests/test_bm_tool_manual_parameters.py pass (119 tests).
  • just fast-check passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CMYVL1rjJwNnrvxniz1dDD

bm_write overwrite replaces the body and merges the frontmatter, as the
service intends (note_preparation keeps the merge for partial writers).
The tool said content was saved as given and overwrite replaced the
note. Say what it does in the tool schema and bm-write(3), and pin the
merge and key removal with a test.

Fixes #1653

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CMYVL1rjJwNnrvxniz1dDD
Signed-off-by: phernandez <paul@basicmachines.co>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T21:28:27.287185Z d331591 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@phernandez
phernandez merged commit 5dcf4d3 into main Nov 13, 2026
51 checks passed
@phernandez
phernandez deleted the fix/1653-bm-write-overwrite-frontmatter branch November 13, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant