File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -668,6 +668,10 @@ export namespace Config {
668668 chatMaxRetries : z . number ( ) . optional ( ) . describe ( "Number of retries for chat completions on failure" ) ,
669669 disable_paste_summary : z . boolean ( ) . optional ( ) ,
670670 batch_tool : z . boolean ( ) . optional ( ) . describe ( "Enable the batch tool" ) ,
671+ primary_tools : z
672+ . array ( z . string ( ) )
673+ . optional ( )
674+ . describe ( "Tools that should only be available to primary agents." ) ,
671675 } )
672676 . optional ( ) ,
673677 } )
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { Agent } from "../agent/agent"
99import { SessionPrompt } from "../session/prompt"
1010import { iife } from "@/util/iife"
1111import { defer } from "@/util/defer"
12+ import { Config } from "../config/config"
1213
1314export const TaskTool = Tool . define ( "task" , async ( ) => {
1415 const agents = await Agent . list ( ) . then ( ( x ) => x . filter ( ( a ) => a . mode !== "primary" ) )
@@ -77,6 +78,8 @@ export const TaskTool = Tool.define("task", async () => {
7778 ctx . abort . addEventListener ( "abort" , cancel )
7879 using _ = defer ( ( ) => ctx . abort . removeEventListener ( "abort" , cancel ) )
7980 const promptParts = await SessionPrompt . resolvePromptParts ( params . prompt )
81+
82+ const config = await Config . get ( )
8083 const result = await SessionPrompt . prompt ( {
8184 messageID,
8285 sessionID : session . id ,
@@ -89,6 +92,7 @@ export const TaskTool = Tool.define("task", async () => {
8992 todowrite : false ,
9093 todoread : false ,
9194 task : false ,
95+ ...Object . fromEntries ( ( config . experimental ?. primary_tools ?? [ ] ) . map ( ( t ) => [ t , false ] ) ) ,
9296 ...agent . tools ,
9397 } ,
9498 parts : promptParts ,
Original file line number Diff line number Diff line change @@ -1249,6 +1249,10 @@ export type Config = {
12491249 * Enable the batch tool
12501250 */
12511251 batch_tool ?: boolean
1252+ /**
1253+ * Tools that should only be available to primary agents.
1254+ */
1255+ primary_tools ?: Array < string >
12521256 }
12531257}
12541258
You can’t perform that action at this time.
0 commit comments