Add new CommitWriterAgent to auto-generate commit messages from staged diffs #1484
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.
This commit introduces the CommitWriterAgent along with its configuration and detailed task description. The agent is designed to analyze git diffs staged for commit and automatically generate succinct and relevant commit messages.
--------THE ABOVE COMMIT MESSAGE (INCLUDING PR TITLE) IS GENERATED BY COMMITWRITERAGENT---------
I couldn't have written a better commit message than OpenDevin. So yeah, above is my commit message. If you are looking at this PR simply because you want to learn how to build a new micro-agent, you could stop reading.
Other things I would like to discuss (oops, seems I still know more than the agent):
I added a new field calledI rethink about it and I now feel we should use README instead of a dedicated field in yaml for documentation purpose.devnote
inagent.yaml
. This field is not rendered as part of prompt. My intention is that micro-agents sometimes need short explanation/justification/mini design doc. Developers could use this field to document them, rather than create a new README under every micro-agent. Hey, I don't know, maybe it's a better idea to create a README instead?As you can see, I leave two TODOs:
git diff --cached
forever. A workaround would be to let the agent finish with "NO" message (verified it worked), but ideally we should make it as an action.How to run this agent?
Somehow, ssh sandbox doesn't work - it gets stuck when running
git diff --cached
command.What about tests? I am still thinking what would be the best way to write an integration test for this... Currently,
tests/integration/test_agent.py
is mostly for general tasks that can be completed by multiple agents. We have a matrix in CI that can run those tests against different sandboxes AND different agents. How shall we organize the tests & CI for specialized agents?