From 01a550246178c6b746cd6ab2b6230853a2e64c27 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Tue, 12 May 2026 15:44:58 +0000 Subject: [PATCH] fix: resolve TypeScript errors in new_task.ts and tools.ts - Add missing closing brace for permissions property in new_task.ts - Add task_queue, permissions, background to required array (strict mode) - Consolidate duplicate new_task entries in NativeToolArgs (tools.ts) - Consolidate duplicate params entries in NewTaskToolUse (tools.ts) --- .../prompts/tools/native-tools/new_task.ts | 3 ++- src/shared/tools.ts | 18 +++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/core/prompts/tools/native-tools/new_task.ts b/src/core/prompts/tools/native-tools/new_task.ts index f846eaf73a..42da8faf4a 100644 --- a/src/core/prompts/tools/native-tools/new_task.ts +++ b/src/core/prompts/tools/native-tools/new_task.ts @@ -44,12 +44,13 @@ export default { permissions: { type: ["string", "null"], description: PERMISSIONS_PARAMETER_DESCRIPTION, + }, background: { type: ["string", "null"], description: BACKGROUND_PARAMETER_DESCRIPTION, }, }, - required: ["mode", "message", "todos"], + required: ["mode", "message", "todos", "task_queue", "permissions", "background"], additionalProperties: false, }, }, diff --git a/src/shared/tools.ts b/src/shared/tools.ts index 0179e1c551..4ecba976bb 100644 --- a/src/shared/tools.ts +++ b/src/shared/tools.ts @@ -105,9 +105,14 @@ export type NativeToolArgs = { edit_file: { file_path: string; old_string: string; new_string: string; expected_replacements?: number } apply_patch: { patch: string } list_files: { path: string; recursive?: boolean } - new_task: { mode: string; message: string; todos?: string; task_queue?: string; permissions?: string } - new_task: { mode: string; message: string; todos?: string; background?: string } - new_task: { mode: string; message: string; todos?: string } + new_task: { + mode: string + message: string + todos?: string + task_queue?: string + permissions?: string + background?: string + } ask_followup_question: { question: string follow_up: Array<{ text: string; mode?: string }> @@ -245,10 +250,9 @@ export interface SwitchModeToolUse extends ToolUse<"switch_mode"> { export interface NewTaskToolUse extends ToolUse<"new_task"> { name: "new_task" - params: Partial, "mode" | "message" | "todos" | "task_queue">> - params: Partial, "mode" | "message" | "todos" | "permissions">> - params: Partial, "mode" | "message" | "todos" | "background">> - params: Partial, "mode" | "message" | "todos">> + params: Partial< + Pick, "mode" | "message" | "todos" | "task_queue" | "permissions" | "background"> + > } export interface RunSlashCommandToolUse extends ToolUse<"run_slash_command"> {