fix: rename new_task mode param to mode_slug for consistency with switch_mode#11940
Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
Draft
fix: rename new_task mode param to mode_slug for consistency with switch_mode#11940roomote-v0[bot] wants to merge 1 commit intomainfrom
roomote-v0[bot] wants to merge 1 commit intomainfrom
Conversation
…tch_mode The new_task tool used "mode" as its parameter name while switch_mode used "mode_slug" for the same concept (a mode slug). This inconsistency caused LLMs to confuse the parameter names between the two tools, leading to errors like "Missing value for required parameter mode_slug" when using new_task. Renamed the new_task parameter from "mode" to "mode_slug" to match switch_mode, eliminating the source of LLM confusion. Fixes #11861
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR attempts to address Issue #11861. Feedback and guidance are welcome.
Problem
The
new_tasktool usedmodeas its parameter name whileswitch_modeusedmode_slugfor the same concept (a mode slug). This inconsistency caused LLMs to confuse the parameter names between the two tools, leading to errors like "Missing value for required parameter 'mode_slug'" when callingnew_task, or the LLM usingmode_slugwhennew_taskexpectedmode.Solution
Renamed the
new_taskparameter frommodetomode_slugto be consistent withswitch_mode. Both mode-related tools now use the same parameter name, eliminating the source of LLM confusion.Changes
src/core/prompts/tools/native-tools/new_task.ts- Tool schema definitionsrc/shared/tools.ts-NativeToolArgsandNewTaskToolUsetype definitionssrc/core/tools/NewTaskTool.ts- Parameter extraction and validationsrc/core/assistant-message/NativeToolCallParser.ts- Native tool parsing (partial and complete)src/core/assistant-message/presentAssistantMessage.ts- Display logicTesting
All 41 tests across 3 test files pass. Lint and type checks pass across the entire monorepo.
Interactively review PR in Roo Code Cloud