Skip to content

fix(core): avoid phantom project directory on config load#1080

Merged
phernandez merged 1 commit into
mainfrom
codex/1029-config-load-no-phantom-dir
Jul 16, 2026
Merged

fix(core): avoid phantom project directory on config load#1080
phernandez merged 1 commit into
mainfrom
codex/1029-config-load-no-phantom-dir

Conversation

@phernandez

Copy link
Copy Markdown
Member

Why

Loading an existing config currently constructs a throwaway BasicMemoryConfig() just to parse environment overrides. With no BASIC_MEMORY_HOME, that temporary model seeds and creates ~/basic-memory even when the configured project lives elsewhere.

This is an independent maintainer implementation for #1029 because contributor PR #1030 cannot pass the CLA gate.

What changed

  • remove the throwaway environment-only config construction
  • drop file-backed fields that have explicit environment overrides, allowing BaseSettings to parse those environment values directly
  • add a regression proving an existing custom project config does not create the unused default directory
  • prove scalar and JSON environment overrides still take precedence

Verification

  • just fast-check
  • uv run pytest tests/test_config.py tests/test_config_load_side_effects.py -q — 136 passed

Fixes #1029
Supersedes #1030

Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: aeb66ff71d

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@phernandez
phernandez merged commit 3e729c8 into main Jul 16, 2026
23 checks passed
@phernandez
phernandez deleted the codex/1029-config-load-no-phantom-dir branch July 16, 2026 15:26
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.

[BUG] Empty ~/basic-memory directory recreated on every config load (mkdir side effect in config validator)

1 participant