Per user feedback, keep the explanatory blurbs before the user content:
- toolDeniedWithFeedback: 'The user denied this operation and responded with the message:'
- toolApprovedWithFeedback: 'The user approved this operation and responded with the message:'
- tooManyMistakes: 'You seem to be having trouble proceeding...'
Native protocol still uses status field in JSON for context.
- src/services/command/built-in-commands.ts: Change <task> to <user_message> in init command
- src/core/tools/ExecuteCommandTool.ts: Change <feedback> to <user_message> for running command feedback
- src/core/mentions/processUserContentMentions.ts: Update comment to reflect new tag
- src/core/tools/__tests__/readFileTool.spec.ts: Update mock implementations
Note: <task> tags in fetch_instructions tool remain unchanged as they are
XML tool parameters (parameter name = 'task'), not user content wrappers.
Replace all user content wrapper tags (<task>, <feedback>, <answer>, <user_message>)
with a single unified <user_message> tag and strip all accompanying explanatory blurbs.
Changes:
- processUserContentMentions.ts: Simplified shouldProcessMentions() to only detect <user_message>
- responses.ts: Updated toolDeniedWithFeedback(), toolApprovedWithFeedback(), tooManyMistakes()
- Removed explanatory blurbs from XML output
- Removed 'message' field from native protocol JSON
- Task.ts: Changed initial task and continuation wrappers to use <user_message>
- AttemptCompletionTool.ts: Removed blurb, changed <feedback> to <user_message>
- AskFollowupQuestionTool.ts: Changed <answer> to <user_message>
- Updated all related test files
Breaking changes:
- Old task history with <task>, <feedback>, or <answer> tags will no longer have mentions re-parsed
- Models no longer receive explicit blurbs explaining the nature of user input
When tools are called in parallel (e.g., update_todo_list + new_task),
the tool results accumulate in userMessageContent but aren't saved to
API history until all tools complete. When new_task triggers delegation,
the parent is disposed before these pending results are saved, causing
400 errors when the parent resumes (missing tool_result for tool_use).
This fix:
- Adds flushPendingToolResultsToHistory() method in Task.ts that saves
pending userMessageContent to API history
- Calls this method in delegateParentAndOpenChild() before disposing the
parent task
- Safe for both native/XML protocols and sequential/parallel execution
(returns early if there's nothing to flush)
- Import resolveToolProtocol and TOOL_PROTOCOL from @roo-code/types
- Add tools and tool_choice to completion params when native protocol is enabled
- Handle tool_call_partial chunks in streaming response
- Add comprehensive tests for native tool support