feat: add background edit mode setting (#7146)

Add backgroundEditEnabled setting to global state and settings infrastructure.
This includes:
- Proto definition for the update settings request
- State management in controller and state helpers
- Extension state interface updates
- Default value of false in webview context

Building block for ENG-1367. Setting is not yet used in the UI or anywhere in the app yet. It will be done in the follow-up PR where the feature is implemented.
This commit is contained in:
Bee authored and GitHub committed 2025-12-18 22:03:25 -08:00
1 parent 26b6c7bdb6
commit 45b79dc3d7
7 files changed
+14 -1

No files matched your search

+1
View File
@@ -369,6 +369,7 @@ message UpdateSettingsRequest {
optional OnboardingModelGroup onboarding_models = 33;
optional bool cline_web_tools_enabled = 34;
optional bool enable_parallel_tool_calling = 35;
optional bool background_edit_enabled = 36;
}
message UpdateTerminalConnectionTimeoutRequest {
+1
View File
@@ -954,6 +954,7 @@ export class Controller {
subagentsEnabled,
nativeToolCallSetting: this.stateManager.getGlobalStateKey("nativeToolCallEnabled"),
enableParallelToolCalling: this.stateManager.getGlobalSettingsKey("enableParallelToolCalling"),
backgroundEditEnabled: this.stateManager.getGlobalSettingsKey("backgroundEditEnabled"),
}
}
@@ -320,6 +320,10 @@ export async function updateSettings(controller: Controller, request: UpdateSett
}
}
if (request.backgroundEditEnabled !== undefined) {
controller.stateManager.setGlobalState("backgroundEditEnabled", !!request.backgroundEditEnabled)
}
if (request.autoCondenseThreshold !== undefined) {
const threshold = Math.min(1, Math.max(0, request.autoCondenseThreshold)) // Clamp to 0-1 range
controller.stateManager.setGlobalState("autoCondenseThreshold", threshold)
+3
View File
@@ -322,6 +322,8 @@ export async function readGlobalStateFromDisk(context: ExtensionContext): Promis
const openTelemetryLogMaxQueueSize =
context.globalState.get<GlobalStateAndSettings["openTelemetryLogMaxQueueSize"]>("openTelemetryLogMaxQueueSize")
const subagentsEnabled = context.globalState.get<GlobalStateAndSettings["subagentsEnabled"]>("subagentsEnabled")
const backgroundEditEnabled =
context.globalState.get<GlobalStateAndSettings["backgroundEditEnabled"]>("backgroundEditEnabled")
// Get mode-related configurations
const mode = context.globalState.get<GlobalStateAndSettings["mode"]>("mode")
@@ -682,6 +684,7 @@ export async function readGlobalStateFromDisk(context: ExtensionContext): Promis
qwenCodeOauthPath,
customPrompt,
autoCondenseThreshold: autoCondenseThreshold || 0.75, // default to 0.75 if not set
backgroundEditEnabled: backgroundEditEnabled ?? false,
// Hooks require explicit user opt-in and are only supported on macOS/Linux
hooksEnabled: getHooksEnabledSafe(hooksEnabled),
subagentsEnabled: subagentsEnabled ?? false,
+1
View File
@@ -106,6 +106,7 @@ export interface ExtensionState {
subagentsEnabled?: boolean
nativeToolCallSetting?: boolean
enableParallelToolCalling?: boolean
backgroundEditEnabled?: boolean
}
export interface ClineMessage {
+3 -1
View File
@@ -130,8 +130,10 @@ export interface Settings {
hooksEnabled: boolean
subagentsEnabled: boolean
enableParallelToolCalling: boolean
hicapModelId: string | undefined
backgroundEditEnabled: boolean
// Model-specific settings
hicapModelId: string | undefined
// Plan mode configurations
planModeApiProvider: ApiProvider
planModeApiModelId: string | undefined
@@ -241,6 +241,7 @@ export const ExtensionStateContextProvider: React.FC<{
backgroundCommandTaskId: undefined,
lastDismissedCliBannerVersion: 0,
subagentsEnabled: false,
backgroundEditEnabled: false,
// NEW: Add workspace information with defaults
workspaceRoots: [],