diff --git a/src/core/Cline.ts b/src/core/Cline.ts index be5306dd28..3d27a50255 100644 --- a/src/core/Cline.ts +++ b/src/core/Cline.ts @@ -1431,7 +1431,7 @@ export class Cline { const toolMessage = JSON.stringify({ tool: "finishTask", content: - "Task completed! You can review the results and suggest any corrections or next steps. If everything looks good, confirm to continue with the next task.", + "Subtask completed! You can review the results and suggest any corrections or next steps. If everything looks good, confirm to return the result to the parent task.", }) return await askApproval("tool", toolMessage) diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 90885cec43..657e4a9ab6 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -984,8 +984,8 @@ export class ClineProvider implements vscode.WebviewViewProvider { await this.updateGlobalState("alwaysAllowModeSwitch", message.bool) await this.postStateToWebview() break - case "alwaysAllowFinishTask": - await this.updateGlobalState("alwaysAllowFinishTask", message.bool) + case "alwaysAllowSubtasks": + await this.updateGlobalState("alwaysAllowSubtasks", message.bool) await this.postStateToWebview() break case "askResponse": @@ -997,9 +997,7 @@ export class ClineProvider implements vscode.WebviewViewProvider { break case "clearTask": // clear task resets the current session and allows for a new task to be started, if this session is a subtask - it allows the parent task to be resumed - await this.finishSubTask( - `new_task finished with an error!, it was stopped and canceled by the user.`, - ) + await this.finishSubTask(`Task error: It was stopped and canceled by the user.`) await this.postStateToWebview() break case "didShowAnnouncement": @@ -2181,7 +2179,7 @@ export class ClineProvider implements vscode.WebviewViewProvider { alwaysAllowBrowser, alwaysAllowMcp, alwaysAllowModeSwitch, - alwaysAllowFinishTask, + alwaysAllowSubtasks, soundEnabled, diffEnabled, enableCheckpoints, @@ -2229,7 +2227,7 @@ export class ClineProvider implements vscode.WebviewViewProvider { alwaysAllowBrowser: alwaysAllowBrowser ?? false, alwaysAllowMcp: alwaysAllowMcp ?? false, alwaysAllowModeSwitch: alwaysAllowModeSwitch ?? false, - alwaysAllowFinishTask: alwaysAllowFinishTask ?? false, + alwaysAllowSubtasks: alwaysAllowSubtasks ?? false, uriScheme: vscode.env.uriScheme, currentTaskItem: this.getCurrentCline()?.taskId ? (taskHistory || []).find((item: HistoryItem) => item.id === this.getCurrentCline()?.taskId) @@ -2391,7 +2389,7 @@ export class ClineProvider implements vscode.WebviewViewProvider { alwaysAllowBrowser: stateValues.alwaysAllowBrowser ?? false, alwaysAllowMcp: stateValues.alwaysAllowMcp ?? false, alwaysAllowModeSwitch: stateValues.alwaysAllowModeSwitch ?? false, - alwaysAllowFinishTask: stateValues.alwaysAllowFinishTask ?? false, + alwaysAllowSubtasks: stateValues.alwaysAllowSubtasks ?? false, taskHistory: stateValues.taskHistory, allowedCommands: stateValues.allowedCommands, soundEnabled: stateValues.soundEnabled ?? false, diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index 4e76b0abbc..b7e3d850cf 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -109,7 +109,7 @@ export interface ExtensionState { alwaysAllowMcp?: boolean alwaysApproveResubmit?: boolean alwaysAllowModeSwitch?: boolean - alwaysAllowFinishTask?: boolean + alwaysAllowSubtasks?: boolean browserToolEnabled?: boolean requestDelaySeconds: number rateLimitSeconds: number // Minimum time between successive requests (0 = disabled) diff --git a/src/shared/WebviewMessage.ts b/src/shared/WebviewMessage.ts index 086701a43f..216c7588d7 100644 --- a/src/shared/WebviewMessage.ts +++ b/src/shared/WebviewMessage.ts @@ -48,7 +48,7 @@ export interface WebviewMessage { | "alwaysAllowBrowser" | "alwaysAllowMcp" | "alwaysAllowModeSwitch" - | "alwaysAllowFinishTask" + | "alwaysAllowSubtasks" | "playSound" | "soundEnabled" | "soundVolume" diff --git a/src/shared/globalState.ts b/src/shared/globalState.ts index 739fa11dad..35e53bbe9c 100644 --- a/src/shared/globalState.ts +++ b/src/shared/globalState.ts @@ -40,7 +40,7 @@ export const GLOBAL_STATE_KEYS = [ "alwaysAllowBrowser", "alwaysAllowMcp", "alwaysAllowModeSwitch", - "alwaysAllowFinishTask", + "alwaysAllowSubtasks", "taskHistory", "openAiBaseUrl", "openAiModelId", diff --git a/webview-ui/src/components/chat/AutoApproveMenu.tsx b/webview-ui/src/components/chat/AutoApproveMenu.tsx index fba97f6c7d..692cf1d44c 100644 --- a/webview-ui/src/components/chat/AutoApproveMenu.tsx +++ b/webview-ui/src/components/chat/AutoApproveMenu.tsx @@ -30,8 +30,8 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { setAlwaysAllowMcp, alwaysAllowModeSwitch, setAlwaysAllowModeSwitch, - alwaysAllowFinishTask, - setAlwaysAllowFinishTask, + alwaysAllowSubtasks, + setAlwaysAllowSubtasks, alwaysApproveResubmit, setAlwaysApproveResubmit, autoApprovalEnabled, @@ -77,18 +77,17 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { }, { id: "switchModes", - label: "Switch modes & create tasks", + label: "Switch modes", shortName: "Modes", enabled: alwaysAllowModeSwitch ?? false, - description: - "Allows automatic switching between different AI modes and creating new tasks without requiring approval.", + description: "Allows automatic switching between different modes without requiring approval.", }, { - id: "finishTask", - label: "Continue to next task", - shortName: "Continue", - enabled: alwaysAllowFinishTask ?? false, - description: "Allow tasks to end execution and continue to the next task, without user review or approval.", + id: "subtasks", + label: "Create & complete subtasks", + shortName: "Subtasks", + enabled: alwaysAllowSubtasks ?? false, + description: "Allow creation and completion of subtasks without requiring approval.", }, { id: "retryRequests", @@ -145,11 +144,11 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { vscode.postMessage({ type: "alwaysAllowModeSwitch", bool: newValue }) }, [alwaysAllowModeSwitch, setAlwaysAllowModeSwitch]) - const handleFinishTaskChange = useCallback(() => { - const newValue = !(alwaysAllowFinishTask ?? false) - setAlwaysAllowFinishTask(newValue) - vscode.postMessage({ type: "alwaysAllowFinishTask", bool: newValue }) - }, [alwaysAllowFinishTask, setAlwaysAllowFinishTask]) + const handleSubtasksChange = useCallback(() => { + const newValue = !(alwaysAllowSubtasks ?? false) + setAlwaysAllowSubtasks(newValue) + vscode.postMessage({ type: "alwaysAllowSubtasks", bool: newValue }) + }, [alwaysAllowSubtasks, setAlwaysAllowSubtasks]) const handleRetryChange = useCallback(() => { const newValue = !(alwaysApproveResubmit ?? false) @@ -165,7 +164,7 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { useBrowser: handleBrowserChange, useMcp: handleMcpChange, switchModes: handleModeSwitchChange, - finishTask: handleFinishTaskChange, + subtasks: handleSubtasksChange, retryRequests: handleRetryChange, } diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index bb5237dd23..b19d67dc05 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -452,7 +452,7 @@ export const ChatRowContent = ({
{tool.mode} mode:
+ Roo wants to create a new subtask in {tool.mode} mode:
{tool.content}
diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx
index b92604e157..5ac7f50559 100644
--- a/webview-ui/src/components/chat/ChatView.tsx
+++ b/webview-ui/src/components/chat/ChatView.tsx
@@ -61,7 +61,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
setMode,
autoApprovalEnabled,
alwaysAllowModeSwitch,
- alwaysAllowFinishTask,
+ alwaysAllowSubtasks,
customModes,
telemetrySetting,
} = useExtensionState()
@@ -150,7 +150,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
setSecondaryButtonText("Reject")
break
case "finishTask":
- setPrimaryButtonText("Approve & Continue to the next Task")
+ setPrimaryButtonText("Complete Subtask and Return")
setSecondaryButtonText(undefined)
break
default:
@@ -646,11 +646,10 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
(alwaysAllowMcp && message.ask === "use_mcp_server" && isMcpToolAlwaysAllowed(message)) ||
(alwaysAllowModeSwitch &&
message.ask === "tool" &&
- (JSON.parse(message.text || "{}")?.tool === "switchMode" ||
- JSON.parse(message.text || "{}")?.tool === "newTask")) ||
- (alwaysAllowFinishTask &&
+ JSON.parse(message.text || "{}")?.tool === "switchMode") ||
+ (alwaysAllowSubtasks &&
message.ask === "tool" &&
- JSON.parse(message.text || "{}")?.tool === "finishTask")
+ ["newTask", "finishTask"].includes(JSON.parse(message.text || "{}")?.tool))
)
},
[
@@ -665,7 +664,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
alwaysAllowMcp,
isMcpToolAlwaysAllowed,
alwaysAllowModeSwitch,
- alwaysAllowFinishTask,
+ alwaysAllowSubtasks,
],
)
diff --git a/webview-ui/src/components/settings/AutoApproveSettings.tsx b/webview-ui/src/components/settings/AutoApproveSettings.tsx
index 1c8e6c9ea9..d26fc33a7c 100644
--- a/webview-ui/src/components/settings/AutoApproveSettings.tsx
+++ b/webview-ui/src/components/settings/AutoApproveSettings.tsx
@@ -18,7 +18,7 @@ type AutoApproveSettingsProps = HTMLAttributes- Automatically switch between different AI modes and create new tasks without requiring approval + Automatically switch between different modes without requiring approval
- Automatically approve tasks to finish execution and continue to the next task, without user - review or approval + Allow creation and completion of subtasks without requiring approval