Repository navigation
feat(core)!: remove note formatting and format_on_save - #2057
Merged
Merged
Conversation
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>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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. ThenLocalNoteContentStoragewrites those bytes to the file. The formatter used to run insideFileService.write_file, which is no longer on that path, soformat_on_savestopped running forbm_writeandbm_edit.Why it isn't restored. Formatting the file after the write would make it differ from the accepted note:
bm_editwithexpected_checksumwould 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
format_on_save,formatter_command,formattersandformatter_timeout, and theirBASIC_MEMORY_*environment variables. Config usesextra="ignore", so existingconfig.jsonfiles that still have these keys keep loading.bm formatcommand and its man page entry.file_utils.format_fileandformat_markdown_builtin, and the formatter calls inFileService.write_file,FileService.update_frontmatter_with_resultandMarkdownProcessor.write_file.mdformat,mdformat-gfmandmdformat-frontmatterdependencies.mdit-py-pluginscame in throughmdformat-gfm, and the page-citation integration test still imports it, so it's now an explicit dev dependency.format_on_saveorformattersonly as sample settings; they now useskip_initialization_sync.A CHANGELOG entry under Unreleased > Breaking Changes describes the removal.
Left in place
MarkdownProcessorstill acceptsapp_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: cleanbm formatnow reports "No such command 'format'."Follow-up
docs.basicmemory.com documents
format_on_saveandbm format, and needs updating when this ships.🤖 Generated with Claude Code
https://claude.ai/code/session_01CMYVL4TcbWdXhdvAzxfqjo