-
-
Notifications
You must be signed in to change notification settings - Fork 180
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: started working on always-fresh context message #281
base: master
Are you sure you want to change the base?
Conversation
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.
❌ Changes requested. Reviewed everything up to 592a950 in 1 minute and 56 seconds
More details
- Looked at
56
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
3
drafted comments based on config settings.
1. gptme/logmanager.py:321
- Draft comment:
The TODO comment about includinggit status -vv
context is not yet implemented. Ensure this functionality is completed or tracked in an issue before merging. - Reason this comment was not posted:
Comment did not seem useful.
2. gptme/logmanager.py:325
- Draft comment:
The TODO comment about getting mentioned files and ensuring their latest versions are in context is not yet implemented. Ensure this functionality is completed or tracked in an issue before merging. - Reason this comment was not posted:
Marked as duplicate.
3. gptme/logmanager.py:331
- Draft comment:
The TODO comment about stripping old patches and saves is not yet implemented. Ensure this functionality is completed or tracked in an issue before merging. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_CikcFQ4meMOMBZdj
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
# sort files by last modified time, and include the top N files by mentions and recency | ||
# search for files mentioned in the conversation | ||
files = Counter([f for msg in msgs for f in msg.files]) | ||
print(files) |
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.
Remove the print(files)
statement or replace it with a logging statement for better practice in production code.
print(files) |
# First enhance messages with context | ||
if _HAS_RAG: | ||
msgs = enhance_messages(msgs) | ||
|
||
# if latest message is a user message, prefix context | ||
# if latest message is a system message (like patch applied), then...? | ||
in_git_repo = True |
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.
The in_git_repo
variable is hardcoded to True
. Consider dynamically checking if the current directory is a git repository instead.
in_git_repo = True | |
in_git_repo = shutil.which('git') is not None |
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #281 +/- ##
==========================================
- Coverage 72.33% 72.33% -0.01%
==========================================
Files 64 64
Lines 4331 4337 +6
==========================================
+ Hits 3133 3137 +4
- Misses 1198 1200 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
The more I think about this the more of an improvement I realize that it would be. I should prioritize this. |
I've had this idea for a while to gather all the dynamic context, like files, and always output the most up-to-date versions of them right before a user message (not including previous/stale such messages).
This should save considerably on tokens, improve the reliability of patches, and unifies
files
handling.Related to #151 and #150
We could also set the current date and time in such a message, instead of the system prompt (#137).
Important
Introduces fresh context message handling by including file paths as files and updating message preparation to ensure latest file versions are used.
chat.py
by including paths as files instead of codeblocks.prepare_messages()
inlogmanager.py
to strip old context and ensure latest file versions are included.logmanager.py
.Counter
import inlogmanager.py
for file mention tracking.This description was created by for 592a950. It will automatically update as commits are pushed.