-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
This issue is related to functionality discussed in PR #3995 regarding how files are read.
Problem
There are cases where line-range reads are useful even when the "Always read entire file" setting is enabled:
- When pasting a diff that has line references for use by the model
- The result of
git grep -n - The result of
<search_files> - The result of
<list_code_definitions> - Output from
<execute_command>running tools likegit blame,lintcommands, and other development tools - Error messages and warnings from compilers/linters that include line numbers
- Other tools that display code with line number references
Testing has shown that models (particularly gemini-2.5) with @samhvw8's implementation of multi-read_file effectively handle multiple line ranges in these scenarios, and the line-range-targeted result is extremely useful on large files.
Implementation Suggestion
The bigger problem trying to be addressed appears to be that the model will re-read ranges after it has read the entire file, which is unnecessary.
A more effective solution than disabling line ranges would be to track file modification time along with line ranges and reject redundant reads if a line range is already loaded since the last file modification. Modification times could be stored in the task JSON files for all file I/O operations to handle this effectively.
Version Information
App version: v3.18.4
Metadata
Metadata
Assignees
Labels
Type
Projects
Status