refactor: unify user content tags to <user_message> #10723
Draft
+44
−78
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.
Closes COM-450
Summary
Replace all user content wrapper tags (
<task>,<feedback>,<answer>) with a single unified<user_message>tag to standardize user content handling across the codebase.Implementation Details
Changes Made
processUserContentMentions.tsshouldProcessMentions()to only detect<user_message>responses.ts<feedback>to<user_message>, removedmessagefield from native protocol JSONTask.ts<task>to<user_message>, simplified continuation wrapperAttemptCompletionTool.ts<feedback>to<user_message>, removed explanatory blurbAskFollowupQuestionTool.ts<answer>to<user_message>ExecuteCommandTool.ts<feedback>to<user_message>, removed explanatory blurbTest Updates
processUserContentMentions.spec.ts- all tags changed to<user_message>Task.spec.ts- test descriptions and assertions updatedtask-tool-history.spec.ts- example text updatedreadFileTool.spec.ts- mock implementations updatedBreaking Changes
Old task history: Tasks saved before this change that contain
<task>,<feedback>, or<answer>tags in their API history will no longer have mentions re-parsed if the task is resumed.LLM context: For XML protocol, context blurbs are preserved. For native protocol, models no longer receive explicit blurbs in the JSON
messagefield - they must infer context from thestatusfield.Testing
All unit tests pass successfully. Linting and type checking completed without errors.
View task on Roo Code Cloud
Important
Refactor to unify user content handling by replacing various tags with
<user_message>across the codebase, affecting multiple files and tests.<task>,<feedback>,<answer>tags with<user_message>inprocessUserContentMentions.ts,responses.ts,Task.ts,AttemptCompletionTool.ts,AskFollowupQuestionTool.ts,ExecuteCommandTool.ts.shouldProcessMentions()inprocessUserContentMentions.tsto detect only<user_message>.messagefield from native protocol JSON inresponses.ts.processUserContentMentions.spec.ts,Task.spec.ts,task-tool-history.spec.ts,readFileTool.spec.tsto use<user_message>.<task>,<feedback>,<answer>tags won't re-parse mentions if resumed.statusfield, notmessagefield.This description was created by
for 08570c0. You can customize this summary. It will automatically update as commits are pushed.