mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 22:21:22 -07:00
fix(core): update edit tool error type during llm judgements (#9510)
This commit is contained in:
@@ -390,8 +390,12 @@ describe('SmartEditTool', () => {
|
||||
const invocation = tool.build(params);
|
||||
const result = await invocation.execute(new AbortController().signal);
|
||||
|
||||
expect(result.error?.type).toBe(ToolErrorType.EDIT_NO_CHANGE);
|
||||
expect(result.llmContent).toMatch(/A secondary check determined/);
|
||||
expect(result.error?.type).toBe(
|
||||
ToolErrorType.EDIT_NO_CHANGE_LLM_JUDGEMENT,
|
||||
);
|
||||
expect(result.llmContent).toMatch(
|
||||
/A secondary check by an LLM determined/,
|
||||
);
|
||||
expect(fs.readFileSync(filePath, 'utf8')).toBe(initialContent); // File is unchanged
|
||||
});
|
||||
|
||||
|
||||
@@ -305,8 +305,8 @@ class EditToolInvocation implements ToolInvocation<EditToolParams, ToolResult> {
|
||||
isNewFile: false,
|
||||
error: {
|
||||
display: `No changes required. The file already meets the specified conditions.`,
|
||||
raw: `A secondary check determined that no changes were necessary to fulfill the instruction. Explanation: ${fixedEdit.explanation}. Original error with the parameters given: ${initialError.raw}`,
|
||||
type: ToolErrorType.EDIT_NO_CHANGE,
|
||||
raw: `A secondary check by an LLM determined that no changes were necessary to fulfill the instruction. Explanation: ${fixedEdit.explanation}. Original error with the parameters given: ${initialError.raw}`,
|
||||
type: ToolErrorType.EDIT_NO_CHANGE_LLM_JUDGEMENT,
|
||||
},
|
||||
originalLineEnding,
|
||||
};
|
||||
|
||||
@@ -33,6 +33,7 @@ export enum ToolErrorType {
|
||||
EDIT_NO_OCCURRENCE_FOUND = 'edit_no_occurrence_found',
|
||||
EDIT_EXPECTED_OCCURRENCE_MISMATCH = 'edit_expected_occurrence_mismatch',
|
||||
EDIT_NO_CHANGE = 'edit_no_change',
|
||||
EDIT_NO_CHANGE_LLM_JUDGEMENT = 'edit_no_change_llm_judgement',
|
||||
|
||||
// Glob-specific Errors
|
||||
GLOB_EXECUTION_ERROR = 'glob_execution_error',
|
||||
|
||||
Reference in New Issue
Block a user