Skip to content

feat(core)!: remove note formatting and format_on_save - #2057

Merged
phernandez merged 1 commit into
mainfrom
feat/remove-note-formatting
Nov 5, 2026
Merged

phernandez merged 1 commit into
mainfrom
feat/remove-note-formatting

Conversation

@phernandez

Copy link
Copy Markdown
Member

Summary

Fixes #2005 by removing note formatting rather than restoring it. Breaking change.

Why it broke. 1.0 writes a note in two steps. First it accepts the note's bytes into note_content, which holds the canonical content and its checksum. Then LocalNoteContentStorage writes those bytes to the file. The formatter used to run inside FileService.write_file, which is no longer on that path, so format_on_save stopped running for bm_write and bm_edit.

Why it isn't restored. Formatting the file after the write would make it differ from the accepted note:

  • The watcher would record the formatted file as an outside edit and accept a second version.
  • The checksum the agent got back from the write would be stale, so its next bm_edit with expected_checksum would conflict.

Formatting before accept avoids that, but it means running a formatter subprocess inside the accept transaction. That's the wrong trade for a feature that's off by default.

Removed

  • The config settings format_on_save, formatter_command, formatters and formatter_timeout, and their BASIC_MEMORY_* environment variables. Config uses extra="ignore", so existing config.json files that still have these keys keep loading.
  • The bm format command and its man page entry.
  • file_utils.format_file and format_markdown_builtin, and the formatter calls in FileService.write_file, FileService.update_frontmatter_with_result and MarkdownProcessor.write_file.
  • The mdformat, mdformat-gfm and mdformat-frontmatter dependencies.
    • mdit-py-plugins came in through mdformat-gfm, and the page-citation integration test still imports it, so it's now an explicit dev dependency.
  • The tests for these features. Three config tests used format_on_save or formatters only as sample settings; they now use skip_initialization_sync.

A CHANGELOG entry under Unreleased > Breaking Changes describes the removal.

Left in place

MarkdownProcessor still accepts app_config=, although nothing reads it now. basic-memory-cloud passes it in four places, so dropping the parameter would break the next cloud re-pin. Removing it should be a separate change, coordinated with cloud.

Verification

  • just fast-check: clean
  • Edited test files plus the man page and page-citation tests: 344 passed
  • bm format now reports "No such command 'format'."

Follow-up

docs.basicmemory.com documents format_on_save and bm format, and needs updating when this ships.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CMYVL4TcbWdXhdvAzxfqjo

1.0 accepts a note's bytes before writing the file, so format_on_save
stopped running for bm_write and bm_edit (#2005). Formatting the file
after the write would make it differ from the accepted note: the next
sync records it as an outside edit, and the agent's next
expected_checksum conflicts. Notes are now stored exactly as written.

BREAKING CHANGE: the format_on_save, formatter_command, formatters and
formatter_timeout settings, the bm format command and the mdformat
dependency are removed. Old config keys are ignored on load.

Fixes #2005

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

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

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T00:00:51.227475Z dfa6d3d 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 d1c16c6 into main Nov 5, 2026
51 checks passed
@phernandez
phernandez deleted the feat/remove-note-formatting branch November 5, 2026 00:16
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.

format_on_save is not applied to notes written by bm_write / bm_edit (1.0.0)

1 participant