-
Notifications
You must be signed in to change notification settings - Fork 2.8k
refactor: unify user content tags to <user_message> #9808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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
Re-review complete. I found 1 new issue since the previous review (see inline comment).
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
- 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.
Review complete. No code issues found in the diff; PR is currently marked as draft and GitHub reports merge conflicts.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
|
@roomote create a new task in PR Fixer mode for this PR. |
Resolved merge conflicts with main branch. All tests and checks passed. |
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.
This reverts commit a54e40f.
|
🚀 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") |
There was a problem hiding this comment.
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.
|
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") |
There was a problem hiding this comment.
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.
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.mdChanges Made
src/core/mentions/processUserContentMentions.tsshouldProcessMentions()to only detect<user_message>src/core/prompts/responses.tsmessagefield from native protocol JSONsrc/core/task/Task.ts<user_message>src/core/tools/AttemptCompletionTool.ts<feedback>to<user_message>src/core/tools/AskFollowupQuestionTool.ts<answer>to<user_message>src/core/tools/ExecuteCommandTool.ts<feedback>to<user_message>for running commandsTest 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- test assertions 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: Models will no longer receive explicit blurbs explaining the nature of user input. The model must infer context from:
Testing
All unit tests pass successfully.
Important
Refactor to unify user content tags into
<user_message>, simplifying content handling and updating related tests.<task>,<feedback>,<answer>) into<user_message>inprocessUserContentMentions.ts,responses.ts,Task.ts,AttemptCompletionTool.ts,AskFollowupQuestionTool.ts, andExecuteCommandTool.ts.responses.ts.processUserContentMentions.spec.ts,Task.spec.ts,task-tool-history.spec.ts, andreadFileTool.spec.tsto reflect tag changes.<task>,<feedback>, or<answer>tags will not re-parse mentions if resumed.This description was created by
for a54e40f. You can customize this summary. It will automatically update as commits are pushed.