Dashboard Deduplicate always reports "requires a configured memory LLM" — maintenance path never calls initLLM()
Environment
- memorix v1.8.0 (latest on npm), Windows 10, Node v24.14.1
- Memory LLM fully configured and verified working:
~/.memorix/config.toml→[memory.llm]withprovider = "openai"and a custom OpenAI-compatiblebase_url~/.memorix/.env→MEMORIX_LLM_API_KEY(curl against the same endpoint/model returns completions fine)
Repro
- Run
memorix dashboard(standalone) in a git project, open Observations, click Deduplicate. - Preview is always unavailable:
"Intelligent deduplication requires a configured memory LLM."
Direct API calls show config is visible to the same process, yet the gate fails:
$ curl -X POST .../api/maintenance/deduplicate/preview
{"action":"deduplicate","available":false,"reason":"Intelligent deduplication requires a configured memory LLM."}
$ curl .../api/config
[... {"key":"llm.apiKey","value":"****xxxx","source":".env"}, ...]
Reproduces identically on the control-plane dashboard (memorix serve-http → same endpoint with ?project=).
Root cause
previewDeduplicate()insrc/dashboard/maintenance.tsgates onisLLMEnabled().isLLMEnabled()only reflectscurrentConfiginsidesrc/llm/provider.ts, which is set solely byinitLLM().- Neither the standalone dashboard server nor the serve-http
/api/maintenance/...routes ever callinitLLM():server.ts:389(initLLM()insideinitializeProjectRuntime()) only runs in the MCP session runtime path — maintenance APIs bypass it.- The lazy
if (!isLLMEnabled()) initLLM();insrc/store/orama-store.tsonly triggers on the thorough-search path, also not hit by maintenance.
So isLLMEnabled() is permanently false in dashboard processes regardless of configuration.
Suggested fix
Call initLLM() at the top of previewDeduplicate() (it is idempotent, and getLLMApiKey() → getResolvedMemoryLane() triggers loadDotenv(), so ~/.memorix/.env is picked up) — or initialize the LLM once at dashboard/serve-http startup.
Local workaround (verified)
Patching the CLI bundle so previewDeduplicate starts with initLLM(); immediately returns available: true and the preview works end-to-end with the same config.
(Context: #227 added the Deduplicate action.)
Fixed in Memorix 1.8.2.
The Dashboard deduplication maintenance path now idempotently initializes the selected project's memory LLM from its project TOML and .env for both standalone and HTTP dashboard APIs. With no configuration it remains clearly unavailable, and credentials are not exposed.
Upgrade with npm install -g [email protected], reopen the Dashboard, and run the deduplication preview to verify the configured project is used.