From d07c63fdf9f3e3c6ac1aebb306de53dffe49749d Mon Sep 17 00:00:00 2001 From: Gergo Magyar Date: Thu, 18 Jun 2026 15:54:21 +0000 Subject: [PATCH] fix(embeddings): resolve server-mapping path for parity with clone/upload roots MAPPING_FILE now wraps path.resolve() like CLONE_ROOT (git-clone.ts) and UPLOAD_ROOT (upload-paths.ts), so a relative GITNEXUS_HOME yields an absolute path. No-op for the supported absolute-GITNEXUS_HOME config (Docker) and for readServerMapping's only caller (run-analyze.ts). Co-Authored-By: Claude Opus 4.8 (1M context) --- gitnexus/src/core/embeddings/server-mapping.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gitnexus/src/core/embeddings/server-mapping.ts b/gitnexus/src/core/embeddings/server-mapping.ts index 00cf0f0da..77a7de445 100644 --- a/gitnexus/src/core/embeddings/server-mapping.ts +++ b/gitnexus/src/core/embeddings/server-mapping.ts @@ -10,8 +10,10 @@ import path from 'path'; import { getGlobalDir } from '../../storage/repo-manager.js'; // Sourced from getGlobalDir() so it honors GITNEXUS_HOME (the Docker image sets -// GITNEXUS_HOME=/data/gitnexus); falls back to ~/.gitnexus when unset. -const MAPPING_FILE = path.join(getGlobalDir(), 'server-mapping.json'); +// GITNEXUS_HOME=/data/gitnexus); falls back to ~/.gitnexus when unset. Wrapped in +// path.resolve() for parity with the clone/upload roots (git-clone.ts CLONE_ROOT, +// upload-paths.ts UPLOAD_ROOT) so a relative GITNEXUS_HOME still yields an absolute path. +const MAPPING_FILE = path.resolve(path.join(getGlobalDir(), 'server-mapping.json')); let cachedMapping: Record | null = null;