Skip to content

Commit 915cf76

Browse files
pashpashpashCline Evaluation
andauthored
Pashpashpash/bash tool (RooCodeInc#3894)
* bashTool * prettier * alignment * bashtool cont * bash tool cont * modularizing prompt a bit * bash tool working * bash tool now getting cwd * bashTool * forgot .name --------- Co-authored-by: Cline Evaluation <[email protected]>
1 parent f1fef24 commit 915cf76

File tree

6 files changed

+266
-374
lines changed

6 files changed

+266
-374
lines changed

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ webview-ui/build/
55
package-lock.json
66
src/core/prompts/system.ts
77
src/core/prompts/model_prompts/claude4.ts
8-
src/core/prompts/model_prompts/jsonToolToXml.ts

src/core/assistant-message/parse-assistant-message.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,15 @@ export function parseAssistantMessageV3(assistantMessage: string): AssistantMess
569569
}
570570
}
571571

572+
if (currentInvokeName === "Bash") {
573+
currentToolUse = {
574+
type: "tool_use",
575+
name: "execute_command",
576+
params: {},
577+
partial: true,
578+
}
579+
}
580+
572581
continue
573582
}
574583
}
@@ -621,6 +630,14 @@ export function parseAssistantMessageV3(assistantMessage: string): AssistantMess
621630
}
622631
}
623632

633+
if (currentToolUse && currentInvokeName === "Bash") {
634+
if (currentParameterName === "command") {
635+
currentToolUse.params["command"] = value
636+
} else if (currentParameterName === "requires_approval") {
637+
currentToolUse.params["requires_approval"] = value === "true" ? "true" : "false"
638+
}
639+
}
640+
624641
currentParameterName = ""
625642
continue
626643
}
@@ -633,7 +650,7 @@ export function parseAssistantMessageV3(assistantMessage: string): AssistantMess
633650
assistantMessage.startsWith(isInvokeClose, currentCharIndex - isInvokeClose.length + 1)
634651
) {
635652
// If we have a tool use from this invoke, finalize it
636-
if (currentToolUse && (currentInvokeName === "LS" || currentInvokeName === "Grep")) {
653+
if (currentToolUse && (currentInvokeName === "LS" || currentInvokeName === "Grep" || currentInvokeName === "Bash")) {
637654
currentToolUse.partial = false
638655
contentBlocks.push(currentToolUse)
639656
currentToolUse = undefined

0 commit comments

Comments
 (0)