Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Nov 20, 2025

Summary

Enhances the native apply_diff tool definition by adding concrete examples and clearer documentation to reduce agent confusion when using the tool.

Changes

  • Added explicit format documentation showing the structure directly
  • Included concrete usage examples:
    • Single change: { path: 'src/utils.ts', diff: '<<<<<<< SEARCH\\n:start_line:5\\n-------\\nfunction add(a, b) {...' }
    • Multiple changes with different start_line values
  • Simplified structure explanation (removed verbose 'followed by this, then this, then that')
  • Added critical warning about using exactly ONE line of '=======' separator
  • Clarified that start_line uses actual numbers (e.g., :start_line:5, not :start_line:[5])
  • Updated both main description and diff parameter description for consistency

Motivation

The native tool definition was missing concrete examples that the XML version had, which likely caused agents to:

  • Use placeholder format like :start_line:[5] instead of actual numbers
  • Misunderstand the multi-block structure
  • Miss critical warnings about separator usage

This brings the native version closer to the clarity of the XML version without changing the schema structure.

Testing

  • Linting passes
  • Type checking passes
  • All tests pass

Related


Important

Enhances apply_diff tool documentation with examples and clearer instructions to reduce user confusion.

  • Documentation Enhancements:
    • Added examples for single and multiple changes in apply_diff tool description.
    • Clarified format and structure of search/replace blocks in apply_diff.
    • Included critical warning about using exactly one '=======' line.
    • Updated descriptions to use actual line numbers (e.g., :start_line:5).

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

- Add explicit format documentation showing structure directly
- Include concrete examples (single and multiple edits)
- Simplify structure explanation (removed verbose 'then this, then that')
- Add critical warning about single '=======' separator
- Clarify start_line uses actual numbers in examples

This addresses agent confusion similar to read_file improvements.
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. documentation Improvements or additions to documentation labels Nov 20, 2025
@roomote
Copy link
Contributor

roomote bot commented Nov 20, 2025

Rooviewer Clock   See task on Roo Cloud

Review completed. No issues found - the changes are documentation improvements that enhance clarity without introducing bugs or functional problems.

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 Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

3 participants