Skip to content
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

Add actions for github push and send PR #1415

Merged
merged 21 commits into from Apr 29, 2024
Merged

Add actions for github push and send PR #1415

merged 21 commits into from Apr 29, 2024

Conversation

neubig
Copy link
Contributor

@neubig neubig commented Apr 27, 2024

This PR aims to give agents the ability to push to github.

  • adds two new actions: GithubPushAction and GithubSendPRAction.
  • adds information about GithubPushAction to MonologueAgent through the prompt.

Both of these actions require you to set OPENDEVIN_GITHUB_TOKEN as an environment variable, and uses this token to either push to github or send an API call to create a PR.

I still need to extensively test the full pipeline but this should be ready for review.

Fixes #1067

Copy link
Collaborator

@li-boxuan li-boxuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, looks like we are one step closer to dogfooding!

To fix the integration test, you could refer to https://github.com/OpenDevin/OpenDevin/blob/main/tests/integration/README.md

agenthub/dummy_agent/agent.py Show resolved Hide resolved
agenthub/monologue_agent/agent.py Outdated Show resolved Hide resolved
opendevin/action/github.py Outdated Show resolved Hide resolved

# Push the branch to the temporary remote
command = f'git push {random_remote} {self.branch}'
push_result = controller.action_manager.run_command(command, background=False)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error handling for push? A common error would be permission related.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now if the command fails it will return the failed command and failure message (after deleting the remote), so I think this might be OK as-is?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Rate limiting error should be rare and I don't think we need to handle that. Permission error would have to be resolved by the user anyways. #1290 aims to add support for agent-user interaction, which might be helpful for users to intervene and address permission issues, if any.

opendevin/action/github.py Outdated Show resolved Hide resolved
@neubig neubig requested a review from li-boxuan April 27, 2024 23:53
@neubig neubig requested a review from enyst April 28, 2024 02:31
@li-boxuan
Copy link
Collaborator

I think we also need to modify agenthub/monologue_agent/utils/prompts.py to teach the agent about these new actions

@neubig
Copy link
Contributor Author

neubig commented Apr 28, 2024

@li-boxuan , I added the info to the prompt, I think this is ready for another look!

@neubig
Copy link
Contributor Author

neubig commented Apr 29, 2024

I have finished end-to-end testing and confirmed that this indeed works! Here is the first PR authored by OpenDevin that uses this functionality: #1438

@neubig
Copy link
Contributor Author

neubig commented Apr 29, 2024

@enyst or @li-boxuan , if you approve this is probably ready to merge.

@enyst
Copy link
Collaborator

enyst commented Apr 29, 2024

I tried locally with GPT-3.5, it failed as expected since it didn't have yet a token. 😅

@neubig neubig enabled auto-merge (squash) April 29, 2024 00:55
@neubig neubig merged commit a5f61ca into main Apr 29, 2024
20 checks passed
@neubig neubig deleted the neubig/add_push_action branch April 29, 2024 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"solve github issue" workflow
3 participants