Skip to content

Commit c992552

Browse files
authored
Merge pull request RooCodeInc#1505 from RooVetGit/v3.8.2
V3.8.2
2 parents e2bdee3 + 91d1689 commit c992552

File tree

14 files changed

+66
-65
lines changed

14 files changed

+66
-65
lines changed

.changeset/modern-pillows-visit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"roo-cline": patch
3+
---
4+
5+
v3.8.2

src/core/Cline.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ export class Cline {
14311431
const toolMessage = JSON.stringify({
14321432
tool: "finishTask",
14331433
content:
1434-
"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.",
1434+
"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.",
14351435
})
14361436

14371437
return await askApproval("tool", toolMessage)

src/core/diff/strategies/multi-search-replace.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,18 +368,20 @@ Only use a single line of '=======' between search and replacement content, beca
368368
getProgressStatus(toolUse: ToolUse, result?: DiffResult): ToolProgressStatus {
369369
const diffContent = toolUse.params.diff
370370
if (diffContent) {
371+
const icon = "diff-multiple"
372+
const searchBlockCount = (diffContent.match(/SEARCH/g) || []).length
371373
if (toolUse.partial) {
372374
if (diffContent.length < 1000 || (diffContent.length / 50) % 10 === 0) {
373-
return { text: `progressing ${(diffContent.match(/SEARCH/g) || []).length} blocks...` }
375+
return { icon, text: `${searchBlockCount}` }
374376
}
375377
} else if (result) {
376-
const searchBlockCount = (diffContent.match(/SEARCH/g) || []).length
377-
if (result.failParts) {
378+
if (result.failParts?.length) {
378379
return {
379-
text: `progressed ${searchBlockCount - result.failParts.length}/${searchBlockCount} blocks.`,
380+
icon,
381+
text: `${searchBlockCount - result.failParts.length}/${searchBlockCount}`,
380382
}
381383
} else {
382-
return { text: `progressed ${searchBlockCount} blocks.` }
384+
return { icon, text: `${searchBlockCount}` }
383385
}
384386
}
385387
}

src/core/webview/ClineProvider.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,8 @@ export class ClineProvider implements vscode.WebviewViewProvider {
984984
await this.updateGlobalState("alwaysAllowModeSwitch", message.bool)
985985
await this.postStateToWebview()
986986
break
987-
case "alwaysAllowFinishTask":
988-
await this.updateGlobalState("alwaysAllowFinishTask", message.bool)
987+
case "alwaysAllowSubtasks":
988+
await this.updateGlobalState("alwaysAllowSubtasks", message.bool)
989989
await this.postStateToWebview()
990990
break
991991
case "askResponse":
@@ -997,9 +997,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
997997
break
998998
case "clearTask":
999999
// 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
1000-
await this.finishSubTask(
1001-
`new_task finished with an error!, it was stopped and canceled by the user.`,
1002-
)
1000+
await this.finishSubTask(`Task error: It was stopped and canceled by the user.`)
10031001
await this.postStateToWebview()
10041002
break
10051003
case "didShowAnnouncement":
@@ -2181,7 +2179,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
21812179
alwaysAllowBrowser,
21822180
alwaysAllowMcp,
21832181
alwaysAllowModeSwitch,
2184-
alwaysAllowFinishTask,
2182+
alwaysAllowSubtasks,
21852183
soundEnabled,
21862184
diffEnabled,
21872185
enableCheckpoints,
@@ -2229,7 +2227,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
22292227
alwaysAllowBrowser: alwaysAllowBrowser ?? false,
22302228
alwaysAllowMcp: alwaysAllowMcp ?? false,
22312229
alwaysAllowModeSwitch: alwaysAllowModeSwitch ?? false,
2232-
alwaysAllowFinishTask: alwaysAllowFinishTask ?? false,
2230+
alwaysAllowSubtasks: alwaysAllowSubtasks ?? false,
22332231
uriScheme: vscode.env.uriScheme,
22342232
currentTaskItem: this.getCurrentCline()?.taskId
22352233
? (taskHistory || []).find((item: HistoryItem) => item.id === this.getCurrentCline()?.taskId)
@@ -2391,7 +2389,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
23912389
alwaysAllowBrowser: stateValues.alwaysAllowBrowser ?? false,
23922390
alwaysAllowMcp: stateValues.alwaysAllowMcp ?? false,
23932391
alwaysAllowModeSwitch: stateValues.alwaysAllowModeSwitch ?? false,
2394-
alwaysAllowFinishTask: stateValues.alwaysAllowFinishTask ?? false,
2392+
alwaysAllowSubtasks: stateValues.alwaysAllowSubtasks ?? false,
23952393
taskHistory: stateValues.taskHistory,
23962394
allowedCommands: stateValues.allowedCommands,
23972395
soundEnabled: stateValues.soundEnabled ?? false,

src/shared/ExtensionMessage.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export interface ExtensionState {
109109
alwaysAllowMcp?: boolean
110110
alwaysApproveResubmit?: boolean
111111
alwaysAllowModeSwitch?: boolean
112-
alwaysAllowFinishTask?: boolean
112+
alwaysAllowSubtasks?: boolean
113113
browserToolEnabled?: boolean
114114
requestDelaySeconds: number
115115
rateLimitSeconds: number // Minimum time between successive requests (0 = disabled)
@@ -277,5 +277,6 @@ export interface HumanRelayCancelMessage {
277277
export type ClineApiReqCancelReason = "streaming_failed" | "user_cancelled"
278278

279279
export type ToolProgressStatus = {
280+
icon?: string
280281
text?: string
281282
}

src/shared/WebviewMessage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export interface WebviewMessage {
4848
| "alwaysAllowBrowser"
4949
| "alwaysAllowMcp"
5050
| "alwaysAllowModeSwitch"
51-
| "alwaysAllowFinishTask"
51+
| "alwaysAllowSubtasks"
5252
| "playSound"
5353
| "soundEnabled"
5454
| "soundVolume"

src/shared/globalState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const GLOBAL_STATE_KEYS = [
4040
"alwaysAllowBrowser",
4141
"alwaysAllowMcp",
4242
"alwaysAllowModeSwitch",
43-
"alwaysAllowFinishTask",
43+
"alwaysAllowSubtasks",
4444
"taskHistory",
4545
"openAiBaseUrl",
4646
"openAiModelId",

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

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
3030
setAlwaysAllowMcp,
3131
alwaysAllowModeSwitch,
3232
setAlwaysAllowModeSwitch,
33-
alwaysAllowFinishTask,
34-
setAlwaysAllowFinishTask,
33+
alwaysAllowSubtasks,
34+
setAlwaysAllowSubtasks,
3535
alwaysApproveResubmit,
3636
setAlwaysApproveResubmit,
3737
autoApprovalEnabled,
@@ -77,18 +77,17 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
7777
},
7878
{
7979
id: "switchModes",
80-
label: "Switch modes & create tasks",
80+
label: "Switch modes",
8181
shortName: "Modes",
8282
enabled: alwaysAllowModeSwitch ?? false,
83-
description:
84-
"Allows automatic switching between different AI modes and creating new tasks without requiring approval.",
83+
description: "Allows automatic switching between different modes without requiring approval.",
8584
},
8685
{
87-
id: "finishTask",
88-
label: "Continue to next task",
89-
shortName: "Continue",
90-
enabled: alwaysAllowFinishTask ?? false,
91-
description: "Allow tasks to end execution and continue to the next task, without user review or approval.",
86+
id: "subtasks",
87+
label: "Create & complete subtasks",
88+
shortName: "Subtasks",
89+
enabled: alwaysAllowSubtasks ?? false,
90+
description: "Allow creation and completion of subtasks without requiring approval.",
9291
},
9392
{
9493
id: "retryRequests",
@@ -145,11 +144,11 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
145144
vscode.postMessage({ type: "alwaysAllowModeSwitch", bool: newValue })
146145
}, [alwaysAllowModeSwitch, setAlwaysAllowModeSwitch])
147146

148-
const handleFinishTaskChange = useCallback(() => {
149-
const newValue = !(alwaysAllowFinishTask ?? false)
150-
setAlwaysAllowFinishTask(newValue)
151-
vscode.postMessage({ type: "alwaysAllowFinishTask", bool: newValue })
152-
}, [alwaysAllowFinishTask, setAlwaysAllowFinishTask])
147+
const handleSubtasksChange = useCallback(() => {
148+
const newValue = !(alwaysAllowSubtasks ?? false)
149+
setAlwaysAllowSubtasks(newValue)
150+
vscode.postMessage({ type: "alwaysAllowSubtasks", bool: newValue })
151+
}, [alwaysAllowSubtasks, setAlwaysAllowSubtasks])
153152

154153
const handleRetryChange = useCallback(() => {
155154
const newValue = !(alwaysApproveResubmit ?? false)
@@ -165,7 +164,7 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
165164
useBrowser: handleBrowserChange,
166165
useMcp: handleMcpChange,
167166
switchModes: handleModeSwitchChange,
168-
finishTask: handleFinishTaskChange,
167+
subtasks: handleSubtasksChange,
169168
retryRequests: handleRetryChange,
170169
}
171170

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ export const ChatRowContent = ({
452452
<div style={headerStyle}>
453453
{toolIcon("new-file")}
454454
<span style={{ fontWeight: "bold" }}>
455-
Roo wants to create a new task in <code>{tool.mode}</code> mode:
455+
Roo wants to create a new subtask in <code>{tool.mode}</code> mode:
456456
</span>
457457
</div>
458458
<div style={{ paddingLeft: "26px", marginTop: "4px" }}>
@@ -464,8 +464,8 @@ export const ChatRowContent = ({
464464
return (
465465
<>
466466
<div style={headerStyle}>
467-
{toolIcon("new-file")}
468-
<span style={{ fontWeight: "bold" }}>Roo wants to finish this task</span>
467+
{toolIcon("checklist")}
468+
<span style={{ fontWeight: "bold" }}>Roo wants to finish this subtask</span>
469469
</div>
470470
<div style={{ paddingLeft: "26px", marginTop: "4px" }}>
471471
<code>{tool.content}</code>

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
6161
setMode,
6262
autoApprovalEnabled,
6363
alwaysAllowModeSwitch,
64-
alwaysAllowFinishTask,
64+
alwaysAllowSubtasks,
6565
customModes,
6666
telemetrySetting,
6767
} = useExtensionState()
@@ -150,7 +150,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
150150
setSecondaryButtonText("Reject")
151151
break
152152
case "finishTask":
153-
setPrimaryButtonText("Approve & Continue to the next Task")
153+
setPrimaryButtonText("Complete Subtask and Return")
154154
setSecondaryButtonText(undefined)
155155
break
156156
default:
@@ -646,11 +646,10 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
646646
(alwaysAllowMcp && message.ask === "use_mcp_server" && isMcpToolAlwaysAllowed(message)) ||
647647
(alwaysAllowModeSwitch &&
648648
message.ask === "tool" &&
649-
(JSON.parse(message.text || "{}")?.tool === "switchMode" ||
650-
JSON.parse(message.text || "{}")?.tool === "newTask")) ||
651-
(alwaysAllowFinishTask &&
649+
JSON.parse(message.text || "{}")?.tool === "switchMode") ||
650+
(alwaysAllowSubtasks &&
652651
message.ask === "tool" &&
653-
JSON.parse(message.text || "{}")?.tool === "finishTask")
652+
["newTask", "finishTask"].includes(JSON.parse(message.text || "{}")?.tool))
654653
)
655654
},
656655
[
@@ -665,7 +664,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
665664
alwaysAllowMcp,
666665
isMcpToolAlwaysAllowed,
667666
alwaysAllowModeSwitch,
668-
alwaysAllowFinishTask,
667+
alwaysAllowSubtasks,
669668
],
670669
)
671670

0 commit comments

Comments
 (0)