Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.
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

Closed

Description

@pwilkin

Problem (one or two sentences)

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

  1. Create a task that requires understanding a large file
  2. Set max size of file read to eg. 500 lines
  3. 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

Variations tried (optional)

No response

App Version

3.36.16

API Provider (optional)

Not Applicable / Other

Model Used (optional)

GLM 4.6, Minimax M2, Kimi K2-Instruct

Roo Code Task Links (optional)

https://app.roocode.com/share/3bd34071-609f-48fb-87bc-f9a2a353c5c6

Relevant logs or errors (optional)

Activity

  1. pwilkin commented on Dec 20, 2025

    @pwilkin
    ContributorAuthor

    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

  2. pwilkin commented on Dec 20, 2025

    @pwilkin
    ContributorAuthor

    @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).

  3. hannesrudolph commented on Dec 21, 2025

    @hannesrudolph
    Contributor

    @roomote the simple read file tool is only used for grok models isn't it?

  4. pwilkin commented on Dec 21, 2025

    @pwilkin
    ContributorAuthor

    @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.

  5. 8 remaining items

  6. added
    Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.
    and removed
    Issue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.
    on Jan 7, 2026
  7. 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
  8. 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
  9. moved this from Issue [In Progress] to Done in Roo Code Roadmapon Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions