feat(core): instrument file system tools for JIT context discovery (#22082)

This commit is contained in:
Sandy Tao
2026-03-12 20:44:42 -07:00
committed by GitHub
parent d44615ac2f
commit 7b4a822b0e
14 changed files with 523 additions and 2 deletions
+12 -1
View File
@@ -57,6 +57,7 @@ import levenshtein from 'fast-levenshtein';
import { EDIT_DEFINITION } from './definitions/coreTools.js';
import { resolveToolDeclaration } from './definitions/resolver.js';
import { detectOmissionPlaceholders } from './omissionPlaceholderDetector.js';
import { discoverJitContext, appendJitContext } from './jit-context.js';
const ENABLE_FUZZY_MATCH_RECOVERY = true;
const FUZZY_MATCH_THRESHOLD = 0.1; // Allow up to 10% weighted difference
@@ -937,8 +938,18 @@ ${snippet}`);
);
}
// Discover JIT subdirectory context for the edited file path
const jitContext = await discoverJitContext(
this.config,
this.resolvedPath,
);
let llmContent = llmSuccessMessageParts.join(' ');
if (jitContext) {
llmContent = appendJitContext(llmContent, jitContext);
}
return {
llmContent: llmSuccessMessageParts.join(' '),
llmContent,
returnDisplay: displayResult,
};
} catch (error) {