Skip to content

Commit 47067ea

Browse files
committed
split autoapprove subtask settings into two (create and complete)
1 parent 3cc81c7 commit 47067ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+329
-134
lines changed

e2e/src/suite/subtasks.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ suite("Roo Code Subtasks", () => {
2020
await api.setConfiguration({
2121
mode: "ask",
2222
alwaysAllowModeSwitch: true,
23-
alwaysAllowSubtasks: true,
23+
alwaysAllowSubtaskCreation: true,
24+
alwaysAllowSubtaskCompletion: true,
2425
autoApprovalEnabled: true,
2526
enableCheckpoints: false,
2627
})

evals/packages/types/src/roo-code-defaults.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export const rooCodeDefaults: RooCodeSettings = {
3434
requestDelaySeconds: 5,
3535
alwaysAllowMcp: true,
3636
alwaysAllowModeSwitch: true,
37-
alwaysAllowSubtasks: true,
37+
alwaysAllowSubtaskCreation: true,
38+
alwaysAllowSubtaskCompletion: true,
3839
alwaysAllowExecute: true,
3940
allowedCommands: ["*"],
4041

evals/packages/types/src/roo-code.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,8 @@ export const globalSettingsSchema = z.object({
492492
requestDelaySeconds: z.number().optional(),
493493
alwaysAllowMcp: z.boolean().optional(),
494494
alwaysAllowModeSwitch: z.boolean().optional(),
495-
alwaysAllowSubtasks: z.boolean().optional(),
495+
alwaysAllowSubtaskCreation: z.boolean().optional(),
496+
alwaysAllowSubtaskCompletion: z.boolean().optional(),
496497
alwaysAllowExecute: z.boolean().optional(),
497498
allowedCommands: z.array(z.string()).optional(),
498499

@@ -561,7 +562,8 @@ const globalSettingsRecord: GlobalSettingsRecord = {
561562
requestDelaySeconds: undefined,
562563
alwaysAllowMcp: undefined,
563564
alwaysAllowModeSwitch: undefined,
564-
alwaysAllowSubtasks: undefined,
565+
alwaysAllowSubtaskCreation: undefined,
566+
alwaysAllowSubtaskCompletion: undefined,
565567
alwaysAllowExecute: undefined,
566568
allowedCommands: undefined,
567569

src/core/webview/ClineProvider.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,8 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
11801180
alwaysAllowBrowser,
11811181
alwaysAllowMcp,
11821182
alwaysAllowModeSwitch,
1183-
alwaysAllowSubtasks,
1183+
alwaysAllowSubtaskCreation,
1184+
alwaysAllowSubtaskCompletion,
11841185
soundEnabled,
11851186
ttsEnabled,
11861187
ttsSpeed,
@@ -1237,7 +1238,8 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
12371238
alwaysAllowBrowser: alwaysAllowBrowser ?? false,
12381239
alwaysAllowMcp: alwaysAllowMcp ?? false,
12391240
alwaysAllowModeSwitch: alwaysAllowModeSwitch ?? false,
1240-
alwaysAllowSubtasks: alwaysAllowSubtasks ?? false,
1241+
alwaysAllowSubtaskCreation: alwaysAllowSubtaskCreation ?? false,
1242+
alwaysAllowSubtaskCompletion: alwaysAllowSubtaskCompletion ?? false,
12411243
uriScheme: vscode.env.uriScheme,
12421244
currentTaskItem: this.getCurrentCline()?.taskId
12431245
? (taskHistory || []).find((item: HistoryItem) => item.id === this.getCurrentCline()?.taskId)
@@ -1330,7 +1332,8 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
13301332
alwaysAllowBrowser: stateValues.alwaysAllowBrowser ?? false,
13311333
alwaysAllowMcp: stateValues.alwaysAllowMcp ?? false,
13321334
alwaysAllowModeSwitch: stateValues.alwaysAllowModeSwitch ?? false,
1333-
alwaysAllowSubtasks: stateValues.alwaysAllowSubtasks ?? false,
1335+
alwaysAllowSubtaskCreation: stateValues.alwaysAllowSubtaskCreation ?? false,
1336+
alwaysAllowSubtaskCompletion: stateValues.alwaysAllowSubtaskCompletion ?? false,
13341337
taskHistory: stateValues.taskHistory,
13351338
allowedCommands: stateValues.allowedCommands,
13361339
soundEnabled: stateValues.soundEnabled ?? false,

src/core/webview/webviewMessageHandler.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,12 @@ export const webviewMessageHandler = async (provider: ClineProvider, message: We
281281
await updateGlobalState("alwaysAllowModeSwitch", message.bool)
282282
await provider.postStateToWebview()
283283
break
284-
case "alwaysAllowSubtasks":
285-
await updateGlobalState("alwaysAllowSubtasks", message.bool)
284+
case "alwaysAllowSubtaskCreation":
285+
await updateGlobalState("alwaysAllowSubtaskCreation", message.bool)
286+
await provider.postStateToWebview()
287+
break
288+
case "alwaysAllowSubtaskCompletion":
289+
await updateGlobalState("alwaysAllowSubtaskCompletion", message.bool)
286290
await provider.postStateToWebview()
287291
break
288292
case "askResponse":

src/exports/roo-code.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ type GlobalSettings = {
245245
requestDelaySeconds?: number | undefined
246246
alwaysAllowMcp?: boolean | undefined
247247
alwaysAllowModeSwitch?: boolean | undefined
248-
alwaysAllowSubtasks?: boolean | undefined
248+
alwaysAllowSubtaskCreation?: boolean | undefined
249+
alwaysAllowSubtaskCompletion?: boolean | undefined
249250
alwaysAllowExecute?: boolean | undefined
250251
allowedCommands?: string[] | undefined
251252
browserToolEnabled?: boolean | undefined

src/schemas/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,8 @@ export const globalSettingsSchema = z.object({
506506
requestDelaySeconds: z.number().optional(),
507507
alwaysAllowMcp: z.boolean().optional(),
508508
alwaysAllowModeSwitch: z.boolean().optional(),
509-
alwaysAllowSubtasks: z.boolean().optional(),
509+
alwaysAllowSubtaskCreation: z.boolean().optional(),
510+
alwaysAllowSubtaskCompletion: z.boolean().optional(),
510511
alwaysAllowExecute: z.boolean().optional(),
511512
allowedCommands: z.array(z.string()).optional(),
512513

@@ -577,7 +578,8 @@ const globalSettingsRecord: GlobalSettingsRecord = {
577578
requestDelaySeconds: undefined,
578579
alwaysAllowMcp: undefined,
579580
alwaysAllowModeSwitch: undefined,
580-
alwaysAllowSubtasks: undefined,
581+
alwaysAllowSubtaskCreation: undefined,
582+
alwaysAllowSubtaskCompletion: undefined,
581583
alwaysAllowExecute: undefined,
582584
allowedCommands: undefined,
583585

src/shared/ExtensionMessage.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ export type ExtensionState = Pick<
133133
// | "requestDelaySeconds" // Optional in GlobalSettings, required here.
134134
| "alwaysAllowMcp"
135135
| "alwaysAllowModeSwitch"
136-
| "alwaysAllowSubtasks"
136+
| "alwaysAllowSubtaskCreation"
137+
| "alwaysAllowSubtaskCompletion"
137138
| "alwaysAllowExecute"
138139
| "allowedCommands"
139140
| "browserToolEnabled"

src/shared/WebviewMessage.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export interface WebviewMessage {
5454
| "alwaysAllowBrowser"
5555
| "alwaysAllowMcp"
5656
| "alwaysAllowModeSwitch"
57-
| "alwaysAllowSubtasks"
57+
| "alwaysAllowSubtaskCreation"
58+
| "alwaysAllowSubtaskCompletion"
5859
| "playSound"
5960
| "playTts"
6061
| "stopTts"

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

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
3333
setAlwaysAllowMcp,
3434
alwaysAllowModeSwitch,
3535
setAlwaysAllowModeSwitch,
36-
alwaysAllowSubtasks,
37-
setAlwaysAllowSubtasks,
36+
alwaysAllowSubtaskCreation,
37+
setAlwaysAllowSubtaskCreation,
38+
alwaysAllowSubtaskCompletion,
39+
setAlwaysAllowSubtaskCompletion,
3840
alwaysApproveResubmit,
3941
setAlwaysApproveResubmit,
4042
autoApprovalEnabled,
@@ -87,11 +89,18 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
8789
description: t("chat:autoApprove.actions.switchModes.description"),
8890
},
8991
{
90-
id: "subtasks",
91-
label: t("chat:autoApprove.actions.subtasks.label"),
92-
shortName: t("chat:autoApprove.actions.subtasks.shortName"),
93-
enabled: alwaysAllowSubtasks ?? false,
94-
description: t("chat:autoApprove.actions.subtasks.description"),
92+
id: "subtaskCreation",
93+
label: t("chat:autoApprove.actions.subtaskCreation.label"),
94+
shortName: t("chat:autoApprove.actions.subtaskCreation.shortName"),
95+
enabled: alwaysAllowSubtaskCreation ?? false,
96+
description: t("chat:autoApprove.actions.subtaskCreation.description"),
97+
},
98+
{
99+
id: "subtaskCompletion",
100+
label: t("chat:autoApprove.actions.subtaskCompletion.label"),
101+
shortName: t("chat:autoApprove.actions.subtaskCompletion.shortName"),
102+
enabled: alwaysAllowSubtaskCompletion ?? false,
103+
description: t("chat:autoApprove.actions.subtaskCompletion.description"),
95104
},
96105
{
97106
id: "retryRequests",
@@ -148,11 +157,17 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
148157
vscode.postMessage({ type: "alwaysAllowModeSwitch", bool: newValue })
149158
}, [alwaysAllowModeSwitch, setAlwaysAllowModeSwitch])
150159

151-
const handleSubtasksChange = useCallback(() => {
152-
const newValue = !(alwaysAllowSubtasks ?? false)
153-
setAlwaysAllowSubtasks(newValue)
154-
vscode.postMessage({ type: "alwaysAllowSubtasks", bool: newValue })
155-
}, [alwaysAllowSubtasks, setAlwaysAllowSubtasks])
160+
const handleSubtaskCreationChange = useCallback(() => {
161+
const newValue = !(alwaysAllowSubtaskCreation ?? false)
162+
setAlwaysAllowSubtaskCreation(newValue)
163+
vscode.postMessage({ type: "alwaysAllowSubtaskCreation", bool: newValue })
164+
}, [alwaysAllowSubtaskCreation, setAlwaysAllowSubtaskCreation])
165+
166+
const handleSubtaskCompletionChange = useCallback(() => {
167+
const newValue = !(alwaysAllowSubtaskCompletion ?? false)
168+
setAlwaysAllowSubtaskCompletion(newValue)
169+
vscode.postMessage({ type: "alwaysAllowSubtaskCompletion", bool: newValue })
170+
}, [alwaysAllowSubtaskCompletion, setAlwaysAllowSubtaskCompletion])
156171

157172
const handleRetryChange = useCallback(() => {
158173
const newValue = !(alwaysApproveResubmit ?? false)
@@ -176,7 +191,8 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
176191
useBrowser: handleBrowserChange,
177192
useMcp: handleMcpChange,
178193
switchModes: handleModeSwitchChange,
179-
subtasks: handleSubtasksChange,
194+
subtaskCreation: handleSubtaskCreationChange,
195+
subtaskCompletion: handleSubtaskCompletionChange,
180196
retryRequests: handleRetryChange,
181197
}
182198

0 commit comments

Comments
 (0)