Skip to content

bug(read tool): fails to read lines from large file even when within byte limit #1605

@dariuszkowalski-com

Description

@dariuszkowalski-com

Description

When attempting to read specific lines from a file larger than the enforced maximum size (262144 bytes), the read tool fails. This occurs even when the requested range of lines is small, and the number of bytes in the requested lines is well under the maximum size limit.

Current Behavior

The read tool refuses to read any content if the file exceeds the maximum allowed size. It does not check if the requested range of lines stays within the allowed byte limit.

Expected Behavior

The read tool should allow reading a subset of lines from a file larger than the maximum limit as long as the total size of the requested content is under 262144 bytes.

Steps to Reproduce

  1. Create or use a file larger than 262144 bytes.
  2. Use the read tool with start_line and end_line set to a small range (e.g., 4005–4010).
  3. Ensure the selected lines are well under the max byte threshold.
  4. Observe that the read tool still fails to return the requested content.

Environment

  • Forge Version: 0.120.1
  • OS: WSL2

Screenshots/Logs

Image

Additional Context

This issue prevents efficiently working with large files when only a small portion is required. It also limits usability in workflows where log files or datasets commonly exceed 262144 bytes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: inactiveNo current action needed/possible; issue fixed, out of scope, or superseded.type: bugSomething isn't working.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions