Problem
edit-note fails with "Entity not found" when a markdown file exists on disk but has not been indexed yet.
This breaks a common workflow:
- Write file directly to disk.
- Immediately call
bm tool edit-note ....
- Edit fails even though file exists.
Related downstream issue: basicmachines-co/openclaw-basic-memory#19
Why this looks upstream
Current edit flow resolves identifier to entity ID first and fails hard when index is behind:
src/basic_memory/cli/commands/tool.py (_edit_note_json)
src/basic_memory/mcp/tools/edit_note.py (resolve_entity before patch)
Requested fix
Add an optional recovery path when identifier resolution fails:
- Attempt targeted sync/index for matching file candidate(s) when identifier looks like a permalink/path.
- Retry entity resolution once after sync.
- Return a structured error code when recovery fails (e.g.
ENTITY_NOT_FOUND_AFTER_SYNC) so clients can handle it deterministically.
Alternative acceptable fix: explicit edit-note flag (for example --sync-if-missing) that enables this behavior.
Acceptance criteria
- If note exists on disk but is temporarily unindexed,
edit-note can recover without manual watcher restart.
- CLI JSON mode returns machine-readable failure code for non-recoverable misses.
- Behavior is opt-in or clearly documented to avoid unexpected expensive sync calls.
Problem
edit-notefails with "Entity not found" when a markdown file exists on disk but has not been indexed yet.This breaks a common workflow:
bm tool edit-note ....Related downstream issue: basicmachines-co/openclaw-basic-memory#19
Why this looks upstream
Current edit flow resolves identifier to entity ID first and fails hard when index is behind:
src/basic_memory/cli/commands/tool.py(_edit_note_json)src/basic_memory/mcp/tools/edit_note.py(resolve_entitybefore patch)Requested fix
Add an optional recovery path when identifier resolution fails:
ENTITY_NOT_FOUND_AFTER_SYNC) so clients can handle it deterministically.Alternative acceptable fix: explicit
edit-noteflag (for example--sync-if-missing) that enables this behavior.Acceptance criteria
edit-notecan recover without manual watcher restart.