mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 18:44:30 -07:00
feat(core): enable disableLLMCorrection by default (#17223)
This commit is contained in:
@@ -120,7 +120,7 @@ describe('EditTool', () => {
|
||||
setGeminiMdFileCount: vi.fn(),
|
||||
getToolRegistry: () => ({}) as any,
|
||||
isInteractive: () => false,
|
||||
getDisableLLMCorrection: vi.fn(() => false),
|
||||
getDisableLLMCorrection: vi.fn(() => true),
|
||||
getExperiments: () => {},
|
||||
} as unknown as Config;
|
||||
|
||||
@@ -436,6 +436,10 @@ describe('EditTool', () => {
|
||||
|
||||
it('should return error if old_string is not found in file', async () => {
|
||||
fs.writeFileSync(filePath, 'Some content.', 'utf8');
|
||||
|
||||
// Enable LLM correction for this test
|
||||
(mockConfig.getDisableLLMCorrection as Mock).mockReturnValue(false);
|
||||
|
||||
const params: EditToolParams = {
|
||||
file_path: filePath,
|
||||
instruction: 'Replace non-existent text',
|
||||
@@ -455,6 +459,10 @@ describe('EditTool', () => {
|
||||
const initialContent = 'This is some original text.';
|
||||
const finalContent = 'This is some brand new text.';
|
||||
fs.writeFileSync(filePath, initialContent, 'utf8');
|
||||
|
||||
// Enable LLM correction for this test
|
||||
(mockConfig.getDisableLLMCorrection as Mock).mockReturnValue(false);
|
||||
|
||||
const params: EditToolParams = {
|
||||
file_path: filePath,
|
||||
instruction: 'Replace original with brand new',
|
||||
@@ -515,6 +523,10 @@ describe('EditTool', () => {
|
||||
it('should return NO_CHANGE if FixLLMEditWithInstruction determines no changes are needed', async () => {
|
||||
const initialContent = 'The price is $100.';
|
||||
fs.writeFileSync(filePath, initialContent, 'utf8');
|
||||
|
||||
// Enable LLM correction for this test
|
||||
(mockConfig.getDisableLLMCorrection as Mock).mockReturnValue(false);
|
||||
|
||||
const params: EditToolParams = {
|
||||
file_path: filePath,
|
||||
instruction: 'Ensure the price is $100',
|
||||
@@ -556,6 +568,9 @@ describe('EditTool', () => {
|
||||
'This is the externally modified content.';
|
||||
fs.writeFileSync(filePath, initialContent, 'utf8');
|
||||
|
||||
// Enable LLM correction for this test
|
||||
(mockConfig.getDisableLLMCorrection as Mock).mockReturnValue(false);
|
||||
|
||||
const params: EditToolParams = {
|
||||
file_path: filePath,
|
||||
instruction:
|
||||
@@ -882,11 +897,11 @@ describe('EditTool', () => {
|
||||
expect(mockFixLLMEditWithInstruction).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should call FixLLMEditWithInstruction when disableLLMCorrection is false (default)', async () => {
|
||||
it('should call FixLLMEditWithInstruction when disableLLMCorrection is false', async () => {
|
||||
const filePath = path.join(rootDir, 'enable_llm_test.txt');
|
||||
fs.writeFileSync(filePath, 'Some content.', 'utf8');
|
||||
|
||||
// Default is false, but being explicit
|
||||
// Now explicit as it's not the default anymore
|
||||
(mockConfig.getDisableLLMCorrection as Mock).mockReturnValue(false);
|
||||
|
||||
const params: EditToolParams = {
|
||||
|
||||
Reference in New Issue
Block a user