Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Nov 13, 2025

This PR updates Task.startTask() to send the initial user content wrapped in instead of .

This PR switches the initial wrapper to a with the aim of preventing focus drift after context-management event (condense/truncate). The aim of this the most minimal adjustment to address this drift that is likely caused by the user messages which are structured as follows

The user has provided feedback on the results. Consider their input to continue the task, and then attempt completion again.\n<feedback>\nUSER MESSAGE GOES HERE\n</feedback>

This hints to the model to change focus to the "" which only the very first message is wrapped in. Condensing used to condense and remove the first message so this mention of task was seen as more of a general reference to the "task" and not the specific wrapped user input. Since we changed this the original block is much more likely to steal focus and this prevents the session from properly continuing from after the condensing summary as intended.

Why:

  • Prevent focus drift after a successful context-management event by signaling the next user block as feedback rather than a new task.
  • Aligns with existing flows that emit (attempt-completion and standard responses).
  • Mentions parsing already treats as a trigger, so enrichment behavior is unchanged.

Impact:

  • No change to tool execution, streaming, checkpointing, or persistence.
  • Unit tests for mentions continue to pass as both and are supported.

Important

Refactor Task.startTask() to use <feedback> instead of <task> to prevent focus drift, updating related tests and maintaining existing functionality.

  • Behavior:
    • Task.startTask() in Task.ts now wraps initial user content in <feedback> instead of <task> to prevent focus drift.
    • processUserContentMentions.ts updated to process <feedback> tags instead of <task>.
  • Tests:
    • Updated processUserContentMentions.spec.ts to reflect changes from <task> to <feedback>.
    • Updated Task.spec.ts to ensure task processing aligns with new <feedback> tag usage.
  • Impact:
    • No changes to tool execution, streaming, checkpointing, or persistence.
    • Unit tests confirm both <task> and <feedback> are supported.

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

…ask> to prevent focus drift after context-management

Rationale: After a successful context-management event, framing the next user block as feedback reduces model focus drift. Mentions parsing already supports <feedback>, and tool flows (attemptCompletion, responses) are aligned. No change to loop/persistence.
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Nov 13, 2025
@roomote
Copy link
Contributor

roomote bot commented Nov 13, 2025

Rooviewer Clock   See task on Roo Cloud

Review completed. Found 1 issue to address:

  • Update <task> wrapper in built-in-commands.ts to align with feedback standardization
Previous reviews

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

@hannesrudolph hannesrudolph changed the title refactor(task): switch to <feedback> wrapper to prevent focus drift after context-management refactor(task): switch to <feedback> wrapper to prevent focus drift after context-management event (condense/truncate) Nov 13, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Nov 13, 2025
@hannesrudolph hannesrudolph moved this from Triage to PR [Needs Review] in Roo Code Roadmap Nov 13, 2025
@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Nov 13, 2025
@mrubens
Copy link
Collaborator

mrubens commented Nov 13, 2025

I think there are a few other places we refer to <task> - can we clean those up too so other people don't get confused?

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Nov 14, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 14, 2025
@mrubens mrubens merged commit aaab2bf into main Nov 14, 2025
13 checks passed
@mrubens mrubens deleted the chore/initial-feedback-tag-20251113100752 branch November 14, 2025 01:02
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Nov 14, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer PR - Needs Review size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants