fix: Include user-added files in commit message context#4927
Closed
BillionClaw wants to merge 1 commit intoAider-AI:mainfrom
Closed
fix: Include user-added files in commit message context#4927BillionClaw wants to merge 1 commit intoAider-AI:mainfrom
BillionClaw wants to merge 1 commit intoAider-AI:mainfrom
Conversation
When files are added via /add command, the commit message generator was not aware of these files because no message was added to the chat history. This fix returns a message from cmd_add that gets added to the chat history, which is then included in the context used for generating commit messages. Fixes Aider-AI#728
Author
|
Closing — unable to complete the CLA process for this organization. Apologies for the noise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When files are added to the chat via the "/add" command, the commit message generator was not aware of these files because no message was being added to the chat history. The commit message generation uses "get_context_from_history(self.cur_messages)" to gather context, but since the "/add" command didn't add any message to the chat history, the commit messages didn't include information about user-added files.
Solution
Modified "cmd_add()" in "aider/commands.py" to:
This follows the same pattern used when files are added via file mentions in "check_for_file_mentions()".
Changes
Fixes #728