fix: isolate bm-local runs from the operator's personal Basic Memory config#14
Merged
Conversation
…config The bm-local provider inherited the operator's Basic Memory config for both CLI calls and the warm MCP stdio server. With a cloud-mode config this routes search_notes through cloud.basicmemory.com (401 on expired JWT kills the provider), and a project with an empty path resolves to the benchmark cwd, so BM's sync injects frontmatter into the repo's own markdown files. Set BASIC_MEMORY_CONFIG_DIR to a benchmark-owned directory (benchmarks/bm-home/, gitignored) for every bm subprocess and the MCP stdio session. The MCP SDK only passes a safelisted default environment to stdio servers, so the env is threaded through StdioServerParameters explicitly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Drew Cain <groksrc@gmail.com>
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
The
bm-localprovider runsbasic-memoryCLI commands and the warm MCP stdio server with the operator's own Basic Memory config (~/.config/basic-memoryor equivalent). Two failure modes observed while running fresh benchmarks on a machine with a cloud-mode setup:search_notesresolves workspaces throughcloud.basicmemory.com; an expired JWT turns every query into401 Unauthorizedandbm-localerrors out of the run.title/type/permalink) intoREADME.md,AGENTS.md,docs/benchmarks.md, and dataset READMEs.Changes
ingest():BASIC_MEMORY_CONFIG_DIR=benchmarks/bm-home/(gitignored), which scopes config, project registry, SQLite index, and fastembed cache to a benchmark-owned directory — the exact isolation hook BM provides for per-process staterun_command(new optionalenvparam) for allbmCLI callsStdioServerParameters— the MCP SDK only forwards a small safelisted environment to stdio servers by default, so setting vars in the parent process is not enoughFairness / reproducibility impact
Strictly improves reproducibility: runs no longer depend on (or mutate) whatever Basic Memory state the operator happens to have. No change to query handling, scoring, or provider configuration. First run on a fresh
bm-homedownloads the embedding model into the isolated cache once.Validation
uv run ruff check .anduv run pytest testspassbm-localstateok(previously errored with the JWT failure), and the repo's markdown files stayed clean🤖 Generated with Claude Code