Skip to content

Commit 4664955

Browse files
hannesrudolphCopilotMerge Resolverroomote
authored
feat: add optional todos parameter to new_task tool with experimental setting (RooCodeInc#6329) (RooCodeInc#6775)
* feat: add optional todos parameter to new_task tool with experimental setting (RooCodeInc#6329) - Add optional todos parameter to new_task tool for hierarchical task planning - Implement experimental setting to optionally require todos parameter - Add clean state-based UI rendering to avoid spurious messages - Export and reuse parseMarkdownChecklist function - Add comprehensive test coverage for both optional and required modes - Maintain full backward compatibility (todos optional by default) * fix: update new_task tool example to include todos parameter - Updated the example in tool-use.ts to show the todos parameter - This prevents AI confusion about whether todos is a valid parameter - The example now demonstrates the complete tool usage pattern * fix: make new_task tool definition dynamic based on experimental setting - Tool description now changes based on newTaskRequireTodos setting - When disabled: shows todos as (optional) - When enabled: shows todos as (required) with no mention of configuration - Added tests to verify dynamic behavior - Ensures AI models get unambiguous instructions based on current settings * fix: add translations for newTaskRequireTodos experimental setting - Added translations for all 17 supported languages - Ensures consistent UI experience across all locales * test: update snapshots for new_task tool example with todos parameter - Updated 13 snapshot files to reflect the new tool-use example - All tests now pass with the updated example format * Update src/core/tools/newTaskTool.ts Co-authored-by: Copilot <[email protected]> * fix: address PR review comments - Replace any[] with TodoItem[] type in ExtensionStateContext.tsx for better type safety - Remove redundant initialTodos parameter from startTask call in Task.ts (todos already set in constructor) - Improve code clarity in newTaskTool.ts by checking provider reference early and reusing state # Conflicts: # src/core/task/Task.ts # webview-ui/src/context/ExtensionStateContext.tsx * fix: revert order of operations in startTask to fix integration test timeout The change in order of operations (calling say() before postStateToWebview()) was causing the XML content file test to timeout. Reverting to the original order fixes the issue. * fix: hide todos parameter from new_task tool prompt when experiment is disabled - Modified getNewTaskDescription to completely omit todos parameter when experiment is off - Updated tests to verify todos parameter is not shown at all when disabled - Ensures tool prompt remains unchanged when experimental setting is disabled - Maintains backward compatibility while providing cleaner prompt interface * fix: update snapshots for new_task tool todos parameter - Updated snapshots in add-custom-instructions.spec.ts - Updated snapshots in system-prompt.spec.ts - All tests now passing with the new todos parameter documentation * feat: move newTaskRequireTodos from experimental to VSCode settings - Added newTaskRequireTodos as a VSCode configuration property in src/package.json - Added description in src/package.nls.json - Updated newTaskTool.ts to read from VSCode configuration instead of experiments - Removed NEW_TASK_REQUIRE_TODOS from experimental settings in src/shared/experiments.ts - Removed newTaskRequireTodos from packages/types/src/experiment.ts - Updated tests to use VSCode configuration mocking instead of experiments - Removed references from experiments test file - Maintains backward compatibility (defaults to false) * fix: make new_task tool description dynamically reflect VSCode setting - Updated new-task.ts to check args.settings instead of args.experiments - Added newTaskRequireTodos to SystemPromptSettings interface - Pass newTaskRequireTodos setting through Task.ts and generateSystemPrompt.ts - Updated all related tests to use settings instead of experiments - Fixed TypeScript errors in test files by adding newTaskRequireTodos property This ensures the tool description correctly shows todos parameter as required/optional based on the VSCode setting value, fixing the issue where Roo would try to use new_task without the todos parameter when it was required. --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Merge Resolver <[email protected]> Co-authored-by: Roo Code <[email protected]>
1 parent ef34080 commit 4664955

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+929
-28
lines changed

packages/types/src/experiment.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ import type { Keys, Equals, AssertEqual } from "./type-fu.js"
66
* ExperimentId
77
*/
88

9-
export const experimentIds = ["powerSteering", "multiFileApplyDiff", "preventFocusDisruption", "assistantMessageParser"] as const
9+
export const experimentIds = [
10+
"powerSteering",
11+
"multiFileApplyDiff",
12+
"preventFocusDisruption",
13+
"assistantMessageParser",
14+
] as const
1015

1116
export const experimentIdsSchema = z.enum(experimentIds)
1217

src/core/prompts/__tests__/__snapshots__/add-custom-instructions/architect-mode-prompt.snap

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/__snapshots__/add-custom-instructions/ask-mode-prompt.snap

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/__snapshots__/add-custom-instructions/mcp-server-creation-disabled.snap

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/__snapshots__/add-custom-instructions/mcp-server-creation-enabled.snap

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/__snapshots__/add-custom-instructions/partial-reads-enabled.snap

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/__snapshots__/system-prompt/consistent-system-prompt.snap

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/__snapshots__/system-prompt/with-computer-use-support.snap

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-false.snap

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/__snapshots__/system-prompt/with-diff-enabled-true.snap

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)