-
Notifications
You must be signed in to change notification settings - Fork 2.6k
the context file size limits and folder support for rule files #1920
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
the context file size limits and folder support for rule files #1920
Conversation
|
…s from the latest features in Cline. fix: toPosix
ed13b77 to
003727e
Compare
| const fileSize = await getFileSizeInKB(filePath) | ||
| if (fileSize > 300) { | ||
| throw new Error(`File is too large to read into context.`) | ||
| } |
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.
I think #1926 will end up being a better solution for this (it will respect the maxReadFileLine setting and still let the user read in the beginning of the file + a map of the functions)
|
On the .clinerules folder side of things, I would love to discuss a little more before making a change here. A few things going through my mind:
If you're interested I would love to discuss this more in Discord - I'm MrUbens in there. Thank you for this and all of your other PRs! |
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.
Going to mark this as changes requested until we have a chance to discuss, thank you!
|
@mrubens I believe we can add some optimizations for the effectiveness of file reading and retrieval in the future, such as using embeddings for recall. However, this would depend on embedding a local model or an online one. Nonetheless, it could significantly improve the relevance of code queries and reduce the context window for LLMs. |
Context
Implementation
Screenshots
|


|
|
How to Test
Get in Touch
Important
Enhance file handling by adding directory support for rule files and enforcing file size limits in
custom-instructions.tsandextract-text.ts.safeReadFileincustom-instructions.tsnow supports reading directories and files, handling.clinerulesdirectories recursively.extractTextFromFileinextract-text.tsthrows an error if file size exceeds 300KB.fs/promisesandutils/fsupdated incustom-system-prompt.test.tsandcustom-instructions.test.tsto support new directory and file size checks.custom-instructions.test.tsupdated to verify directory handling and file size limits.getFileSizeInKBandisDirectoryfunctions infs.tsto support file size checks and directory validation.This description was created by
for 84d0e4abfaa0f9a9d630050ef98543b81903ec1d. It will automatically update as commits are pushed.