Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Dec 4, 2025

Summary

Replace all user content wrapper tags (<task>, <feedback>, <answer>, <user_message>) with a single unified <user_message> tag and strip all accompanying explanatory blurbs.

Implementation Details

Based on plan: docs/plans/unify-user-message-tags.md

Changes Made

File Changes
src/core/mentions/processUserContentMentions.ts Simplified shouldProcessMentions() to only detect <user_message>
src/core/prompts/responses.ts Updated 3 functions: removed blurbs from XML, removed message field from native protocol JSON
src/core/task/Task.ts Changed initial task and continuation wrappers to use <user_message>
src/core/tools/AttemptCompletionTool.ts Removed blurb, changed <feedback> to <user_message>
src/core/tools/AskFollowupQuestionTool.ts Changed <answer> to <user_message>
src/core/tools/ExecuteCommandTool.ts Removed blurb, changed <feedback> to <user_message> for running commands

Test Updates

  • Updated processUserContentMentions.spec.ts - all tags changed to <user_message>
  • Updated Task.spec.ts - test descriptions and assertions updated
  • Updated task-tool-history.spec.ts - example text updated
  • Updated readFileTool.spec.ts - test assertions updated

Breaking Changes

  1. 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.

  2. LLM context: Models will no longer receive explicit blurbs explaining the nature of user input. The model must infer context from:

    • The tool_result status field (in native protocol)
    • The surrounding conversation context

Testing

All unit tests pass successfully.


Important

Refactor to unify user content tags into <user_message>, simplifying content handling and updating related tests.

  • Behavior:
    • Unified all user content tags (<task>, <feedback>, <answer>) into <user_message> in processUserContentMentions.ts, responses.ts, Task.ts, AttemptCompletionTool.ts, AskFollowupQuestionTool.ts, and ExecuteCommandTool.ts.
    • Removed explanatory blurbs from XML and JSON responses in responses.ts.
  • Tests:
    • Updated tests in processUserContentMentions.spec.ts, Task.spec.ts, task-tool-history.spec.ts, and readFileTool.spec.ts to reflect tag changes.
  • Breaking Changes:
    • Old tasks with <task>, <feedback>, or <answer> tags will not re-parse mentions if resumed.
    • LLM context no longer includes explicit blurbs; models must infer context from conversation.

This description was created by Ellipsis for a54e40f. You can customize this summary. It will automatically update as commits are pushed.

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
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 4, 2025
@roomote
Copy link
Contributor

roomote bot commented Dec 4, 2025

Oroocle Clock   Follow along on Roo Cloud

Re-review complete. I found 1 new issue since the previous review (see inline comment).

  • Fix Ark host detection when a port is present (use URL.hostname instead of URL.host for ".volces.com" checks)
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 4, 2025
- 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.
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.
@RooCodeInc RooCodeInc deleted a comment from github-actions bot Dec 4, 2025
@hannesrudolph hannesrudolph moved this from Triage to PR [Changes Requested] in Roo Code Roadmap Dec 12, 2025
@hannesrudolph hannesrudolph moved this from PR [Changes Requested] to PR [Draft / In Progress] in Roo Code Roadmap Dec 12, 2025
@hannesrudolph hannesrudolph marked this pull request as draft December 12, 2025 23:03
@hannesrudolph hannesrudolph added PR - Draft / In Progress and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Dec 12, 2025
@github-project-automation github-project-automation bot moved this from PR [Draft / In Progress] to Done in Roo Code Roadmap Jan 6, 2026
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jan 6, 2026
@hannesrudolph hannesrudolph reopened this Jan 10, 2026
@github-project-automation github-project-automation bot moved this from Done to New in Roo Code Roadmap Jan 10, 2026
@roomote
Copy link
Contributor

roomote bot commented Jan 10, 2026

Oroocle Clock   See task on Roo Cloud

Review complete. No code issues found in the diff; PR is currently marked as draft and GitHub reports merge conflicts.

  • Resolve merge conflicts with main (PR currently "CONFLICTING")
  • Mark PR as ready for review when ready

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph
Copy link
Collaborator Author

@roomote create a new task in PR Fixer mode for this PR.

@roomote
Copy link
Contributor

roomote bot commented Jan 10, 2026

Fixaroo Clock   See task on Roo Cloud

Resolved merge conflicts with main branch. All tests and checks passed.

View commit | Revert commit

roomote and others added 2 commits January 10, 2026 21:43
Resolved conflicts in:
- src/core/mentions/processUserContentMentions.ts: Keep unified <user_message> tag comment while adopting mode capture refactor from main
- src/core/mentions/__tests__/processUserContentMentions.spec.ts: Keep removal of <feedback> test consistent with PR goal

All tests pass.
@github-actions
Copy link
Contributor

🚀 Preview deployed!

Your changes have been deployed to Vercel:

Preview URL: https://roo-code-website-hj9poo52w-roo-code.vercel.app

This preview will be updated automatically when you push new commits to this PR.

…fix)

Replace substring check with proper URL host parsing to prevent
incomplete URL substring sanitization. The previous check using
modelUrl.includes(".volces.com") could be bypassed by placing
the string anywhere in the URL (path, query string, etc.).

Now using _getUrlHost() to properly parse the URL and validate
that the host either equals "volces.com" or ends with ".volces.com",
consistent with how Azure is already validated in the codebase.
const isAzureAiInference = this._isAzureAiInference(modelUrl)
const deepseekReasoner = modelId.includes("deepseek-reasoner") || enabledR1Format
const modelUrlHost = this._getUrlHost(modelUrl)
const ark = modelUrlHost === "volces.com" || modelUrlHost.endsWith(".volces.com")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The domain check uses URL.host, which includes the port (for example api.volces.com:443), so endsWith('.volces.com') will fail if the user config includes a port; using URL.hostname (or otherwise stripping the port) would make this host validation behave as intended.

Fix it with Roo Code or mention @roomote and request a fix.

@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Jan 10, 2026

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at help@ellipsis.dev


Generated with ❤️ by ellipsis.dev

const isAzureAiInference = this._isAzureAiInference(modelUrl)
const deepseekReasoner = modelId.includes("deepseek-reasoner") || enabledR1Format
const modelUrlHost = this._getUrlHost(modelUrl)
const ark = modelUrlHost === "volces.com" || modelUrlHost.endsWith(".volces.com")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes how we detect Ark (Volces) endpoints: new URL(baseUrl).host returns a host including the port (e.g. example.volces.com:443), so the new .endsWith('.volces.com') check will fail when a port is present. Using hostname instead would keep the allowlist behavior consistent across URLs with/without ports.

Fix it with Roo Code or mention @roomote and request a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR - Draft / In Progress size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants