diff --git a/src/resources/extensions/sf/code-intelligence.ts b/src/resources/extensions/sf/code-intelligence.ts index aab552625..e92e2c676 100644 --- a/src/resources/extensions/sf/code-intelligence.ts +++ b/src/resources/extensions/sf/code-intelligence.ts @@ -145,12 +145,12 @@ const DEFAULT_SIFT_WARMUP_HARD_TIMEOUT_SEC = 30; const SIFT_WARMUP_KILL_GRACE_SEC = 10; function resolveSiftWarmupRuntimeDirs(projectRoot: string): { - cacheHome: string; + searchCache: string; tmpDir: string; } { const runtimeRoot = join(projectRoot, ".sf", "runtime", "sift"); return { - cacheHome: join(runtimeRoot, "xdg-cache"), + searchCache: join(runtimeRoot, "search-cache"), tmpDir: join(runtimeRoot, "tmp"), }; } @@ -162,7 +162,7 @@ function buildSiftWarmupEnv( const dirs = resolveSiftWarmupRuntimeDirs(projectRoot); return { ...env, - XDG_CACHE_HOME: dirs.cacheHome, + SIFT_SEARCH_CACHE: dirs.searchCache, TMPDIR: dirs.tmpDir, }; } @@ -513,7 +513,7 @@ export function ensureSiftIndexWarmup( try { const runtimeDirs = resolveSiftWarmupRuntimeDirs(projectRoot); mkdirSync(join(projectRoot, ".sf", "runtime"), { recursive: true }); - mkdirSync(runtimeDirs.cacheHome, { recursive: true }); + mkdirSync(runtimeDirs.searchCache, { recursive: true }); mkdirSync(runtimeDirs.tmpDir, { recursive: true }); const childEnv = buildSiftWarmupEnv(projectRoot, env); writeFileSync( @@ -527,7 +527,7 @@ export function ensureSiftIndexWarmup( args, siftBinary: detection.binaryPath, hardTimeoutSec: wrapper?.timeoutSec ?? null, - cacheHome: runtimeDirs.cacheHome, + searchCache: runtimeDirs.searchCache, tmpDir: runtimeDirs.tmpDir, }, null, @@ -820,7 +820,7 @@ function buildSiftContextLines( '`--strategy path-hybrid` for path-heavy queries, and `sift search --agent ""` for bounded planner-driven exploration.', ); lines.push( - "- SF runs Sift warmup with project-scoped cache/temp directories under `.sf/runtime/sift/`; " + + "- SF runs Sift warmup with a project-scoped `SIFT_SEARCH_CACHE` under `.sf/runtime/sift/` while leaving model cache shared; " + "if the CLI is missing or fails, continue with `.sf/CODEBASE.md`, native `grep`/`find`/`ls`, `lsp`, and scout.", ); } else { @@ -989,7 +989,7 @@ export function formatSiftStatus( 'When configured, agents should use `sift search --json ""`; `page-index-hybrid` is the strongest direct-search preset and `path-hybrid` is best for path-heavy queries.', ); lines.push( - "SF runs Sift warmup with project-scoped cache/temp directories under .sf/runtime/sift/.", + "SF runs Sift warmup with a project-scoped SIFT_SEARCH_CACHE under .sf/runtime/sift/ while leaving model cache shared.", ); return lines.join("\n"); } diff --git a/src/resources/extensions/sf/tests/code-intelligence.test.ts b/src/resources/extensions/sf/tests/code-intelligence.test.ts index 6e64a6cdb..d3babc31d 100644 --- a/src/resources/extensions/sf/tests/code-intelligence.test.ts +++ b/src/resources/extensions/sf/tests/code-intelligence.test.ts @@ -529,8 +529,8 @@ test("ensureSiftIndexWarmup defaults optional warmup hard cap to 30 seconds", () ]); assert.match(result.reason, /hard cap 30s/); assert.equal( - calls[0].options?.env?.XDG_CACHE_HOME, - join(projectRoot, ".sf", "runtime", "sift", "xdg-cache"), + calls[0].options?.env?.SIFT_SEARCH_CACHE, + join(projectRoot, ".sf", "runtime", "sift", "search-cache"), ); assert.equal( calls[0].options?.env?.TMPDIR, @@ -543,8 +543,8 @@ test("ensureSiftIndexWarmup defaults optional warmup hard cap to 30 seconds", () ), ); assert.equal( - marker.cacheHome, - join(projectRoot, ".sf", "runtime", "sift", "xdg-cache"), + marker.searchCache, + join(projectRoot, ".sf", "runtime", "sift", "search-cache"), ); assert.equal( marker.tmpDir,