-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Adjust the read_file prompt based on whether partial reads are enabled #3995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks reasonable to me. Side question, how much of, let's say, this particular pull request was generated by Roo-Code (or other agentic AI coding tool, if you use anything else)? How do you make it handle with large code base with lots of implicit structures? |
Thank you. Roo Code wrote all of this code. I just opened the file with the current prompt in it and then started a task telling it about your feedback and asking it to conditionally hide the parts about partial reads if it's disabled. I'm using Sonnet 4 now which seems to do a good job. |
There are cases where line-range reads are useful even when full reads are enabled, and I use these often:
I have been particularly impressed with Gemini's ability to use @samhvw8's multi-read_file to read multiple line ranges in these cases, and the line-range-targeted result is extremely useful on large files. I think the bigger problem trying to be addressed here is that the model will re-read ranges after it has read the entire file, which is of course unnecessary: the proper fix for that would be to track file modification time along with line ranges and reject if a line range is already loaded since the file modification. Modification times need to be stored in the task JSON files for all file IO operations to handle this. |
|
I think that is a separate discussion from this PR since currently the model is unable to perform partial reads when this is set to -1. |
* making claude4 feel better * system prompt whoops * small system prompt change --------- Co-authored-by: Cline Evaluation <[email protected]>
Closes #4009
#3936 (comment)
Important
The PR updates the
read_filetool to conditionally include partial read instructions based on a newpartialReadsEnabledflag, affecting tool descriptions, parameters, and examples.read_filetool now conditionally includesstart_lineandend_lineparameters based onpartialReadsEnabledflag inread-file.ts.read_fileusage examples to include partial read scenarios whenpartialReadsEnabledis true.generatePromptinsystem.tsto passpartialReadsEnabledto tool descriptions.SYSTEM_PROMPTandgenerateSystemPromptto handlepartialReadsEnabledflag.system.test.tsandcustom-system-prompt.test.tsto verify behavior withpartialReadsEnabledflag.This description was created by
for acb2d67. You can customize this summary. It will automatically update as commits are pushed.