Dashboard Config Provenance page ignores the TOML config lane and skips .env loading when unbound
Summary
The Dashboard Config Provenance page (/api/config endpoint) does not reflect the actual runtime configuration on a TOML-first setup (the flow produced by memorix init --global, i.e. ~/.memorix/config.toml + secrets in ~/.memorix/.env, no legacy files). Two distinct problems:
- The endpoint reads config through the legacy YAML loader only, so every value that actually comes from
config.tomlis misreported asdefault(or missing entirely). - When the dashboard is unbound (no project root), the endpoint skips
loadDotenv()entirely, so even.env-sourced keys display asnot set.
Environment
- memorix 1.7.3 (also verified the code paths on
main) - Windows 10, Node v24.14.1
- Setup:
~/.memorix/config.toml(TOML only) +~/.memorix/.envwithMEMORIX_LLM_API_KEY/MEMORIX_EMBEDDING_API_KEY/MEMORIX_RERANK_API_KEY. Nomemorix.yml, noconfig.json.
Problem 1: TOML lane is not wired into the provenance endpoint
src/dashboard/server.ts, case '/config' (~line 577):
const { loadYamlConfig } = await import('../config/yaml-loader.js');
yml = configProjectRoot ? loadYamlConfig(configProjectRoot) : loadYamlConfig(null);
loadYamlConfig() (src/config/yaml-loader.ts:160) resolves only getGlobalYamlPath() / getProjectYamlPath() — i.e. memorix.yml files. It never reads getGlobalConfigTomlPath() / getProjectConfigTomlPath() (src/config/config-paths.ts), even though the helpers exist and the runtime resolution chain (resolved-config.ts / toml-loader.ts) is TOML-first.
Observed on a bound dashboard (run memorix dashboard inside a git repo):
| Dashboard row | Shows | Actual (per memorix status) |
|---|---|---|
embedding.provider |
off / default |
api / qwen3.7-text-embedding (hybrid search active) |
git.autoHook |
false / default |
true — the post-commit hook is actually installed in the repo |
llm.model / llm.provider |
row absent | configured in TOML |
server.* |
default |
explicitly set in TOML |
| rerank lane | not tracked at all | http rerank configured |
| File matrix | only 5 legacy files | config.toml / memorix.toml never listed |
memorix status in the same project correctly reports Active config sources: TOML: ~/.memorix/config.toml, all four lanes, and git behavior — so the dashboard page is the outlier, not the resolution chain.
Problem 2: unbound dashboards skip .env loading
src/dashboard/server.ts (~line 592):
if (configProjectRoot) {
const { loadDotenv } = await import('../config/dotenv-loader.js');
loadDotenv(configProjectRoot);
}
loadDotenv() itself (src/config/dotenv-loader.ts:77-82) loads the project .env and then unconditionally falls back to the user-level ~/.memorix/.env — but the endpoint only calls it when a project root is bound. On an unbound dashboard (e.g. opened via the background control plane / HTTP server without a project binding):
- The file matrix correctly shows
user .envas existing ✓ - Yet
llm.apiKeyrenders asnot set/none, because the key was never loaded intoprocess.env
On the same machine, a bound dashboard shows the row correctly (****XXXX / .env (MEMORIX_LLM_API_KEY)), which isolates the gate on configProjectRoot as the cause.
Repro
# TOML-only setup: ~/.memorix/config.toml with [memory.llm]/[embedding]/[git], keys in ~/.memorix/.env
memorix dashboard # unbound → llm.apiKey: not set; all TOML values: default
cd <any-git-repo> && memorix dashboard # bound → llm.apiKey OK; TOML values still default
memorix status # shows the real resolved config
Suggested fixes
- Make
/api/configuse the TOML-aware resolved configuration (same chain asmemorix status), keeping YAML only as the compatibility fallback it already is at runtime; label sourcesconfig.toml/memorix.tomlaccordingly. - Load the user-level
.enveven when no project root is bound (drop the gate, or call the loader withnullso its user-level fallback still runs). - Nice to have: track the
[rerank]lane, and addconfig.toml/memorix.tomlrows to the file matrix. The page hint "memorix.yml = behavior config" is also outdated for TOML-first flows.
Happy to provide more traces if useful — thanks for the project, the memory model has been working well otherwise.
Memorix 1.8.0 is now released, including the TOML/.env/rerank provenance fix from this report. Please upgrade with npm install -g [email protected], reopen the Dashboard, and verify the Config Provenance page again. Thanks for the detailed reproduction and the clear traces.