Skip to content

Commit 4a36340

Browse files
committed
Fix issues with subtasks attempting completion along with commands
1 parent 40ee5cf commit 4a36340

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

src/core/tools/attemptCompletionTool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export async function attemptCompletionTool(
108108
}
109109

110110
// tell the provider to remove the current subtask and resume the previous task in the stack
111-
await cline.providerRef.deref()?.finishSubTask(lastMessage?.text ?? "")
111+
await cline.providerRef.deref()?.finishSubTask(result)
112112
return
113113
}
114114

src/core/tools/executeCommandTool.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { ToolUse, AskApproval, HandleError, PushToolResult, RemoveClosingTag, To
99
import { formatResponse } from "../prompts/responses"
1010
import { unescapeHtmlEntities } from "../../utils/text-normalization"
1111
import { telemetryService } from "../../services/telemetry/TelemetryService"
12-
import { ExitCodeDetails, RooTerminalCallbacks, RooTerminalProcess } from "../../integrations/terminal/types"
12+
import { ExitCodeDetails, RooTerminalCallbacks } from "../../integrations/terminal/types"
1313
import { TerminalRegistry } from "../../integrations/terminal/TerminalRegistry"
1414
import { Terminal } from "../../integrations/terminal/Terminal"
1515

@@ -140,7 +140,6 @@ export async function executeCommand(
140140
}
141141

142142
let message: { text?: string; images?: string[] } | undefined
143-
let runInBackground = false
144143
let completed = false
145144
let result: string = ""
146145
let exitDetails: ExitCodeDetails | undefined
@@ -150,23 +149,9 @@ export async function executeCommand(
150149
const clineProvider = await cline.providerRef.deref()
151150

152151
const callbacks: RooTerminalCallbacks = {
153-
onLine: async (output: string, process: RooTerminalProcess) => {
152+
onLine: async (output: string) => {
154153
const status: CommandExecutionStatus = { executionId, status: "output", output }
155154
clineProvider?.postMessageToWebview({ type: "commandExecutionStatus", text: JSON.stringify(status) })
156-
157-
if (runInBackground) {
158-
return
159-
}
160-
161-
try {
162-
const { response, text, images } = await cline.ask("command_output", "")
163-
runInBackground = true
164-
165-
if (response === "messageResponse") {
166-
message = { text, images }
167-
process.continue()
168-
}
169-
} catch (_error) {}
170155
},
171156
onCompleted: (output: string | undefined) => {
172157
result = Terminal.compressTerminalOutput(output ?? "", terminalOutputLineLimit)

0 commit comments

Comments
 (0)