fix(filesystem): support ranged file reads - #3895
Merged
Merged
Conversation
Add ACP-aligned line and limit arguments to read_file and preserve the head of oversized read results with actionable continuation guidance. Keep tail truncation for shell and external tools. Fixes #3889
trungutt
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lineand positivelimitarguments toread_fileread_fileresults and provide actionable continuation guidanceFixes #3889.
Issue expectations
read_fileaccepts ACP-alignedlineandlimitargumentsread_fileresults retain the head instead of the taillineandlimitThe issue's smaller suggestions about directory-entry byte sizes and
edit_filereplacement semantics are intentionally left for separate changes.Validation
task linttask buildtask check-plan-crossThe compiled CLI E2E verified the full model/tool loop: the first read retained front matter and suggested line 88, subsequent ranged reads progressed through the file and reached its tail, and the command exited successfully. The same scenario on the baseline commit retained only the tail and provided no ranged-read recovery.
The repository-wide test run reaches unrelated, environment-dependent failures in existing non-public-address/SSRF tests because this host routes private addresses instead of rejecting them. The affected packages and cassette tests pass independently.