OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug]: Agent tends to use browser instead of GitHub API to open pull requests

Open zchn opened this issue 10 months ago • 11 comments

Is there an existing issue for the same bug?

  • [x] I have checked the existing issues.

Describe the bug and reproduction steps

Despite having the github microagent in https://github.com/All-Hands-AI/OpenHands/blob/main/microagents/knowledge/github.md, I frequently run into cases where the agent tries to use the browser to open a new PR (and fails) instead of the preferred way of using GitHub API. Here is the most recent example:

https://www.all-hands.dev/share?share_id=883b5c047dcbb2df36e1b1c65f7676f25c282bf28a1bc6c896e5f69b2cfc1f56 where

  1. I did mention GitHub in my prompt (screenshot 1),
  2. but openhands still tries the browser first (screenshot 2),
  3. and I have to tell openhands to use the GitHub API after it fails to use the browser to submit a PR (screenshot 3).
Image Image Image

OpenHands Installation

Development workflow

OpenHands Version

main

Operating System

MacOS

Logs, Errors, Screenshots, and Additional Context

https://www.all-hands.dev/share?share_id=883b5c047dcbb2df36e1b1c65f7676f25c282bf28a1bc6c896e5f69b2cfc1f56

zchn avatar Feb 07 '25 22:02 zchn

Thank you for the report! Was this LLM Claude Sonnet?

enyst avatar Feb 07 '25 23:02 enyst

Yes Claude sonnet 3.5

zchn avatar Feb 07 '25 23:02 zchn

(realized I did not upload the screenshots properly so just added them to the original post)

zchn avatar Feb 07 '25 23:02 zchn

I wonder, the id of the action was 95, that might be relatively much for Sonnet to remember every detail from the beginning? Idk, in any case appreciate the report.

enyst avatar Feb 07 '25 23:02 enyst

There were two other issues related to this bug I'm having a hard time finding them. It was also not using the github API when it should be.

mamoodi avatar Feb 08 '25 00:02 mamoodi

There's a note here, but that was not really the same, because it was with the resolver: some initial prompts are different. The github microagent in particular is not enabled with the resolver, and instead it has prompting of its own.

enyst avatar Feb 08 '25 00:02 enyst

Found it. Here is it: https://github.com/All-Hands-AI/OpenHands/issues/5634

mamoodi avatar Feb 09 '25 17:02 mamoodi

Can this be resolved by expanding the "triggers" in the microagent and then cleaning up the github prompt? This thought process doesn't seem baked into the system itself but more a prompting update.

h55nick avatar Feb 10 '25 16:02 h55nick

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Mar 13 '25 02:03 github-actions[bot]

Is this still happening? I haven't seen it for a while, and I do think the updates to microagents may have been why.

enyst avatar Mar 13 '25 02:03 enyst

I think we can close this issue for now and reopen if people see it happening again. not seeing any +1's from this report so far.

zchn avatar Mar 13 '25 02:03 zchn

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Apr 13 '25 02:04 github-actions[bot]

This issue was closed because it has been stalled for over 30 days with no activity.

github-actions[bot] avatar Apr 21 '25 02:04 github-actions[bot]