mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 12:54:07 -07:00
chore: cleanup old smart edit settings (#15832)
This commit is contained in:
@@ -709,12 +709,6 @@ their corresponding top-level category object in your `settings.json` file.
|
|||||||
- **Default:** `undefined`
|
- **Default:** `undefined`
|
||||||
- **Requires restart:** Yes
|
- **Requires restart:** Yes
|
||||||
|
|
||||||
#### `useSmartEdit`
|
|
||||||
|
|
||||||
- **`useSmartEdit`** (boolean):
|
|
||||||
- **Description:** Enable the smart-edit tool instead of the replace tool.
|
|
||||||
- **Default:** `true`
|
|
||||||
|
|
||||||
#### `useWriteTodos`
|
#### `useWriteTodos`
|
||||||
|
|
||||||
- **`useWriteTodos`** (boolean):
|
- **`useWriteTodos`** (boolean):
|
||||||
|
|||||||
@@ -73,7 +73,6 @@ export interface CliArgs {
|
|||||||
deleteSession: string | undefined;
|
deleteSession: string | undefined;
|
||||||
includeDirectories: string[] | undefined;
|
includeDirectories: string[] | undefined;
|
||||||
screenReader: boolean | undefined;
|
screenReader: boolean | undefined;
|
||||||
useSmartEdit: boolean | undefined;
|
|
||||||
useWriteTodos: boolean | undefined;
|
useWriteTodos: boolean | undefined;
|
||||||
outputFormat: string | undefined;
|
outputFormat: string | undefined;
|
||||||
fakeResponses: string | undefined;
|
fakeResponses: string | undefined;
|
||||||
@@ -689,7 +688,6 @@ export async function loadCliConfig(
|
|||||||
truncateToolOutputLines: settings.tools?.truncateToolOutputLines,
|
truncateToolOutputLines: settings.tools?.truncateToolOutputLines,
|
||||||
enableToolOutputTruncation: settings.tools?.enableToolOutputTruncation,
|
enableToolOutputTruncation: settings.tools?.enableToolOutputTruncation,
|
||||||
eventEmitter: appEvents,
|
eventEmitter: appEvents,
|
||||||
useSmartEdit: argv.useSmartEdit ?? settings.useSmartEdit,
|
|
||||||
useWriteTodos: argv.useWriteTodos ?? settings.useWriteTodos,
|
useWriteTodos: argv.useWriteTodos ?? settings.useWriteTodos,
|
||||||
output: {
|
output: {
|
||||||
format: (argv.outputFormat ?? settings.output?.format) as OutputFormat,
|
format: (argv.outputFormat ?? settings.output?.format) as OutputFormat,
|
||||||
|
|||||||
@@ -1126,15 +1126,6 @@ const SETTINGS_SCHEMA = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
useSmartEdit: {
|
|
||||||
type: 'boolean',
|
|
||||||
label: 'Use Smart Edit',
|
|
||||||
category: 'Advanced',
|
|
||||||
requiresRestart: false,
|
|
||||||
default: true,
|
|
||||||
description: 'Enable the smart-edit tool instead of the replace tool.',
|
|
||||||
showInDialog: false,
|
|
||||||
},
|
|
||||||
useWriteTodos: {
|
useWriteTodos: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
label: 'Use WriteTodos',
|
label: 'Use WriteTodos',
|
||||||
|
|||||||
@@ -546,7 +546,6 @@ describe('gemini.tsx main function kitty protocol', () => {
|
|||||||
listExtensions: undefined,
|
listExtensions: undefined,
|
||||||
includeDirectories: undefined,
|
includeDirectories: undefined,
|
||||||
screenReader: undefined,
|
screenReader: undefined,
|
||||||
useSmartEdit: undefined,
|
|
||||||
useWriteTodos: undefined,
|
useWriteTodos: undefined,
|
||||||
resume: undefined,
|
resume: undefined,
|
||||||
listSessions: undefined,
|
listSessions: undefined,
|
||||||
|
|||||||
@@ -220,7 +220,6 @@ describe('useGeminiStream', () => {
|
|||||||
getContentGeneratorConfig: vi
|
getContentGeneratorConfig: vi
|
||||||
.fn()
|
.fn()
|
||||||
.mockReturnValue(contentGeneratorConfig),
|
.mockReturnValue(contentGeneratorConfig),
|
||||||
getUseSmartEdit: () => false,
|
|
||||||
isInteractive: () => false,
|
isInteractive: () => false,
|
||||||
getExperiments: () => {},
|
getExperiments: () => {},
|
||||||
} as unknown as Config;
|
} as unknown as Config;
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ const mockConfig = {
|
|||||||
model: 'test-model',
|
model: 'test-model',
|
||||||
authType: 'oauth-personal',
|
authType: 'oauth-personal',
|
||||||
}),
|
}),
|
||||||
getUseSmartEdit: () => false,
|
|
||||||
getGeminiClient: () => null, // No client needed for these tests
|
getGeminiClient: () => null, // No client needed for these tests
|
||||||
getShellExecutionConfig: () => ({ terminalWidth: 80, terminalHeight: 24 }),
|
getShellExecutionConfig: () => ({ terminalWidth: 80, terminalHeight: 24 }),
|
||||||
getMessageBus: () => null,
|
getMessageBus: () => null,
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import { GrepTool } from '../tools/grep.js';
|
|||||||
import { canUseRipgrep, RipGrepTool } from '../tools/ripGrep.js';
|
import { canUseRipgrep, RipGrepTool } from '../tools/ripGrep.js';
|
||||||
import { GlobTool } from '../tools/glob.js';
|
import { GlobTool } from '../tools/glob.js';
|
||||||
import { ActivateSkillTool } from '../tools/activate-skill.js';
|
import { ActivateSkillTool } from '../tools/activate-skill.js';
|
||||||
import { EditTool } from '../tools/edit.js';
|
|
||||||
import { SmartEditTool } from '../tools/smart-edit.js';
|
import { SmartEditTool } from '../tools/smart-edit.js';
|
||||||
import { ShellTool } from '../tools/shell.js';
|
import { ShellTool } from '../tools/shell.js';
|
||||||
import { WriteFileTool } from '../tools/write-file.js';
|
import { WriteFileTool } from '../tools/write-file.js';
|
||||||
@@ -329,7 +328,6 @@ export interface ConfigParameters {
|
|||||||
truncateToolOutputLines?: number;
|
truncateToolOutputLines?: number;
|
||||||
enableToolOutputTruncation?: boolean;
|
enableToolOutputTruncation?: boolean;
|
||||||
eventEmitter?: EventEmitter;
|
eventEmitter?: EventEmitter;
|
||||||
useSmartEdit?: boolean;
|
|
||||||
useWriteTodos?: boolean;
|
useWriteTodos?: boolean;
|
||||||
policyEngineConfig?: PolicyEngineConfig;
|
policyEngineConfig?: PolicyEngineConfig;
|
||||||
output?: OutputSettings;
|
output?: OutputSettings;
|
||||||
@@ -454,7 +452,6 @@ export class Config {
|
|||||||
readonly storage: Storage;
|
readonly storage: Storage;
|
||||||
private readonly fileExclusions: FileExclusions;
|
private readonly fileExclusions: FileExclusions;
|
||||||
private readonly eventEmitter?: EventEmitter;
|
private readonly eventEmitter?: EventEmitter;
|
||||||
private readonly useSmartEdit: boolean;
|
|
||||||
private readonly useWriteTodos: boolean;
|
private readonly useWriteTodos: boolean;
|
||||||
private readonly messageBus: MessageBus;
|
private readonly messageBus: MessageBus;
|
||||||
private readonly policyEngine: PolicyEngine;
|
private readonly policyEngine: PolicyEngine;
|
||||||
@@ -594,7 +591,6 @@ export class Config {
|
|||||||
this.truncateToolOutputLines =
|
this.truncateToolOutputLines =
|
||||||
params.truncateToolOutputLines ?? DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES;
|
params.truncateToolOutputLines ?? DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES;
|
||||||
this.enableToolOutputTruncation = params.enableToolOutputTruncation ?? true;
|
this.enableToolOutputTruncation = params.enableToolOutputTruncation ?? true;
|
||||||
this.useSmartEdit = params.useSmartEdit ?? true;
|
|
||||||
// // TODO(joshualitt): Re-evaluate the todo tool for 3 family.
|
// // TODO(joshualitt): Re-evaluate the todo tool for 3 family.
|
||||||
this.useWriteTodos = isPreviewModel(this.model)
|
this.useWriteTodos = isPreviewModel(this.model)
|
||||||
? false
|
? false
|
||||||
@@ -1594,10 +1590,6 @@ export class Config {
|
|||||||
return this.truncateToolOutputLines;
|
return this.truncateToolOutputLines;
|
||||||
}
|
}
|
||||||
|
|
||||||
getUseSmartEdit(): boolean {
|
|
||||||
return this.useSmartEdit;
|
|
||||||
}
|
|
||||||
|
|
||||||
getUseWriteTodos(): boolean {
|
getUseWriteTodos(): boolean {
|
||||||
return this.useWriteTodos;
|
return this.useWriteTodos;
|
||||||
}
|
}
|
||||||
@@ -1699,11 +1691,7 @@ export class Config {
|
|||||||
|
|
||||||
registerCoreTool(GlobTool, this);
|
registerCoreTool(GlobTool, this);
|
||||||
registerCoreTool(ActivateSkillTool, this);
|
registerCoreTool(ActivateSkillTool, this);
|
||||||
if (this.getUseSmartEdit()) {
|
registerCoreTool(SmartEditTool, this);
|
||||||
registerCoreTool(SmartEditTool, this);
|
|
||||||
} else {
|
|
||||||
registerCoreTool(EditTool, this);
|
|
||||||
}
|
|
||||||
registerCoreTool(WriteFileTool, this);
|
registerCoreTool(WriteFileTool, this);
|
||||||
registerCoreTool(WebFetchTool, this);
|
registerCoreTool(WebFetchTool, this);
|
||||||
registerCoreTool(ShellTool, this);
|
registerCoreTool(ShellTool, this);
|
||||||
|
|||||||
@@ -251,7 +251,6 @@ describe('Gemini Client (client.ts)', () => {
|
|||||||
getEnableHooks: vi.fn().mockReturnValue(false),
|
getEnableHooks: vi.fn().mockReturnValue(false),
|
||||||
getChatCompression: vi.fn().mockReturnValue(undefined),
|
getChatCompression: vi.fn().mockReturnValue(undefined),
|
||||||
getSkipNextSpeakerCheck: vi.fn().mockReturnValue(false),
|
getSkipNextSpeakerCheck: vi.fn().mockReturnValue(false),
|
||||||
getUseSmartEdit: vi.fn().mockReturnValue(false),
|
|
||||||
getShowModelInfoInChat: vi.fn().mockReturnValue(false),
|
getShowModelInfoInChat: vi.fn().mockReturnValue(false),
|
||||||
getContinueOnFailedApiCall: vi.fn(),
|
getContinueOnFailedApiCall: vi.fn(),
|
||||||
getProjectRoot: vi.fn().mockReturnValue('/test/project/root'),
|
getProjectRoot: vi.fn().mockReturnValue('/test/project/root'),
|
||||||
|
|||||||
@@ -255,7 +255,6 @@ function createMockConfig(overrides: Partial<Config> = {}): Config {
|
|||||||
getTruncateToolOutputLines: () => DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES,
|
getTruncateToolOutputLines: () => DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES,
|
||||||
getToolRegistry: () => defaultToolRegistry,
|
getToolRegistry: () => defaultToolRegistry,
|
||||||
getActiveModel: () => DEFAULT_GEMINI_MODEL,
|
getActiveModel: () => DEFAULT_GEMINI_MODEL,
|
||||||
getUseSmartEdit: () => false,
|
|
||||||
getGeminiClient: () => null,
|
getGeminiClient: () => null,
|
||||||
getMessageBus: () => createMockMessageBus(),
|
getMessageBus: () => createMockMessageBus(),
|
||||||
getEnableHooks: () => false,
|
getEnableHooks: () => false,
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ describe('executeToolCall', () => {
|
|||||||
DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD,
|
DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD,
|
||||||
getTruncateToolOutputLines: () => DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES,
|
getTruncateToolOutputLines: () => DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES,
|
||||||
getActiveModel: () => PREVIEW_GEMINI_MODEL,
|
getActiveModel: () => PREVIEW_GEMINI_MODEL,
|
||||||
getUseSmartEdit: () => false,
|
|
||||||
getGeminiClient: () => null, // No client needed for these tests
|
getGeminiClient: () => null, // No client needed for these tests
|
||||||
getMessageBus: () => null,
|
getMessageBus: () => null,
|
||||||
getPolicyEngine: () => null,
|
getPolicyEngine: () => null,
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ describe('ClearcutLogger', () => {
|
|||||||
|
|
||||||
it('logs all user settings', () => {
|
it('logs all user settings', () => {
|
||||||
const { logger } = setup({
|
const { logger } = setup({
|
||||||
config: { useSmartEdit: true },
|
config: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
vi.stubEnv('TERM_PROGRAM', 'vscode');
|
vi.stubEnv('TERM_PROGRAM', 'vscode');
|
||||||
|
|||||||
@@ -1748,7 +1748,6 @@ describe('loggers', () => {
|
|||||||
getSessionId: () => 'test-session-id',
|
getSessionId: () => 'test-session-id',
|
||||||
getUsageStatisticsEnabled: () => true,
|
getUsageStatisticsEnabled: () => true,
|
||||||
getContentGeneratorConfig: () => null,
|
getContentGeneratorConfig: () => null,
|
||||||
getUseSmartEdit: () => null,
|
|
||||||
isInteractive: () => false,
|
isInteractive: () => false,
|
||||||
} as unknown as Config;
|
} as unknown as Config;
|
||||||
|
|
||||||
@@ -1799,7 +1798,6 @@ describe('loggers', () => {
|
|||||||
getSessionId: () => 'test-session-id',
|
getSessionId: () => 'test-session-id',
|
||||||
getUsageStatisticsEnabled: () => true,
|
getUsageStatisticsEnabled: () => true,
|
||||||
getContentGeneratorConfig: () => null,
|
getContentGeneratorConfig: () => null,
|
||||||
getUseSmartEdit: () => null,
|
|
||||||
isInteractive: () => false,
|
isInteractive: () => false,
|
||||||
} as unknown as Config;
|
} as unknown as Config;
|
||||||
|
|
||||||
@@ -1852,7 +1850,6 @@ describe('loggers', () => {
|
|||||||
getSessionId: () => 'test-session-id',
|
getSessionId: () => 'test-session-id',
|
||||||
getUsageStatisticsEnabled: () => true,
|
getUsageStatisticsEnabled: () => true,
|
||||||
getContentGeneratorConfig: () => null,
|
getContentGeneratorConfig: () => null,
|
||||||
getUseSmartEdit: () => null,
|
|
||||||
isInteractive: () => false,
|
isInteractive: () => false,
|
||||||
} as unknown as Config;
|
} as unknown as Config;
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,6 @@ describe('SmartEditTool', () => {
|
|||||||
getUsageStatisticsEnabled: vi.fn(() => true),
|
getUsageStatisticsEnabled: vi.fn(() => true),
|
||||||
getSessionId: vi.fn(() => 'mock-session-id'),
|
getSessionId: vi.fn(() => 'mock-session-id'),
|
||||||
getContentGeneratorConfig: vi.fn(() => ({ authType: 'mock' })),
|
getContentGeneratorConfig: vi.fn(() => ({ authType: 'mock' })),
|
||||||
getUseSmartEdit: vi.fn(() => false),
|
|
||||||
getProxy: vi.fn(() => undefined),
|
getProxy: vi.fn(() => undefined),
|
||||||
getGeminiClient: vi.fn().mockReturnValue(geminiClient),
|
getGeminiClient: vi.fn().mockReturnValue(geminiClient),
|
||||||
getBaseLlmClient: vi.fn().mockReturnValue(baseLlmClient),
|
getBaseLlmClient: vi.fn().mockReturnValue(baseLlmClient),
|
||||||
|
|||||||
@@ -1172,13 +1172,6 @@
|
|||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
"useSmartEdit": {
|
|
||||||
"title": "Use Smart Edit",
|
|
||||||
"description": "Enable the smart-edit tool instead of the replace tool.",
|
|
||||||
"markdownDescription": "Enable the smart-edit tool instead of the replace tool.\n\n- Category: `Advanced`\n- Requires restart: `no`\n- Default: `true`",
|
|
||||||
"default": true,
|
|
||||||
"type": "boolean"
|
|
||||||
},
|
|
||||||
"useWriteTodos": {
|
"useWriteTodos": {
|
||||||
"title": "Use WriteTodos",
|
"title": "Use WriteTodos",
|
||||||
"description": "Enable the write_todos tool.",
|
"description": "Enable the write_todos tool.",
|
||||||
|
|||||||
Reference in New Issue
Block a user