Overview
Review of the initial plugin skeleton identified several issues to address before the plugin can reliably work against the bm CLI. These range from blocking (JSON output compatibility) to nice-to-haves (delete/move support).
Blocking
1. BmClient --format json compatibility
exec() appends --format json to all commands, but not all bm tool subcommands support this flag
- PR #552 adds
--format json to read-note, write-note, and recent-activity
search-notes and build-context already output JSON natively
- Action: Update BmClient to only pass
--format json where supported, validate against PR #552
2. --project arg ordering
exec() appends --project after tool arguments, but bm tool expects --project as an option before positional args in some subcommands
ensureProject uses execRaw (no project/format), recentActivity uses execRaw but manually adds --format json — inconsistent patterns
- Action: Standardize arg building, test against real CLI
3. Missing --local flag
- If the user has BM cloud mode enabled, CLI commands route to cloud by default
- Plugin should always use
--local for predictable low-latency local operations
- Action: Add
--local to all exec() calls
Important
4. Conversation capture floods the knowledge graph
indexConversation creates a new note per agent turn in conversations/
- Over days/weeks this generates hundreds of low-signal notes
- Proposal: Batch into daily conversation notes, or only capture substantial content (decisions, facts, preferences). Could use the LLM to extract observations rather than raw conversation dumps.
5. deriveFolder loses path structure
basename(dir) flattens nested paths: memory/projects/foo.md → folder projects (loses memory/ prefix)
MEMORY.md at workspace root → folder agent (arbitrary)
- Action: Preserve relative path structure from workspace root
6. No edit_note tool
bm CLI has edit_note with append/prepend/find-replace/replace_section
- Currently the only write path is full
write_note (overwrites entire note)
- Incremental edits are important for maintaining notes over time without losing existing content
- Action: Add
bm_edit tool wrapping bm tool edit-note
7. Agent-memory mode (Phase 2)
- The
agent-memory mode that replaces memory_search/memory_get is stubbed
- This is the key mode for comparing BM vs native OpenClaw memory
- Action: Implement mode that registers as the memory provider, mapping:
memory_search → bm tool search-notes
memory_get → bm tool read-note
- Session start context →
bm tool continue-conversation
Nice-to-have
8. No delete_note or move_note
- BM CLI supports both; plugin should expose them for knowledge graph maintenance
9. No tests
- BmClient JSON parsing will break on unexpected output
- No error handling for malformed CLI responses
- Action: Add unit tests for BmClient parsing, integration tests against real
bm CLI
10. Error handling for malformed JSON
- If
bm outputs warnings/errors before JSON, JSON.parse will fail
- Action: Strip non-JSON prefix lines, add try/catch with meaningful errors
Overview
Review of the initial plugin skeleton identified several issues to address before the plugin can reliably work against the
bmCLI. These range from blocking (JSON output compatibility) to nice-to-haves (delete/move support).Blocking
1. BmClient
--format jsoncompatibilityexec()appends--format jsonto all commands, but not allbm toolsubcommands support this flag--format jsontoread-note,write-note, andrecent-activitysearch-notesandbuild-contextalready output JSON natively--format jsonwhere supported, validate against PR #5522.
--projectarg orderingexec()appends--projectafter tool arguments, butbm toolexpects--projectas an option before positional args in some subcommandsensureProjectusesexecRaw(no project/format),recentActivityusesexecRawbut manually adds--format json— inconsistent patterns3. Missing
--localflag--localfor predictable low-latency local operations--localto allexec()callsImportant
4. Conversation capture floods the knowledge graph
indexConversationcreates a new note per agent turn inconversations/5.
deriveFolderloses path structurebasename(dir)flattens nested paths:memory/projects/foo.md→ folderprojects(losesmemory/prefix)MEMORY.mdat workspace root → folderagent(arbitrary)6. No
edit_notetoolbmCLI hasedit_notewith append/prepend/find-replace/replace_sectionwrite_note(overwrites entire note)bm_edittool wrappingbm tool edit-note7. Agent-memory mode (Phase 2)
agent-memorymode that replacesmemory_search/memory_getis stubbedmemory_search→bm tool search-notesmemory_get→bm tool read-notebm tool continue-conversationNice-to-have
8. No
delete_noteormove_note9. No tests
bmCLI10. Error handling for malformed JSON
bmoutputs warnings/errors before JSON,JSON.parsewill fail