Skip to content

Commit 20078ed

Browse files
authored
Merge pull request #14 from trypear/auto-approve
Added auto-approve by default
2 parents 2ed1954 + 1be22da commit 20078ed

File tree

4 files changed

+34
-28
lines changed

4 files changed

+34
-28
lines changed

src/core/webview/ClineProvider.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,11 +2044,11 @@ export class ClineProvider implements vscode.WebviewViewProvider {
20442044
version: this.context.extension?.packageJSON?.version ?? "",
20452045
apiConfiguration,
20462046
customInstructions,
2047-
alwaysAllowReadOnly: alwaysAllowReadOnly ?? false,
2048-
alwaysAllowWrite: alwaysAllowWrite ?? false,
2049-
alwaysAllowExecute: alwaysAllowExecute ?? false,
2050-
alwaysAllowBrowser: alwaysAllowBrowser ?? false,
2051-
alwaysAllowMcp: alwaysAllowMcp ?? false,
2047+
alwaysAllowReadOnly: alwaysAllowReadOnly ?? true,
2048+
alwaysAllowWrite: alwaysAllowWrite ?? true,
2049+
alwaysAllowExecute: alwaysAllowExecute ?? true,
2050+
alwaysAllowBrowser: alwaysAllowBrowser ?? true,
2051+
alwaysAllowMcp: alwaysAllowMcp ?? true,
20522052
alwaysAllowModeSwitch: alwaysAllowModeSwitch ?? false,
20532053
uriScheme: vscode.env.uriScheme,
20542054
clineMessages: this.cline?.clineMessages || [],
@@ -2067,7 +2067,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
20672067
terminalOutputLineLimit: terminalOutputLineLimit ?? 500,
20682068
fuzzyMatchThreshold: fuzzyMatchThreshold ?? 1.0,
20692069
mcpEnabled: mcpEnabled ?? true,
2070-
alwaysApproveResubmit: alwaysApproveResubmit ?? false,
2070+
alwaysApproveResubmit: alwaysApproveResubmit ?? true,
20712071
requestDelaySeconds: requestDelaySeconds ?? 10,
20722072
rateLimitSeconds: rateLimitSeconds ?? 0,
20732073
currentApiConfigName: currentApiConfigName ?? "default",
@@ -2076,7 +2076,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
20762076
customModePrompts: customModePrompts ?? {},
20772077
customSupportPrompts: customSupportPrompts ?? {},
20782078
enhancementApiConfigId,
2079-
autoApprovalEnabled: autoApprovalEnabled ?? false,
2079+
autoApprovalEnabled: autoApprovalEnabled ?? true,
20802080
customModes: await this.customModesManager.getCustomModes(),
20812081
experiments: experiments ?? experimentDefault,
20822082
}
@@ -2354,12 +2354,12 @@ export class ClineProvider implements vscode.WebviewViewProvider {
23542354
},
23552355
lastShownAnnouncementId,
23562356
customInstructions,
2357-
alwaysAllowReadOnly: alwaysAllowReadOnly ?? false,
2358-
alwaysAllowWrite: alwaysAllowWrite ?? false,
2359-
alwaysAllowExecute: alwaysAllowExecute ?? false,
2360-
alwaysAllowBrowser: alwaysAllowBrowser ?? false,
2361-
alwaysAllowMcp: alwaysAllowMcp ?? false,
2362-
alwaysAllowModeSwitch: alwaysAllowModeSwitch ?? false,
2357+
alwaysAllowReadOnly: alwaysAllowReadOnly ?? true,
2358+
alwaysAllowWrite: alwaysAllowWrite ?? true,
2359+
alwaysAllowExecute: alwaysAllowExecute ?? true,
2360+
alwaysAllowBrowser: alwaysAllowBrowser ?? true,
2361+
alwaysAllowMcp: alwaysAllowMcp ?? true,
2362+
alwaysAllowModeSwitch: alwaysAllowModeSwitch ?? true,
23632363
taskHistory,
23642364
allowedCommands,
23652365
soundEnabled: soundEnabled ?? false,
@@ -2401,7 +2401,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
24012401
return langMap[vscodeLang.split("-")[0]] ?? "English"
24022402
})(),
24032403
mcpEnabled: mcpEnabled ?? true,
2404-
alwaysApproveResubmit: alwaysApproveResubmit ?? false,
2404+
alwaysApproveResubmit: alwaysApproveResubmit ?? true,
24052405
requestDelaySeconds: Math.max(5, requestDelaySeconds ?? 10),
24062406
rateLimitSeconds: rateLimitSeconds ?? 0,
24072407
currentApiConfigName: currentApiConfigName ?? "default",
@@ -2411,7 +2411,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
24112411
customSupportPrompts: customSupportPrompts ?? {},
24122412
enhancementApiConfigId,
24132413
experiments: experiments ?? experimentDefault,
2414-
autoApprovalEnabled: autoApprovalEnabled ?? false,
2414+
autoApprovalEnabled: autoApprovalEnabled ?? true,
24152415
customModes,
24162416
}
24172417
}

