You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 15, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on May 15, 2026. It is now read-only.
[BUG] Incremental file reading is broken across multiple providers #10239
When introducing a context size limit to read_file, even very strong open models fail to read files correctly, instead often falling into a loop of calling read_file again and again.
Context (who is affected and when)
When there is a large file and there's a need to read it incrementally, models will often fail to properly use line ranges.
Reproduction steps
Create a task that requires understanding a large file
Set max size of file read to eg. 500 lines
Run the task
Expected result
The model reads the file with line ranges incrementally
Actual result
The model re-reads the start of the file again and again
The way I see it, one of two approaches would be worthwhile:
a) add a default "cursor" behavior to limited read_file, with consecutive reads providing consecutive fragments of the file, with an optional "reset" modifier
b) add stronger guidelines to the read_file tool when line limits are present, maybe with a one-shot example of how to proceed with reading the entire file with chunked reading
@roomote Looks reasonable, but the feedback should be even clearer, like "To continue reading, use the read_file tool again with the line_range parameter starting at line 501...".
Also, can you check if the simpleReadFileTool even HAS line-range support? Because if not, that could be the problem.
And for versatility, the tool should accept both a single range (with line_range) and multiple ranges (with line_ranges).
ghost added a commit that references this issue on Dec 20, 2025
@roomote Which exactly parameter is used in native mode: line_range (singular) or line_ranges (plural)?
I feel like a lot of confusion stems from this and the differing syntax (XML: range string with format start-end, native: JSON array of JSON 2-element arrays of line ranges). The syntax should be unified, preferrably into the simple text-based one and only one parameter should be used. If needed, multiple line ranges can be specified with commas, eg. 100-500,700-1200, but I feel like the multiple line-range use case is very rare and shouldn't sabotage the much more typical cases.
changed the title [-][BUG] Incremental file reading is broken across multiple providers[/-][+][BUG] Incremental file reading is broken across multiple providers [COM-396][/+]on Jan 8, 2026
changed the title [-][BUG] Incremental file reading is broken across multiple providers [COM-396][/-][+][BUG] Incremental file reading is broken across multiple providers[/+]on Jan 9, 2026
Activity
pwilkin commentedon Dec 20, 2025
The way I see it, one of two approaches would be worthwhile:
a) add a default "cursor" behavior to limited read_file, with consecutive reads providing consecutive fragments of the file, with an optional "reset" modifier
b) add stronger guidelines to the read_file tool when line limits are present, maybe with a one-shot example of how to proceed with reading the entire file with chunked reading
pwilkin commentedon Dec 20, 2025
@roomote Looks reasonable, but the feedback should be even clearer, like "To continue reading, use the read_file tool again with the line_range parameter starting at line 501...".
Also, can you check if the simpleReadFileTool even HAS line-range support? Because if not, that could be the problem.
And for versatility, the tool should accept both a single range (with line_range) and multiple ranges (with line_ranges).
feat: add line_range support to simpleReadFileTool and improve trunca…
hannesrudolph commentedon Dec 21, 2025
@roomote the simple read file tool is only used for grok models isn't it?
pwilkin commentedon Dec 21, 2025
@roomote Which exactly parameter is used in native mode:
line_range(singular) orline_ranges(plural)?I feel like a lot of confusion stems from this and the differing syntax (XML: range string with format
start-end, native: JSON array of JSON 2-element arrays of line ranges). The syntax should be unified, preferrably into the simple text-based one and only one parameter should be used. If needed, multiple line ranges can be specified with commas, eg.100-500,700-1200, but I feel like the multiple line-range use case is very rare and shouldn't sabotage the much more typical cases.8 remaining items
[-][BUG] Incremental file reading is broken across multiple providers[/-][+][BUG] Incremental file reading is broken across multiple providers [COM-396][/+][-][BUG] Incremental file reading is broken across multiple providers [COM-396][/-][+][BUG] Incremental file reading is broken across multiple providers[/+]