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