webview-ui/src/components/chat/AutoApproveMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
174174
onClick={toggleExpanded}>
175175
<div onClick={(e) => e.stopPropagation()}>
176176
<VSCodeCheckbox
177-
checked={autoApprovalEnabled ?? false}
177+
checked={autoApprovalEnabled ?? true}
178178
onChange={() => {
179-
const newValue = !(autoApprovalEnabled ?? false)
179+
const newValue = !(autoApprovalEnabled ?? true)
180180
setAutoApprovalEnabled(newValue)
181181
vscode.postMessage({ type: "autoApprovalEnabled", bool: newValue })
182182
}}

webview-ui/src/components/chat/__tests__/AutoApproveMenu.test.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ describe("AutoApproveMenu", () => {
4747
customModes: [],
4848

4949
// Auto-approve specific properties
50-
alwaysAllowReadOnly: false,
51-
alwaysAllowWrite: false,
52-
alwaysAllowExecute: false,
53-
alwaysAllowBrowser: false,
54-
alwaysAllowMcp: false,
55-
alwaysApproveResubmit: false,
56-
alwaysAllowModeSwitch: false,
57-
autoApprovalEnabled: false,
50+
alwaysAllowReadOnly: true,
51+
alwaysAllowWrite: true,
52+
alwaysAllowExecute: true,
53+
alwaysAllowBrowser: true,
54+
alwaysAllowMcp: true,
55+
alwaysApproveResubmit: true,
56+
alwaysAllowModeSwitch: true,
57+
autoApprovalEnabled: true,
5858

5959
// Required setter functions
6060
setApiConfiguration: jest.fn(),

webview-ui/src/context/ExtensionStateContext.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,23 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
8383
taskHistory: [],
8484
shouldShowAnnouncement: false,
8585
allowedCommands: [],
86+
alwaysAllowReadOnly: true,
87+
alwaysAllowWrite: true,
88+
alwaysAllowExecute: true,
89+
alwaysAllowBrowser: true,
90+
alwaysAllowMcp: true,
91+
alwaysAllowModeSwitch: true,
8692
soundEnabled: false,
8793
soundVolume: 0.5,
88-
diffEnabled: false,
94+
diffEnabled: true,
8995
fuzzyMatchThreshold: 1.0,
9096
preferredLanguage: "English",
9197
writeDelayMs: 1000,
9298
browserViewportSize: "900x600",
9399
screenshotQuality: 75,
94100
terminalOutputLineLimit: 500,
95101
mcpEnabled: true,
96-
alwaysApproveResubmit: false,
102+
alwaysApproveResubmit: true,
97103
requestDelaySeconds: 5,
98104
rateLimitSeconds: 0, // Minimum time between successive requests (0 = disabled)
99105
currentApiConfigName: "default",
@@ -103,7 +109,7 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
103109
customSupportPrompts: {},
104110
experiments: experimentDefault,
105111
enhancementApiConfigId: "",
106-
autoApprovalEnabled: false,
112+
autoApprovalEnabled: true,
107113
customModes: [],
108114
})
109115

0 commit comments

Comments
 (0)