-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Fix #7473: Prevent OpenHands from creating additional pull requests unless explicitly instructed #7476
Conversation
…nless explicitly instructed
</VERSION_CONTROL> | ||
|
||
<PULL_REQUESTS> | ||
* Create only ONE pull request per session/issue unless explicitly instructed otherwise. |
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.
Small question here, I wonder if this could affect evals. It seems the new instructions on git say "do this", while the version control section are all "when", "if", "do not".
Feel free to ignore if you don't think so.
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 new instructions on git say "do this",
You mean the github.md file?
I assume all "git" relate issue probably won't affect eval -- we are just doing git add -A && git diff {base_commit} XXX
on eval stuff so should be able to capture ALL diff 🤔
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.
Not github.md, I mean this new section PULL_REQUESTS
is in the system prompt, and it tells the LLM "create one PR per session/issue".
I wonder if the LLM will try to "create one PR", and spend steps trying and failing and idk, worst case losing track.
The older sections, for example VERSION_CONTROL
, never tells "do this", it says "when you commit... " (so if you never commit, it's a no-op).
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.
very good point! i'll tweak that
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.
updated! feel free to re-review 🙏
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 wonder if the PR will work as expected together with the microagent, but we could try this.
Had one more question on PRs, though I'm not sure it matters.
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.
Love it!
This PR addresses issue #7473 by adding explicit instructions to the system prompt and GitHub microagent to prevent OpenHands from creating multiple pull requests for a single issue/session.
Changes
<GITHUB_PULL_REQUESTS>
section to the system prompt with clear instructions to create only ONE pull request per session/issue unless explicitly instructed otherwise.Testing
Added unit tests that verify the system prompt and GitHub microagent contain the new instructions.
@xingyaoww can click here to continue refining the PR
To run this PR locally, use the following command: