diff --git a/core/config/migrateSharedConfig.ts b/core/config/migrateSharedConfig.ts index e1e66000d..67dfeeffd 100644 --- a/core/config/migrateSharedConfig.ts +++ b/core/config/migrateSharedConfig.ts @@ -173,6 +173,13 @@ export function migrateJsonSharedConfig(filepath: string, ide: IDE): void { effected = true; } + const { autoAcceptEditToolDiffs, ...withoutAutoApply } = migratedUI; + if (autoAcceptEditToolDiffs !== undefined) { + shareConfigUpdates.autoAcceptEditToolDiffs = autoAcceptEditToolDiffs; + migratedUI = withoutAutoApply; + effected = true; + } + const { showChatScrollbar, ...withoutShowChatScrollbar } = migratedUI; if (showChatScrollbar !== undefined) { shareConfigUpdates.showChatScrollbar = showChatScrollbar; diff --git a/core/config/sharedConfig.ts b/core/config/sharedConfig.ts index b8ac20584..ad8b81341 100644 --- a/core/config/sharedConfig.ts +++ b/core/config/sharedConfig.ts @@ -26,6 +26,7 @@ export const sharedConfigSchema = z codeWrap: z.boolean(), displayRawMarkdown: z.boolean(), showChatScrollbar: z.boolean(), + autoAcceptEditToolDiffs: z.boolean(), // `tabAutocompleteOptions` in `ContinueConfig` useAutocompleteCache: z.boolean(), @@ -106,8 +107,7 @@ export function modifyAnyConfigWithSharedConfig< sharedConfig.disableAutocompleteInFiles; } if (sharedConfig.modelTimeout !== undefined) { - configCopy.tabAutocompleteOptions.modelTimeout = - sharedConfig.modelTimeout; + configCopy.tabAutocompleteOptions.modelTimeout = sharedConfig.modelTimeout; } if (sharedConfig.debounceDelay !== undefined) { configCopy.tabAutocompleteOptions.debounceDelay = @@ -134,6 +134,10 @@ export function modifyAnyConfigWithSharedConfig< if (sharedConfig.showChatScrollbar !== undefined) { configCopy.ui.showChatScrollbar = sharedConfig.showChatScrollbar; } + if (sharedConfig.autoAcceptEditToolDiffs !== undefined) { + configCopy.ui.autoAcceptEditToolDiffs = + sharedConfig.autoAcceptEditToolDiffs; + } if (sharedConfig.allowAnonymousTelemetry !== undefined) { configCopy.allowAnonymousTelemetry = sharedConfig.allowAnonymousTelemetry; diff --git a/core/index.d.ts b/core/index.d.ts index d15c73b50..a9f003a50 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -1192,6 +1192,7 @@ export interface ContinueUIConfig { showChatScrollbar?: boolean; codeWrap?: boolean; showSessionTabs?: boolean; + autoAcceptEditToolDiffs?: boolean; } export interface ContextMenuConfig { diff --git a/docs/docs/customize/deep-dives/settings.md b/docs/docs/customize/deep-dives/settings.md index 0d3b57127..40d59f807 100644 --- a/docs/docs/customize/deep-dives/settings.md +++ b/docs/docs/customize/deep-dives/settings.md @@ -20,6 +20,7 @@ Below that, the following settings which are not part of a configuration file ar - `Wrap Codeblocks`: If on, enables text wrapping in code blocks. Off by default. - `Show Chat Scrollbar`: If on, enables a scrollbar in the chat window. Off by default. - `Text-to-Speech Output`: If on, reads LLM responses aloud with TTS. Off by default. +- `Auto-Accept Agent Edits`: If on, automatically accepts diffs generated by the edit tool and proceeds with the next conversational turn. Off by default. - `Enable Session Titles`: If on, generates summary titles for each chat session after the first message, using the current Chat model. On by default. - `Format Markdown`: If off, shows responses as raw text. On by default. - `Allow Anonymous Telemetry`: If on, allows Continue to send anonymous telemetry. **On** by default. diff --git a/gui/src/pages/config/UserSettingsForm.tsx b/gui/src/pages/config/UserSettingsForm.tsx index 06f2ce32c..befccf989 100644 --- a/gui/src/pages/config/UserSettingsForm.tsx +++ b/gui/src/pages/config/UserSettingsForm.tsx @@ -65,6 +65,7 @@ export function UserSettingsForm() { const codeWrap = config.ui?.codeWrap ?? false; const showChatScrollbar = config.ui?.showChatScrollbar ?? false; const readResponseTTS = config.experimental?.readResponseTTS ?? false; + const autoAcceptEditToolDiffs = config.ui?.autoAcceptEditToolDiffs ?? false; const displayRawMarkdown = config.ui?.displayRawMarkdown ?? false; const disableSessionTitles = config.disableSessionTitles ?? false; @@ -162,7 +163,15 @@ export function UserSettingsForm() { } text="Text-to-Speech Output" /> - + + handleUpdate({ + autoAcceptEditToolDiffs: !autoAcceptEditToolDiffs, + }) + } + text="Auto-Accept Agent Edits" + /> {/* diff --git a/gui/src/util/clientTools/editImpl.ts b/gui/src/util/clientTools/editImpl.ts index d1f80f25a..27598840b 100644 --- a/gui/src/util/clientTools/editImpl.ts +++ b/gui/src/util/clientTools/editImpl.ts @@ -25,6 +25,13 @@ export const editToolImpl: ClientToolImpl = async ( if (apply.status === "error") { throw new Error(apply.error); } + const state = extras.getState(); + if (state.config.config.ui?.autoAcceptEditToolDiffs) { + await extras.ideMessenger.request("acceptDiff", { + streamId: extras.streamId, + filepath: firstUriMatch, + }); + } return { respondImmediately: false,