mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-28 05:55:17 -07:00
Utilize pipelining of grep_search -> read_file to eliminate turns (#19574)
This commit is contained in:
committed by
GitHub
parent
727f9b67b1
commit
5d98ed5820
@@ -30,6 +30,7 @@ import { ApprovalMode } from '../policy/types.js';
|
||||
import { CoreToolCallStatus } from '../scheduler/types.js';
|
||||
|
||||
import { DEFAULT_DIFF_OPTIONS, getDiffStat } from './diffOptions.js';
|
||||
import { getDiffContextSnippet } from './diff-utils.js';
|
||||
import {
|
||||
type ModifiableDeclarativeTool,
|
||||
type ModifyContext,
|
||||
@@ -871,6 +872,16 @@ class EditToolInvocation
|
||||
? `Created new file: ${this.params.file_path} with provided content.`
|
||||
: `Successfully modified file: ${this.params.file_path} (${editData.occurrences} replacements).`,
|
||||
];
|
||||
|
||||
// Return a diff of the file before and after the write so that the agent
|
||||
// can avoid the need to spend a turn doing a verification read.
|
||||
const snippet = getDiffContextSnippet(
|
||||
editData.currentContent ?? '',
|
||||
finalContent,
|
||||
5,
|
||||
);
|
||||
llmSuccessMessageParts.push(`Here is the updated code:
|
||||
${snippet}`);
|
||||
const fuzzyFeedback = getFuzzyMatchFeedback(editData);
|
||||
if (fuzzyFeedback) {
|
||||
llmSuccessMessageParts.push(fuzzyFeedback);
|
||||
|
||||
Reference in New Issue
Block a user