Add a new_task tool

This commit is contained in:
Matt Rubens
2025-01-29 01:28:32 -05:00
parent 4026a87d2c
commit 13de490c3b
12 changed files with 343 additions and 9 deletions

View File

@@ -75,10 +75,11 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
},
{
id: "switchModes",
label: "Switch between modes",
label: "Switch modes & create tasks",
shortName: "Modes",
enabled: alwaysAllowModeSwitch ?? false,
description: "Allows automatic switching between different AI modes without requiring approval.",
description:
"Allows automatic switching between different AI modes and creating new tasks without requiring approval.",
},
{
id: "retryRequests",

View File

@@ -473,6 +473,20 @@ export const ChatRowContent = ({
</div>
</>
)
case "newTask":
return (
<>
<div style={headerStyle}>
{toolIcon("new-file")}
<span style={{ fontWeight: "bold" }}>
Roo wants to create a new task in <code>{tool.mode}</code> mode:
</span>
</div>
<div style={{ paddingLeft: "26px", marginTop: "4px" }}>
<code>{tool.content}</code>
</div>
</>
)
default:
return null
}

View File

@@ -569,7 +569,8 @@ 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 === "switchMode" ||
JSON.parse(message.text || "{}")?.tool === "newTask"))
)
},
[

View File

@@ -344,10 +344,11 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
<VSCodeCheckbox
checked={alwaysAllowModeSwitch}
onChange={(e: any) => setAlwaysAllowModeSwitch(e.target.checked)}>
<span style={{ fontWeight: "500" }}>Always approve mode switching</span>
<span style={{ fontWeight: "500" }}>Always approve mode switching & task creation</span>
</VSCodeCheckbox>
<p style={{ fontSize: "12px", marginTop: "5px", color: "var(--vscode-descriptionForeground)" }}>
Automatically switch between different AI modes without requiring approval
Automatically switch between different AI modes and create new tasks without requiring
approval
</p>
</div>