Aider-AI / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
19.94k stars 1.82k forks source link

commit messages often start with an unuseful line #1851

Closed Jon-Biz closed 3 days ago

Jon-Biz commented 3 days ago
29820f5 Commit message:
422cc5f fix: Update capital gains calculation 
2b3b2a7 fix: Update capital gains calculation 
f7fb3ef fix: Update capital gains calculation 
e0fa558 Got it, here is the commit message:
752e16a fix: Update non-capital gains cost basis calculation
445bb7a Commit Message:
1ae7e1e fix: Add console.log statements to debug failing test
d3b4dbf fix: Update capital gains assertion for first sale
7a78a2a Got it, let's review the updated logs and see if we can identify the issue.
a5dade4 Here is the commit message for the changes:
701956f Here is the commit message for the changes:

But not always. 445bb7a from above. The following do follow the predominant pattern:

commit 7a78a2a63c262e3287a67d9b0c11fc5170a11db9
Author: Jonathan El-Bizri (aider) <github@elbizri.com>
Date:   Mon Sep 30 18:35:02 2024 -0700

    Got it, let's review the updated logs and see if we can identify the issue.

commit a5dade4e6ed86fad91f715c0ec61c69ae95e7885
Author: Jonathan El-Bizri (aider) <github@elbizri.com>
Date:   Mon Sep 30 18:34:20 2024 -0700

    Here is the commit message for the changes:

    fix: limit mina allocated from purchase records to remaining runningTotal

commit 701956f0ed97cb45d2125f21a53a6e5203ea5345
Author: Jonathan El-Bizri (aider) <github@elbizri.com>
Date:   Mon Sep 30 18:33:35 2024 -0700

    Here is the commit message for the changes:

    fix: Improve logging for capital gains calculation

Aider version: 0.58.1 Python version: 3.12.1 Platform: macOS-13.0.1-x86_64-i386-64bit Python implementation: CPython Virtual environment: No OS: Darwin 22.1.0 (64bit) Git version: git version 2.39.2 (Apple Git-143)

Aider v0.58.1 Main model: openrouter/anthropic/claude-3-opus with diff edit format Weak model: openrouter/anthropic/claude-3-haiku Git repo: .git with 26 files Repo-map: using 1024 tokens, auto refresh

fry69 commented 3 days ago

Thank you for filing this issue.

Looks like Haiku sometimes decides to not follow instructions (see here -> https://github.com/paul-gauthier/aider/blob/main/aider/prompts.py#L15) and start yapping with the additional first line.

You can either try to also use Sonnet-3.5 for the weak model to generate the commit messages and hope it will follow those instructions with -> --weak-model claude-3-5-sonnet-20240620

Or you can try using this prompt (adapted from this shell function which never let me down so far with Haiku to generate commit messages), which I propose here -> #1852

You can try it out with these instructions ->

pip install git+https://github.com/fry69/aider@commit-prompt-fix

# or

pipx install git+https://github.com/fry69/aider@commit-prompt-fix --force

Please let me know if this works better for you.