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 API endpoints for resolver functionality #5058

Closed
wants to merge 20 commits into from

Conversation

neubig
Copy link
Contributor

@neubig neubig commented Nov 15, 2024

This is a draft of trying to implement the github resolution functionality in listen.py.

The main change in this PR is that it creates an API endpoint resolve_issue() in listen.py for calling the github resolver.
The input to this function is governed by the data model in openhands/server/data_models/issue_models.py.

One big question I have is that this endpoint could take 20 minutes to run, which isn't typically a good way to create an endpoint. Do you have a suggestion for the best practice in implementing this?

Any feedback is welcome (cc @rbren)!

NOTE: separately, running linting commands resulted in some unrelated fixing of linting issues...


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:c088a08-nikolaik   --name openhands-app-c088a08   docker.all-hands.dev/all-hands-ai/openhands:c088a08

- Add /api/resolver/resolve-issue endpoint to resolve GitHub issues
- Add /api/resolver/send-pr endpoint to create PRs/branches
- Add tests for new endpoints
- Make resolver functions async for better API integration
@neubig neubig marked this pull request as draft November 15, 2024 18:31
Keep the original implementation to avoid modifying core functionality
@neubig neubig added the fix-me Attempt to fix this issue with OpenHands label Nov 15, 2024
Copy link
Contributor

OpenHands started fixing the pr! You can monitor the progress here.

@neubig neubig marked this pull request as ready for review November 15, 2024 22:33
@neubig neubig added fix-me Attempt to fix this issue with OpenHands and removed fix-me Attempt to fix this issue with OpenHands lint-fix labels Nov 16, 2024
Copy link
Contributor

OpenHands started fixing the pr! You can monitor the progress here.

@neubig neubig added fix-me-experimental and removed fix-me Attempt to fix this issue with OpenHands labels Nov 16, 2024
Copy link
Contributor

OpenHands started fixing the pr! You can monitor the progress here.

@openhands-agent
Copy link
Contributor

New OpenHands update

Copy link
Contributor

The workflow to fix this issue encountered an error. Please check the workflow logs for more information.

Copy link
Contributor Author

@neubig neubig left a comment

Choose a reason for hiding this comment

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

These tests are failing now:

FAILED tests/unit/resolver/test_resolve_issues.py::test_file_instruction_with_repo_instruction
FAILED tests/unit/test_listen.py::test_resolve_issue_endpoint
FAILED tests/unit/test_listen.py::test_send_pull_request_endpoint

Copy link
Contributor

OpenHands started fixing the pr! You can monitor the progress here.

@openhands-agent
Copy link
Contributor

New OpenHands update

Copy link
Contributor

The workflow to fix this issue encountered an error. Please check the workflow logs for more information.

@neubig neubig marked this pull request as draft November 16, 2024 13:22
1. Delete send_pull_request endpoint in listen.py
2. Remove file writing dependency in resolve_issue endpoint
3. Rename process_single_issue to create_pull_request_from_resolver_output
4. Update all references and fix tests
@neubig neubig requested a review from rbren November 16, 2024 14:01
@neubig
Copy link
Contributor Author

neubig commented Dec 1, 2024

I'm going to close because we've refactored "listen.py" and it'd be easier to start from scratch.

@neubig neubig closed this Dec 1, 2024
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.

2 participants