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"))
)
},
[