mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 11:34:44 -07:00
feat(core): instrument file system tools for JIT context discovery (#22082)
This commit is contained in:
@@ -50,6 +50,7 @@ import { WRITE_FILE_DEFINITION } from './definitions/coreTools.js';
|
||||
import { resolveToolDeclaration } from './definitions/resolver.js';
|
||||
import { detectOmissionPlaceholders } from './omissionPlaceholderDetector.js';
|
||||
import { isGemini3Model } from '../config/models.js';
|
||||
import { discoverJitContext, appendJitContext } from './jit-context.js';
|
||||
|
||||
/**
|
||||
* Parameters for the WriteFile tool
|
||||
@@ -391,8 +392,18 @@ class WriteFileToolInvocation extends BaseToolInvocation<
|
||||
isNewFile,
|
||||
};
|
||||
|
||||
// Discover JIT subdirectory context for the written 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) {
|
||||
|
||||
Reference in New Issue
Block a user