-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Open
hannesrudolph
wants to merge
6
commits into
main
Choose a base branch
from
unify-user-message-tags
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+44
−77
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Contributor
Taking a look at your PR now. Feedback coming shortly! Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. 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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Issue/PR - Triage
New issue. Needs quick review to confirm validity and assign labels.
size:L
This PR changes 100-499 lines, ignoring generated files.
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.
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.