Bug Description
bm doctor fails deterministically at its first API round-trip check on 0.23.0: the entity-create endpoint returns 202 Accepted with file_write_status: "pending" (the write is applied asynchronously by the background materialization worker, by design), but doctor checks Path.exists() immediately after the response — with no await point between, the queued write cannot have run yet, so the check can never pass.
A secondary behavior on the same invocation: bm doctor rewrites ~/.basic-memory/config.json (project create + cleanup both call save_config), stamping cloud_promo_first_run_shown / cloud_promo_last_version_shown and re-serializing the whole file. The four configured projects survive semantically, but the bytes change — anything pinning the config's hash (drift detection, benchmark runs comparing config-sha across a run) breaks after a doctor invocation.
Steps To Reproduce
- Install version
0.23.0 via uv tool install basic-memory==0.23.0 (also reproduced from a fresh checkout of the 0.23.0 tag)
- Configure ≥1 local project in
~/.basic-memory/config.json (sqlite backend)
- Run command
bm doctor
- See error
Expected Behavior
Doctor completes its checks: the API-written note file is verified on disk, the manual note is indexed and searchable, the disposable project is cleaned up, and config.json is left byte-identical to before the run (the doctor project was created and deleted — the net config effect should be zero apart from any intentionally persisted state).
Actual Behavior
OK Created doctor project: doctor-2bb90ddb
Doctor failed: API note file missing: doctor/doctor-api-note.md
Reproduced 4/4 runs. The failure envelope itself carries the cause: the 202 response includes "file_write_status": "pending". A live probe of the same client stack measured the file appearing on disk 11 ms after the response (exists_immediately=False, appeared_after=0.011s). After the failed run, config.json has new bytes (promo flags stamped, full-model rewrite).
Environment
- OS: macOS 15 (arm64)
- Python version: 3.14 (uv-managed)
- Basic Memory version: 0.23.0
- Installation method:
uv tool install basic-memory==0.23.0
- Claude Desktop version: n/a (CLI + local API only)
(Follow-up note in the comments: the materialization half appears fixed on main via _read_materialized_api_note + drain_pending_materializations; this report is against 0.23.0, where the failure is deterministic.)
Bug Description
bm doctorfails deterministically at its first API round-trip check on 0.23.0: the entity-create endpoint returns 202 Accepted withfile_write_status: "pending"(the write is applied asynchronously by the background materialization worker, by design), but doctor checksPath.exists()immediately after the response — with no await point between, the queued write cannot have run yet, so the check can never pass.A secondary behavior on the same invocation:
bm doctorrewrites~/.basic-memory/config.json(project create + cleanup both callsave_config), stampingcloud_promo_first_run_shown/cloud_promo_last_version_shownand re-serializing the whole file. The four configured projects survive semantically, but the bytes change — anything pinning the config's hash (drift detection, benchmark runs comparing config-sha across a run) breaks after a doctor invocation.Steps To Reproduce
0.23.0viauv tool install basic-memory==0.23.0(also reproduced from a fresh checkout of the 0.23.0 tag)~/.basic-memory/config.json(sqlite backend)bm doctorExpected Behavior
Doctor completes its checks: the API-written note file is verified on disk, the manual note is indexed and searchable, the disposable project is cleaned up, and
config.jsonis left byte-identical to before the run (the doctor project was created and deleted — the net config effect should be zero apart from any intentionally persisted state).Actual Behavior
Reproduced 4/4 runs. The failure envelope itself carries the cause: the 202 response includes
"file_write_status": "pending". A live probe of the same client stack measured the file appearing on disk 11 ms after the response (exists_immediately=False, appeared_after=0.011s). After the failed run,config.jsonhas new bytes (promo flags stamped, full-model rewrite).Environment
uv tool install basic-memory==0.23.0(Follow-up note in the comments: the materialization half appears fixed on
mainvia_read_materialized_api_note+drain_pending_materializations; this report is against 0.23.0, where the failure is deterministic.)