Force full file reads for files under 2000 lines#2271
Merged
hiroshinishio merged 1 commit intomainfrom Feb 18, 2026
Merged
Conversation
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
get_remote_file_contenttool description to instruct GA to always read full files by default, only usingstart_line/end_linefor files over 2000 linesline_number,keyword,start_line,end_line) are silently ignored and the full file is returnedContext
Root cause investigation of two failing SpiderPlus PRs (#13636, #13638) revealed that GA (Opus 4.6) truncated file reads - reading only the first 60 lines of a 460-line file and missing required data starting at line 87. The model decided to truncate, and we can't control that decision. So we removed the option entirely for files under 2000 lines - the tool now ignores truncation params and returns the full file regardless.
Social Media Post (GitAuto)
If you give an LLM a "read partial file" option, it will use it - even on a 460-line file it needs to fully understand. Our agent read only the first 60 lines and missed required fields at line 87. LLMs are lazy with context the same way devs are lazy with docs. The fix: don't offer the shortcut. Files under 2000 lines now always return in full, truncation params silently ignored.
Social Media Post (Wes)
LLMs try to optimize token usage by reading partial files. Our agent read 60 lines of a 460-line file and missed critical data at line 87. Can't fix the model's laziness, but you can remove the footgun. We silently ignore truncation params for files under 2000 lines now. If you're building tools for LLMs and they keep missing context, check if you're giving them a way to skip it.