Skip to content

Conversation

@samhvw8
Copy link
Contributor

@samhvw8 samhvw8 commented Mar 23, 2025

Context

Follow up with @1440 , this for @-mention but for read large file

Implementation

Screenshots

before after

How to Test

Get in Touch


Important

Adds maxReadFileLine parameter to handle large file mentions by truncating content beyond a specified line count.

  • Behavior:
    • Introduces maxReadFileLine parameter to limit lines read from files in Cline.ts, mentions/index.ts, and extract-text.ts.
    • Truncates file content if it exceeds maxReadFileLine, appending a notice about truncation.
  • Functions:
    • Updates loadContext() in Cline.ts to pass maxReadFileLine to parseMentions().
    • Modifies parseMentions() in mentions/index.ts to handle maxReadFileLine.
    • Adjusts extractTextFromFile() in extract-text.ts to support line truncation.
  • Misc:
    • Adds error handling for file access and content extraction in getFileOrFolderContent() in mentions/index.ts.

This description was created by Ellipsis for 3b7a3ca59c141d6efd76b3c3d9ea7e5dd4e7c12a. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Mar 23, 2025

⚠️ No Changeset found

Latest commit: 3588c53

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 23, 2025
@samhvw8 samhvw8 force-pushed the feat/mention-large-file-size branch from 3b7a3ca to d576a32 Compare March 23, 2025 18:23
@dosubot dosubot bot added the enhancement New feature or request label Mar 23, 2025
Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code seems kind of duplicative with what's in Cline.ts now. Should they all just use extractFromFile with the new parameter?

@samhvw8
Copy link
Contributor Author

samhvw8 commented Mar 25, 2025

This code seems kind of duplicative with what's in Cline.ts now. Should they all just use extractFromFile with the new parameter?

let me try to refactor to make Cline and mention use the same function

@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap Mar 26, 2025
@samhvw8 samhvw8 force-pushed the feat/mention-large-file-size branch 2 times, most recently from 4a2c1a5 to fd41db5 Compare March 26, 2025 17:47
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Mar 26, 2025
@samhvw8 samhvw8 force-pushed the feat/mention-large-file-size branch 2 times, most recently from 026908f to 6a90e41 Compare March 26, 2025 17:53
@samhvw8
Copy link
Contributor Author

samhvw8 commented Mar 26, 2025

@mrubens i make function to reuse cline & @ mention read file

@samhvw8 samhvw8 force-pushed the feat/mention-large-file-size branch 5 times, most recently from 0dec95b to 574b4c0 Compare March 31, 2025 09:20
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Mar 31, 2025
@samhvw8 samhvw8 force-pushed the feat/mention-large-file-size branch 4 times, most recently from 78728f7 to 40415c7 Compare April 5, 2025 16:04
@samhvw8
Copy link
Contributor Author

samhvw8 commented Apr 5, 2025

@mrubens just update this pr, if you have time can you check it

Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lot changing in this PR. Could you try to break it down into smaller independent PRs? In particular I always like to do a refactor separate from any functionality changes, so you can keep the test cases the same.

@samhvw8
Copy link
Contributor Author

samhvw8 commented Apr 6, 2025

There's a lot changing in this PR. Could you try to break it down into smaller independent PRs? In particular I always like to do a refactor separate from any functionality changes, so you can keep the test cases the same.

Yes, let me do it

@samhvw8 samhvw8 force-pushed the feat/mention-large-file-size branch from 40415c7 to 6ce6164 Compare April 8, 2025 14:14
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Apr 8, 2025
@samhvw8 samhvw8 force-pushed the feat/mention-large-file-size branch from 6ce6164 to c610da0 Compare April 8, 2025 14:28
@samhvw8
Copy link
Contributor Author

samhvw8 commented Apr 8, 2025

@mrubens i just update pr, now it have smaller change

@samhvw8 samhvw8 force-pushed the feat/mention-large-file-size branch from c610da0 to 9c1e78a Compare April 9, 2025 08:57
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. size:XL This PR changes 500-999 lines, ignoring generated files. labels Apr 9, 2025
@samhvw8 samhvw8 force-pushed the feat/mention-large-file-size branch from b4f04bf to 3588c53 Compare April 11, 2025 09:45
@samhvw8 samhvw8 marked this pull request as draft May 5, 2025 17:16
@hannesrudolph hannesrudolph moved this from PR [Pre Approval Review] to PR [Draft/WIP] in Roo Code Roadmap May 10, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Draft/WIP] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from PR [Draft / In Progress] to TEMP in Roo Code Roadmap May 26, 2025
@daniel-lxs
Copy link
Member

Hey @samhvw8,
Thank you for your contribution, We noticed this PR is stale and will be closed. If you plan to revisit this, please create an issue first as required by our issue-first approach before opening a new PR.

@daniel-lxs daniel-lxs closed this May 26, 2025
@github-project-automation github-project-automation bot moved this from PR [Draft/WIP] to Done in Roo Code Roadmap May 26, 2025
@github-project-automation github-project-automation bot moved this from TEMP to Done in Roo Code Roadmap May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants