فهرست منبع

fix: add USERPROFILE fallback for Windows HOME resolution

On Windows, `HOME` is not a standard environment variable — the
equivalent is `USERPROFILE`. When MCP clients (e.g. Claude Code)
spawn the QMD server as a subprocess, they pass `USERPROFILE` but
not `HOME`. This causes QMD to fall back to `/tmp`, opening an
empty database instead of the user's actual index.

Fix: check `USERPROFILE` before falling back to `/tmp`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
max0n232 1 ماه پیش
والد
کامیت
77e71d09f2
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      src/store.ts

+ 1 - 1
src/store.ts

@@ -38,7 +38,7 @@ import type {
 // Configuration
 // =============================================================================
 
-const HOME = process.env.HOME || "/tmp";
+const HOME = process.env.HOME || process.env.USERPROFILE || "/tmp";
 export const DEFAULT_EMBED_MODEL = "embeddinggemma";
 export const DEFAULT_RERANK_MODEL = "ExpedientFalcon/qwen3-reranker:0.6b-q8_0";
 export const DEFAULT_QUERY_MODEL = "Qwen/Qwen3-1.7B";