refactor(config): remove enablePromptCompletion from settings (#19974)

This commit is contained in:
Sehoon Shon
2026-02-22 19:10:20 -05:00
committed by GitHub
parent a91bc60e18
commit c537fd5aec
13 changed files with 40 additions and 86 deletions
+10 -11
View File
@@ -22,17 +22,16 @@ they appear in the UI.
### General ### General
| UI Label | Setting | Description | Default | | UI Label | Setting | Description | Default |
| ------------------------ | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | | ----------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- |
| Vim Mode | `general.vimMode` | Enable Vim keybindings | `false` | | Vim Mode | `general.vimMode` | Enable Vim keybindings | `false` |
| Default Approval Mode | `general.defaultApprovalMode` | The default approval mode for tool execution. 'default' prompts for approval, 'auto_edit' auto-approves edit tools, and 'plan' is read-only mode. 'yolo' is not supported yet. | `"default"` | | Default Approval Mode | `general.defaultApprovalMode` | The default approval mode for tool execution. 'default' prompts for approval, 'auto_edit' auto-approves edit tools, and 'plan' is read-only mode. 'yolo' is not supported yet. | `"default"` |
| Enable Auto Update | `general.enableAutoUpdate` | Enable automatic updates. | `true` | | Enable Auto Update | `general.enableAutoUpdate` | Enable automatic updates. | `true` |
| Enable Notifications | `general.enableNotifications` | Enable run-event notifications for action-required prompts and session completion. Currently macOS only. | `false` | | Enable Notifications | `general.enableNotifications` | Enable run-event notifications for action-required prompts and session completion. Currently macOS only. | `false` |
| Plan Directory | `general.plan.directory` | The directory where planning artifacts are stored. If not specified, defaults to the system temporary directory. | `undefined` | | Plan Directory | `general.plan.directory` | The directory where planning artifacts are stored. If not specified, defaults to the system temporary directory. | `undefined` |
| Enable Prompt Completion | `general.enablePromptCompletion` | Enable AI-powered prompt completion suggestions while typing. | `false` | | Debug Keystroke Logging | `general.debugKeystrokeLogging` | Enable debug logging of keystrokes to the console. | `false` |
| Debug Keystroke Logging | `general.debugKeystrokeLogging` | Enable debug logging of keystrokes to the console. | `false` | | Enable Session Cleanup | `general.sessionRetention.enabled` | Enable automatic session cleanup | `false` |
| Enable Session Cleanup | `general.sessionRetention.enabled` | Enable automatic session cleanup | `false` | | Keep chat history | `general.sessionRetention.maxAge` | Automatically delete chats older than this time period (e.g., "30d", "7d", "24h", "1w") | `undefined` |
| Keep chat history | `general.sessionRetention.maxAge` | Automatically delete chats older than this time period (e.g., "30d", "7d", "24h", "1w") | `undefined` |
### Output ### Output
-6
View File
@@ -137,12 +137,6 @@ their corresponding top-level category object in your `settings.json` file.
- **Default:** `undefined` - **Default:** `undefined`
- **Requires restart:** Yes - **Requires restart:** Yes
- **`general.enablePromptCompletion`** (boolean):
- **Description:** Enable AI-powered prompt completion suggestions while
typing.
- **Default:** `false`
- **Requires restart:** Yes
- **`general.retryFetchErrors`** (boolean): - **`general.retryFetchErrors`** (boolean):
- **Description:** Retry on "exception TypeError: fetch failed sending - **Description:** Retry on "exception TypeError: fetch failed sending
request" errors. request" errors.
-1
View File
@@ -848,7 +848,6 @@ export async function loadCliConfig(
enableShellOutputEfficiency: enableShellOutputEfficiency:
settings.tools?.shell?.enableShellOutputEfficiency ?? true, settings.tools?.shell?.enableShellOutputEfficiency ?? true,
skipNextSpeakerCheck: settings.model?.skipNextSpeakerCheck, skipNextSpeakerCheck: settings.model?.skipNextSpeakerCheck,
enablePromptCompletion: settings.general?.enablePromptCompletion,
truncateToolOutputThreshold: settings.tools?.truncateToolOutputThreshold, truncateToolOutputThreshold: settings.tools?.truncateToolOutputThreshold,
eventEmitter: coreEvents, eventEmitter: coreEvents,
useWriteTodos: argv.useWriteTodos ?? settings.useWriteTodos, useWriteTodos: argv.useWriteTodos ?? settings.useWriteTodos,
-10
View File
@@ -287,16 +287,6 @@ const SETTINGS_SCHEMA = {
}, },
}, },
}, },
enablePromptCompletion: {
type: 'boolean',
label: 'Enable Prompt Completion',
category: 'General',
requiresRestart: true,
default: false,
description:
'Enable AI-powered prompt completion suggestions while typing.',
showInDialog: true,
},
retryFetchErrors: { retryFetchErrors: {
type: 'boolean', type: 'boolean',
label: 'Retry Fetch Errors', label: 'Retry Fetch Errors',
@@ -131,7 +131,6 @@ describe('Settings Repro', () => {
}, },
general: { general: {
debugKeystrokeLogging: false, debugKeystrokeLogging: false,
enablePromptCompletion: false,
preferredEditor: 'vim', preferredEditor: 'vim',
vimMode: false, vimMode: false,
}, },
@@ -128,7 +128,6 @@ export const createMockConfig = (overrides: Partial<Config> = {}): Config =>
getShellToolInactivityTimeout: vi.fn().mockReturnValue(300000), getShellToolInactivityTimeout: vi.fn().mockReturnValue(300000),
getShellExecutionConfig: vi.fn().mockReturnValue({}), getShellExecutionConfig: vi.fn().mockReturnValue({}),
setShellExecutionConfig: vi.fn(), setShellExecutionConfig: vi.fn(),
getEnablePromptCompletion: vi.fn().mockReturnValue(false),
getEnableToolOutputTruncation: vi.fn().mockReturnValue(true), getEnableToolOutputTruncation: vi.fn().mockReturnValue(true),
getTruncateToolOutputThreshold: vi.fn().mockReturnValue(1000), getTruncateToolOutputThreshold: vi.fn().mockReturnValue(1000),
getTruncateToolOutputLines: vi.fn().mockReturnValue(100), getTruncateToolOutputLines: vi.fn().mockReturnValue(100),
@@ -1620,7 +1620,6 @@ describe('SettingsDialog', () => {
vimMode: true, vimMode: true,
enableAutoUpdate: false, enableAutoUpdate: false,
debugKeystrokeLogging: true, debugKeystrokeLogging: true,
enablePromptCompletion: true,
}, },
ui: { ui: {
hideWindowTitle: true, hideWindowTitle: true,
@@ -1766,7 +1765,6 @@ describe('SettingsDialog', () => {
vimMode: false, vimMode: false,
enableAutoUpdate: true, enableAutoUpdate: true,
debugKeystrokeLogging: false, debugKeystrokeLogging: false,
enablePromptCompletion: false,
}, },
ui: { ui: {
hideWindowTitle: false, hideWindowTitle: false,
@@ -25,15 +25,15 @@ exports[`SettingsDialog > Initial Rendering > should render settings list with v
│ Plan Directory undefined │ │ Plan Directory undefined │
│ The directory where planning artifacts are stored. If not specified, defaults t… │ │ The directory where planning artifacts are stored. If not specified, defaults t… │
│ │ │ │
│ Enable Prompt Completion false │
│ Enable AI-powered prompt completion suggestions while typing. │
│ │
│ Debug Keystroke Logging false │ │ Debug Keystroke Logging false │
│ Enable debug logging of keystrokes to the console. │ │ Enable debug logging of keystrokes to the console. │
│ │ │ │
│ Enable Session Cleanup false │ │ Enable Session Cleanup false │
│ Enable automatic session cleanup │ │ Enable automatic session cleanup │
│ │ │ │
│ Keep chat history undefined │
│ Automatically delete chats older than this time period (e.g., "30d", "7d", "24h… │
│ │
│ ▼ │ │ ▼ │
│ │ │ │
│ Apply To │ │ Apply To │
@@ -72,15 +72,15 @@ exports[`SettingsDialog > Snapshot Tests > should render 'accessibility settings
│ Plan Directory undefined │ │ Plan Directory undefined │
│ The directory where planning artifacts are stored. If not specified, defaults t… │ │ The directory where planning artifacts are stored. If not specified, defaults t… │
│ │ │ │
│ Enable Prompt Completion false │
│ Enable AI-powered prompt completion suggestions while typing. │
│ │
│ Debug Keystroke Logging false │ │ Debug Keystroke Logging false │
│ Enable debug logging of keystrokes to the console. │ │ Enable debug logging of keystrokes to the console. │
│ │ │ │
│ Enable Session Cleanup false │ │ Enable Session Cleanup false │
│ Enable automatic session cleanup │ │ Enable automatic session cleanup │
│ │ │ │
│ Keep chat history undefined │
│ Automatically delete chats older than this time period (e.g., "30d", "7d", "24h… │
│ │
│ ▼ │ │ ▼ │
│ │ │ │
│ Apply To │ │ Apply To │
@@ -119,15 +119,15 @@ exports[`SettingsDialog > Snapshot Tests > should render 'all boolean settings d
│ Plan Directory undefined │ │ Plan Directory undefined │
│ The directory where planning artifacts are stored. If not specified, defaults t… │ │ The directory where planning artifacts are stored. If not specified, defaults t… │
│ │ │ │
│ Enable Prompt Completion false* │
│ Enable AI-powered prompt completion suggestions while typing. │
│ │
│ Debug Keystroke Logging false* │ │ Debug Keystroke Logging false* │
│ Enable debug logging of keystrokes to the console. │ │ Enable debug logging of keystrokes to the console. │
│ │ │ │
│ Enable Session Cleanup false │ │ Enable Session Cleanup false │
│ Enable automatic session cleanup │ │ Enable automatic session cleanup │
│ │ │ │
│ Keep chat history undefined │
│ Automatically delete chats older than this time period (e.g., "30d", "7d", "24h… │
│ │
│ ▼ │ │ ▼ │
│ │ │ │
│ Apply To │ │ Apply To │
@@ -166,15 +166,15 @@ exports[`SettingsDialog > Snapshot Tests > should render 'default state' correct
│ Plan Directory undefined │ │ Plan Directory undefined │
│ The directory where planning artifacts are stored. If not specified, defaults t… │ │ The directory where planning artifacts are stored. If not specified, defaults t… │
│ │ │ │
│ Enable Prompt Completion false │
│ Enable AI-powered prompt completion suggestions while typing. │
│ │
│ Debug Keystroke Logging false │ │ Debug Keystroke Logging false │
│ Enable debug logging of keystrokes to the console. │ │ Enable debug logging of keystrokes to the console. │
│ │ │ │
│ Enable Session Cleanup false │ │ Enable Session Cleanup false │
│ Enable automatic session cleanup │ │ Enable automatic session cleanup │
│ │ │ │
│ Keep chat history undefined │
│ Automatically delete chats older than this time period (e.g., "30d", "7d", "24h… │
│ │
│ ▼ │ │ ▼ │
│ │ │ │
│ Apply To │ │ Apply To │
@@ -213,15 +213,15 @@ exports[`SettingsDialog > Snapshot Tests > should render 'file filtering setting
│ Plan Directory undefined │ │ Plan Directory undefined │
│ The directory where planning artifacts are stored. If not specified, defaults t… │ │ The directory where planning artifacts are stored. If not specified, defaults t… │
│ │ │ │
│ Enable Prompt Completion false │
│ Enable AI-powered prompt completion suggestions while typing. │
│ │
│ Debug Keystroke Logging false │ │ Debug Keystroke Logging false │
│ Enable debug logging of keystrokes to the console. │ │ Enable debug logging of keystrokes to the console. │
│ │ │ │
│ Enable Session Cleanup false │ │ Enable Session Cleanup false │
│ Enable automatic session cleanup │ │ Enable automatic session cleanup │
│ │ │ │
│ Keep chat history undefined │
│ Automatically delete chats older than this time period (e.g., "30d", "7d", "24h… │
│ │
│ ▼ │ │ ▼ │
│ │ │ │
│ Apply To │ │ Apply To │
@@ -260,15 +260,15 @@ exports[`SettingsDialog > Snapshot Tests > should render 'focused on scope selec
│ Plan Directory undefined │ │ Plan Directory undefined │
│ The directory where planning artifacts are stored. If not specified, defaults t… │ │ The directory where planning artifacts are stored. If not specified, defaults t… │
│ │ │ │
│ Enable Prompt Completion false │
│ Enable AI-powered prompt completion suggestions while typing. │
│ │
│ Debug Keystroke Logging false │ │ Debug Keystroke Logging false │
│ Enable debug logging of keystrokes to the console. │ │ Enable debug logging of keystrokes to the console. │
│ │ │ │
│ Enable Session Cleanup false │ │ Enable Session Cleanup false │
│ Enable automatic session cleanup │ │ Enable automatic session cleanup │
│ │ │ │
│ Keep chat history undefined │
│ Automatically delete chats older than this time period (e.g., "30d", "7d", "24h… │
│ │
│ ▼ │ │ ▼ │
│ │ │ │
│ > Apply To │ │ > Apply To │
@@ -307,15 +307,15 @@ exports[`SettingsDialog > Snapshot Tests > should render 'mixed boolean and numb
│ Plan Directory undefined │ │ Plan Directory undefined │
│ The directory where planning artifacts are stored. If not specified, defaults t… │ │ The directory where planning artifacts are stored. If not specified, defaults t… │
│ │ │ │
│ Enable Prompt Completion false │
│ Enable AI-powered prompt completion suggestions while typing. │
│ │
│ Debug Keystroke Logging false │ │ Debug Keystroke Logging false │
│ Enable debug logging of keystrokes to the console. │ │ Enable debug logging of keystrokes to the console. │
│ │ │ │
│ Enable Session Cleanup false │ │ Enable Session Cleanup false │
│ Enable automatic session cleanup │ │ Enable automatic session cleanup │
│ │ │ │
│ Keep chat history undefined │
│ Automatically delete chats older than this time period (e.g., "30d", "7d", "24h… │
│ │
│ ▼ │ │ ▼ │
│ │ │ │
│ Apply To │ │ Apply To │
@@ -354,15 +354,15 @@ exports[`SettingsDialog > Snapshot Tests > should render 'tools and security set
│ Plan Directory undefined │ │ Plan Directory undefined │
│ The directory where planning artifacts are stored. If not specified, defaults t… │ │ The directory where planning artifacts are stored. If not specified, defaults t… │
│ │ │ │
│ Enable Prompt Completion false │
│ Enable AI-powered prompt completion suggestions while typing. │
│ │
│ Debug Keystroke Logging false │ │ Debug Keystroke Logging false │
│ Enable debug logging of keystrokes to the console. │ │ Enable debug logging of keystrokes to the console. │
│ │ │ │
│ Enable Session Cleanup false │ │ Enable Session Cleanup false │
│ Enable automatic session cleanup │ │ Enable automatic session cleanup │
│ │ │ │
│ Keep chat history undefined │
│ Automatically delete chats older than this time period (e.g., "30d", "7d", "24h… │
│ │
│ ▼ │ │ ▼ │
│ │ │ │
│ Apply To │ │ Apply To │
@@ -401,15 +401,15 @@ exports[`SettingsDialog > Snapshot Tests > should render 'various boolean settin
│ Plan Directory undefined │ │ Plan Directory undefined │
│ The directory where planning artifacts are stored. If not specified, defaults t… │ │ The directory where planning artifacts are stored. If not specified, defaults t… │
│ │ │ │
│ Enable Prompt Completion true* │
│ Enable AI-powered prompt completion suggestions while typing. │
│ │
│ Debug Keystroke Logging true* │ │ Debug Keystroke Logging true* │
│ Enable debug logging of keystrokes to the console. │ │ Enable debug logging of keystrokes to the console. │
│ │ │ │
│ Enable Session Cleanup false │ │ Enable Session Cleanup false │
│ Enable automatic session cleanup │ │ Enable automatic session cleanup │
│ │ │ │
│ Keep chat history undefined │
│ Automatically delete chats older than this time period (e.g., "30d", "7d", "24h… │
│ │
│ ▼ │ │ ▼ │
│ │ │ │
│ Apply To │ │ Apply To │
@@ -94,7 +94,6 @@ const setupMocks = ({
describe('useCommandCompletion', () => { describe('useCommandCompletion', () => {
const mockCommandContext = {} as CommandContext; const mockCommandContext = {} as CommandContext;
const mockConfig = { const mockConfig = {
getEnablePromptCompletion: () => false,
getGeminiClient: vi.fn(), getGeminiClient: vi.fn(),
} as unknown as Config; } as unknown as Config;
const testRootDir = '/'; const testRootDir = '/';
@@ -499,7 +498,6 @@ describe('useCommandCompletion', () => {
describe('prompt completion filtering', () => { describe('prompt completion filtering', () => {
it('should not trigger prompt completion for line comments', async () => { it('should not trigger prompt completion for line comments', async () => {
const mockConfig = { const mockConfig = {
getEnablePromptCompletion: () => true,
getGeminiClient: vi.fn(), getGeminiClient: vi.fn(),
} as unknown as Config; } as unknown as Config;
@@ -532,7 +530,6 @@ describe('useCommandCompletion', () => {
it('should not trigger prompt completion for block comments', async () => { it('should not trigger prompt completion for block comments', async () => {
const mockConfig = { const mockConfig = {
getEnablePromptCompletion: () => true,
getGeminiClient: vi.fn(), getGeminiClient: vi.fn(),
} as unknown as Config; } as unknown as Config;
@@ -567,7 +564,6 @@ describe('useCommandCompletion', () => {
it('should trigger prompt completion for regular text when enabled', async () => { it('should trigger prompt completion for regular text when enabled', async () => {
const mockConfig = { const mockConfig = {
getEnablePromptCompletion: () => true,
getGeminiClient: vi.fn(), getGeminiClient: vi.fn(),
} as unknown as Config; } as unknown as Config;
@@ -156,9 +156,7 @@ export function useCommandCompletion({
// Check for prompt completion - only if enabled // Check for prompt completion - only if enabled
const trimmedText = buffer.text.trim(); const trimmedText = buffer.text.trim();
const isPromptCompletionEnabled = const isPromptCompletionEnabled = false;
config?.getEnablePromptCompletion() ?? false;
if ( if (
isPromptCompletionEnabled && isPromptCompletionEnabled &&
trimmedText.length >= PROMPT_COMPLETION_MIN_LENGTH && trimmedText.length >= PROMPT_COMPLETION_MIN_LENGTH &&
@@ -179,7 +177,7 @@ export function useCommandCompletion({
completionStart: -1, completionStart: -1,
completionEnd: -1, completionEnd: -1,
}; };
}, [cursorRow, cursorCol, buffer.lines, buffer.text, config]); }, [cursorRow, cursorCol, buffer.lines, buffer.text]);
useAtCompletion({ useAtCompletion({
enabled: active && completionMode === CompletionMode.AT, enabled: active && completionMode === CompletionMode.AT,
@@ -204,7 +202,6 @@ export function useCommandCompletion({
const promptCompletion = usePromptCompletion({ const promptCompletion = usePromptCompletion({
buffer, buffer,
config, config,
enabled: active && completionMode === CompletionMode.PROMPT,
}); });
useEffect(() => { useEffect(() => {
@@ -26,13 +26,11 @@ export interface PromptCompletion {
export interface UsePromptCompletionOptions { export interface UsePromptCompletionOptions {
buffer: TextBuffer; buffer: TextBuffer;
config?: Config; config?: Config;
enabled: boolean;
} }
export function usePromptCompletion({ export function usePromptCompletion({
buffer, buffer,
config, config,
enabled,
}: UsePromptCompletionOptions): PromptCompletion { }: UsePromptCompletionOptions): PromptCompletion {
const [ghostText, setGhostText] = useState<string>(''); const [ghostText, setGhostText] = useState<string>('');
const [isLoadingGhostText, setIsLoadingGhostText] = useState<boolean>(false); const [isLoadingGhostText, setIsLoadingGhostText] = useState<boolean>(false);
@@ -42,8 +40,7 @@ export function usePromptCompletion({
const lastSelectedTextRef = useRef<string>(''); const lastSelectedTextRef = useRef<string>('');
const lastRequestedTextRef = useRef<string>(''); const lastRequestedTextRef = useRef<string>('');
const isPromptCompletionEnabled = const isPromptCompletionEnabled = false;
enabled && (config?.getEnablePromptCompletion() ?? false);
const clearGhostText = useCallback(() => { const clearGhostText = useCallback(() => {
setGhostText(''); setGhostText('');
-7
View File
@@ -466,7 +466,6 @@ export interface ConfigParameters {
skipNextSpeakerCheck?: boolean; skipNextSpeakerCheck?: boolean;
shellExecutionConfig?: ShellExecutionConfig; shellExecutionConfig?: ShellExecutionConfig;
extensionManagement?: boolean; extensionManagement?: boolean;
enablePromptCompletion?: boolean;
truncateToolOutputThreshold?: number; truncateToolOutputThreshold?: number;
eventEmitter?: EventEmitter; eventEmitter?: EventEmitter;
useWriteTodos?: boolean; useWriteTodos?: boolean;
@@ -639,7 +638,6 @@ export class Config {
private readonly useBackgroundColor: boolean; private readonly useBackgroundColor: boolean;
private shellExecutionConfig: ShellExecutionConfig; private shellExecutionConfig: ShellExecutionConfig;
private readonly extensionManagement: boolean = true; private readonly extensionManagement: boolean = true;
private readonly enablePromptCompletion: boolean = false;
private readonly truncateToolOutputThreshold: number; private readonly truncateToolOutputThreshold: number;
private compressionTruncationCounter = 0; private compressionTruncationCounter = 0;
private initialized = false; private initialized = false;
@@ -861,7 +859,6 @@ export class Config {
this.fakeResponses = params.fakeResponses; this.fakeResponses = params.fakeResponses;
this.recordResponses = params.recordResponses; this.recordResponses = params.recordResponses;
this.enablePromptCompletion = params.enablePromptCompletion ?? false;
this.fileExclusions = new FileExclusions(this); this.fileExclusions = new FileExclusions(this);
this.eventEmitter = params.eventEmitter; this.eventEmitter = params.eventEmitter;
this.policyEngine = new PolicyEngine({ this.policyEngine = new PolicyEngine({
@@ -2438,10 +2435,6 @@ export class Config {
return this.accessibility.screenReader ?? false; return this.accessibility.screenReader ?? false;
} }
getEnablePromptCompletion(): boolean {
return this.enablePromptCompletion;
}
getTruncateToolOutputThreshold(): number { getTruncateToolOutputThreshold(): number {
return Math.min( return Math.min(
// Estimate remaining context window in characters (1 token ~= 4 chars). // Estimate remaining context window in characters (1 token ~= 4 chars).
-7
View File
@@ -121,13 +121,6 @@
}, },
"additionalProperties": false "additionalProperties": false
}, },
"enablePromptCompletion": {
"title": "Enable Prompt Completion",
"description": "Enable AI-powered prompt completion suggestions while typing.",
"markdownDescription": "Enable AI-powered prompt completion suggestions while typing.\n\n- Category: `General`\n- Requires restart: `yes`\n- Default: `false`",
"default": false,
"type": "boolean"
},
"retryFetchErrors": { "retryFetchErrors": {
"title": "Retry Fetch Errors", "title": "Retry Fetch Errors",
"description": "Retry on \"exception TypeError: fetch failed sending request\" errors.", "description": "Retry on \"exception TypeError: fetch failed sending request\" errors.",