-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat(read_file): enhance file reading capabilities with multi-file support and improved parameter handling #2886
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
|
|
The changes in this pull request seem to be related to enhancing the file reading capabilities and updating the tool usage format. The changes across different files appear to be interconnected, focusing on a single feature enhancement. Therefore, it doesn't seem necessary to split the pull request into smaller ones. If you have any questions or need further clarification, feel free to reach out! |
src/core/tools/readFileTool.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Range read is handled only when both start_line and end_line are provided. Confirm if this is the intended behavior. If a user provides only one of these parameters (e.g., just start_line), consider whether it should read from start_line to the end of the file.
|
Excellent please force push so I can look when you get a chance.
I think first pass should respect existing line limit handling per file to keep the implementation simple . After we have been using it for a while we may discover different ways to handle length issues. Please make sure that "list code definitions" triggers when the length of the file is less than the maximum line limit as it does now |
d73e5a7 to
f868b67
Compare
|
@KJ7LNW i just update the test, now it all pass |
<args>
:path:src/app.ts
:start_line:1
:end_line:50
======+++======
:path:src/utils.ts
:start_line:100
:end_line:150
======+++======
:path:package.json
</args>It looks like you have custom argument formats which do not allow us to programmatically change the parser or automate tool XML structure integration as part of the tool refactor that @bramburn is working on in #2467 . Ultimately all tools will provide standardized argument structure so that no tool has special parsing for trivial data types (int, string, etc). The long term goal is to automatically generate system instructions, parsing, and tool documentation based on per-tool JSON-looking XML schema definitions standardized in a static attribute for each tool class. Please choose a standard XML format, so we can standardize all tool arguments as part of the Tool base class in the future and avoid much fine your code to conform. Something like this would be appropriate: <read_file>
<file path="/path1">
<range lines="1-100"/>
<range lines="210-22"/>
</file>
<file path="/path2">
<range lines="11-111"/>
<range lines="222-333"/>
</file>
</read_file>or if you do not like attributes: <read_file>
<file>
<path>/path/to/file1</path>
<line_range>111-222</line_range>
<line_range>333-444</line_range>
</file>
<file>
<path>/path/to/file2</path>
<line_range>1111-2222</line_range>
<line_range>3333-4444</line_range>
</file>
</read_file> |
|
@KJ7LNW if we have format like that another llm can do it ? |
LLMs work quite well with XML at the moment, I am not sure if I understood your question, can you elaborate? |
|
@KJ7LNW i make it work with all xml, fixing test then push to branch 💪🏻 |
|
💪🏻!!! I'll check it out |
|
🏋️♀️
…On Sun, 27 Apr 2025, 04:30 KJ7LNW, ***@***.***> wrote:
*KJ7LNW* left a comment (RooCodeInc/Roo-Code#2886)
<#2886 (comment)>
💪🏻!!!
I'll check it out
—
Reply to this email directly, view it on GitHub
<#2886 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUTT3JKUBPPBZARXW25LML23RFNLAVCNFSM6AAAAAB3XC6R66VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMZSHEZTOMJXG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
69c7823 to
025f7cd
Compare
|
the code looks good, I am going to try it out in real life and see what I discover ... |
…ConcurrentFileReadsExperiment
|
FYI, I have been running this on my desk for a couple of weeks for everything that I do, this is the feedback of my experience:
I have not found any slowdown, and I have had times where 15-20 files were loaded at once. it is probably 10x faster than loading them individually.
Fortunately, this happens on the backend, not in the web view.
I have never seen that problem it has been nice and snappy.
That is an issue for single file reads, too, because a file that big would exceed available context for all existing models today; if you are using read-size limits, then this is not an issue. Read limits default to 500 lines, but it may have changed recently.
If this is going to be addressed it needs to be addressed per-file. We have line-limit constraints available to handle this already there is probably not a better way to do it.
There already is. I keep mine at 100 and have never had a problem:
I disagree with this because we already have line limit handling that users can enforce. "too much" is too subjective, it will very by user model and use case so let's keep the existing line-limit behavior.
is there a specific error message you are concerned about?
Good idea. Can this be merged and add telemetry in a separate PR? |
@samhvw8 can you set this to 15 by default immediately when experimental flag is enabled? Users can then adjust it from there. |
|
@KJ7LNW, Can you check again the default value for concurrent reads? I made a change regarding that specifically. The value is set to 15 for me when I enable the feature. |
If that is what it does for you, then it must be correct, as I am going off slightly older information. sorry for any confusion |
mrubens
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!


Context
Implementation
Screenshots
How to Test
Get in Touch
Important
Enhances
read_filetool with multi-file support, addsmaxConcurrentFileReadssetting, and updates UI components and tests accordingly.read_filetool now supports reading multiple files with line ranges, improving efficiency.maxConcurrentFileReadssetting inglobal-settings.tsto limit concurrent file reads.BatchFilePermissioncomponent for handling multi-file read permissions inChatView.ContextManagementSettingsandSettingsViewto includemaxConcurrentFileReadsslider.BatchFilePermissioninBatchFilePermission.test.tsx.readFileTool.test.ts.settings.jsonfor English and Japanese locales to include new settings descriptions.This description was created by
for 62330ebfae61e7c2c1c4d669ab5cef93e46a00d0. You can customize this summary. It will automatically update as commits are pushed.