-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: Skip large diffs when generating context for the LLM #2217
base: main
Are you sure you want to change the base?
Conversation
content: diffContent | ||
.filter(Boolean) | ||
.map((diff) => processPatchset(diff)) | ||
.join('\n\n'), |
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 have been looking into this type of limiting as well, and one of the issues I see is that getDiffLog
returns, as the name suggests, git log
output not git diff
output. So, splitting this output would seem to be more naturally done on the commit <sha>
(author) rather than on the diff --git
line.
WDYT?
commit 5f7fed0d7fab55e9b2cdc6cddbebd9644bca416c
Author: Kevin Gilpin <[email protected]>
Date: Thu Jan 23 09:49:53 2025 -0500
refactor: Remove unused code
Locating the git repository - can't find any references to this any more
diff --git a/packages/cli/src/lib/git.ts b/packages/cli/src/lib/git.ts
index 5bd8b0a03..139b10eca 100644
--- a/packages/cli/src/lib/git.ts
+++ b/packages/cli/src/lib/git.ts
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.
In other words, maybe it would be better / easier if getDiffLog
and getWorkingDiff
returned an output that had some structure (at least an array of chunks?) rather than just a string that the caller then has to figure out how to split.
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.
Good point, I've actually noticed this too and fixed it in the amend below :)
b9385af
to
abaf705
Compare
abaf705
to
1bfa817
Compare
1bfa817
to
0d09b7d
Compare
This skips diffs larger than 5000 characters when generating input for
@welcome
and@review
. Large diffs are replaced with a message, for exampleFixes #2173