Skip to content

fix(hermes): honor XDG/BASIC_MEMORY_CONFIG_DIR for bm registry path - #1870

Open
MbappeWU wants to merge 1 commit into
basicmachines-co:mainfrom
MbappeWU:fix/1783-hermes-xdg-config-path
Open

MbappeWU wants to merge 1 commit into
basicmachines-co:mainfrom
MbappeWU:fix/1783-hermes-xdg-config-path

Conversation

@MbappeWU

Copy link
Copy Markdown
Contributor

Summary

Hermes _bm_config_path() always read ~/.basic-memory/config.json, ignoring BASIC_MEMORY_CONFIG_DIR and XDG_CONFIG_HOME that bm itself honors via resolve_data_dir(). When a leftover legacy file existed without the Hermes project, the provider refused to initialize even though the XDG registry was correct.

Also, _bm_binary_path() preferred ~/.local/bin/bm over which("bm"), so a stale uv-tool binary could win.

Fixes #1783

Changes

  • _bm_config_path() mirrors resolve_data_dir() order: BASIC_MEMORY_CONFIG_DIR → $XDG_CONFIG_HOME/basic-memory → ~/.basic-memory. Missing file stays missing.
  • _bm_binary_path() tries which("bm") first, then Homebrew /usr/local, then ~/.local/bin/bm last.
  • New integrations/hermes/tests/test_bm_paths.py covering precedence, XDG-vs-legacy regression, and binary order.
  • Nearby comments / mode text updated so they no longer claim a hard-coded home path.

Test plan

  • uv run pytest tests/test_bm_paths.py -q (from integrations/hermes) → 7 passed (was 5 failed before the edit)
  • just package-check-hermes → 300 passed, 13 skipped (skips are BM_INTEGRATION=1)
  • CI

Notes

Logic is intentionally duplicated in the Hermes plugin module because it loads standalone and cannot import resolve_data_dir from the installed package path reliably.

Align Hermes _bm_config_path with bm resolve_data_dir, and prefer
which("bm") before ~/.local/bin/bm so stale uv-tool binaries lose.

Fixes basicmachines-co#1783

Signed-off-by: MbappeWU <MbappeWU@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-25T19:19:44.288050Z
We couldn’t complete this review. Comment @codex review to try again.
d3ab688 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@MbappeWU

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@MbappeWU

Copy link
Copy Markdown
Contributor Author

@CLAassistant check

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hermes integration reads bm's project registry from ~/.basic-memory even when XDG_CONFIG_HOME is set

2 participants