Skip to content

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
fix/new-task-mode-slug-param-consistency
Draft

fix: rename new_task mode param to mode_slug for consistency with switch_mode#11940
roomote-v0[bot] wants to merge 1 commit intomainfrom
fix/new-task-mode-slug-param-consistency

Conversation

@roomote-v0
Copy link
Contributor

@roomote-v0 roomote-v0 bot commented Mar 16, 2026

This PR attempts to address Issue #11861. Feedback and guidance are welcome.

Problem

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 calling new_task, or the LLM using mode_slug when new_task expected mode.

Solution

Renamed the new_task parameter from mode to mode_slug to be consistent with switch_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 definition
  • src/shared/tools.ts - NativeToolArgs and NewTaskToolUse type definitions
  • src/core/tools/NewTaskTool.ts - Parameter extraction and validation
  • src/core/assistant-message/NativeToolCallParser.ts - Native tool parsing (partial and complete)
  • src/core/assistant-message/presentAssistantMessage.ts - Display logic
  • Test files updated to match new parameter name

Testing

All 41 tests across 3 test files pass. Lint and type checks pass across the entire monorepo.

Interactively review PR in Roo Code Cloud

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant