From 8c8ec7ca94128deffe4b486f5c5e7d7f14e69c68 Mon Sep 17 00:00:00 2001 From: gnanam1990 Date: Fri, 10 Apr 2026 08:34:46 +0530 Subject: [PATCH] fix: honor REPO_MAP runtime env var in addition to compile-time flag Addresses review feedback from @Vasanthdev2004: the docs advertised REPO_MAP=1 openclaude as the enablement path, but the gate in getRepoMapContext only checked feature('REPO_MAP'), which is compile-time and hardcoded to false in the open build. The env var was effectively a no-op. Now getRepoMapContext enables auto-injection when EITHER the compile-time flag is true OR the runtime env var REPO_MAP is truthy. This makes the documented enablement path actually work without requiring users to edit scripts/build.ts and rebuild. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/context.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/context.ts b/src/context.ts index 581d1193..e7a2ed99 100644 --- a/src/context.ts +++ b/src/context.ts @@ -113,7 +113,10 @@ export const getGitStatus = memoize(async (): Promise => { export const getRepoMapContext = memoize( async (): Promise => { - if (!feature('REPO_MAP')) return null + // Enable via compile-time feature flag OR runtime env var. + // The runtime env var lets users enable auto-injection without rebuilding. + const runtimeEnabled = isEnvTruthy(process.env.REPO_MAP) + if (!feature('REPO_MAP') && !runtimeEnabled) return null if (isBareMode()) return null if (isEnvTruthy(process.env.CLAUDE_CODE_REMOTE)) return null