Skip to content

Conversation

elianiva
Copy link

@elianiva elianiva commented Oct 4, 2025

Related GitHub Issue

Closes: #8077

Roo Code Task Context (Optional)

Description

This PR tells the model to support line-range read even when max line read is enabled.

Test Procedure

Added 3 more test cases to cover other use cases in the test file.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Documentation Updates

Additional Notes

Get in Touch

@elianiva


Important

Enhance read_file tool to support line ranges regardless of maxReadFileLine setting, with updated tests to verify behavior.

  • Behavior:
    • read-file.ts: Line ranges now bypass maxReadFileLine setting, allowing specific line reads regardless of the limit.
    • Task.ts: Always enable partial reads by setting partialReadsEnabled to true.
  • Tests:
    • readFileTool.spec.ts: Add tests to verify line ranges bypass maxReadFileLine in various scenarios, including when set to 0, -1, or a positive number.

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

@elianiva elianiva requested review from mrubens, cte and jr as code owners October 4, 2025 05:50
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Oct 4, 2025
Copy link

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

I found some issues that need attention.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 4, 2025
Copy link

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

I found some issues that need attention.

Copy link

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

I found some issues that need attention.

${isMultipleReadsEnabled ? `**IMPORTANT: You can read a maximum of ${maxConcurrentReads} files in a single request.** If you need to read more files, use multiple sequential read_file requests.` : "**IMPORTANT: Multiple file reads are currently disabled. You can only read one file at a time.**"}
${args.partialReadsEnabled ? `By specifying line ranges, you can efficiently read specific portions of large files without loading the entire file into memory.` : ""}
${args.partialReadsEnabled ? `**Line ranges bypass the "Always read entire file" setting** - when you specify explicit line ranges, you can read any lines from any file regardless of the maxReadFileLine configuration. This is useful for targeted work based on tool outputs that reference specific line numbers (e.g., linters, search results, diffs).` : ""}
Copy link

Choose a reason for hiding this comment

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

[P3] Docs alignment: New line‑range behavior is clear. While touching this doc, consider updating the earlier supported-formats sentence to reflect current code — it still says "PDF and DOCX" only, but the code also supports IPYNB. For consistency with implementation, mention all three, e.g. "PDF, DOCX, and IPYNB". See src/integrations/misc/extract-text.ts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: Triage
Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Allow line-range reads when "Always read entire file" is enabled
2 participants