Skip to content

[Fix]: Broken links from cloud resolver #8923

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

Merged
merged 13 commits into from
Jun 6, 2025
Merged

[Fix]: Broken links from cloud resolver #8923

merged 13 commits into from
Jun 6, 2025

Conversation

malhotra5
Copy link
Contributor

@malhotra5 malhotra5 commented Jun 5, 2025

  • This change is worth documenting at https://docs.all-hands.dev/
  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

End-user friendly description of the problem this fixes or functionality this introduces.

  • Improve reliability of followup links to convo in pr descriptions from cloud resolver

Summarize what the PR does, explaining any non-trivial design decisions.

When the cloud resolver opens a new PR, it is responsible for leaving a link the PR body (user can continue refining pr here ...)

However, the agent often leaves broken links. This PR fixes this issue by having the create_pr MCP tool append the link at the end of the PR body. This does two things

  1. Improves the reliability of the followup link
  2. Reduces the number of tasks the agent is responsible of doing

We have also deprecated attach_convo_id functionality, which was required to plumb the convo link instructions to the agent (because conversation_id is created first, and then mounted into the agent instructions)


Link of any specific issues this addresses:
All-Hands-AI/OpenHands-Cloud#42

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:a5e1941-nikolaik   --name openhands-app-a5e1941   docker.all-hands.dev/all-hands-ai/openhands:a5e1941

@malhotra5 malhotra5 marked this pull request as draft June 5, 2025 16:12
@malhotra5 malhotra5 marked this pull request as ready for review June 5, 2025 18:03
@malhotra5 malhotra5 enabled auto-merge (squash) June 6, 2025 00:55
@malhotra5 malhotra5 disabled auto-merge June 6, 2025 01:11
@malhotra5
Copy link
Contributor Author

@OpenHands fix the failing tests for tests/unit/test_mcp_routes

Copy link

openhands-ai bot commented Jun 6, 2025

I'm on it! malhotra5 can track my progress at all-hands.dev

Copy link

openhands-ai bot commented Jun 6, 2025

I've successfully fixed the failing tests in tests/unit/test_mcp_routes.py. Here's a summary of the changes made:

Issue Identified

The tests were failing because of a mismatch between the implementation and the tests:

  1. In the implementation of get_convo_link, it was using user.login to get the username
  2. In the tests, the mock user object had the username set as user.name

Changes Made

  1. Modified openhands/server/routes/mcp.py to use user.name instead of user.login when getting the username
  2. Fixed a variable name mismatch in the GitLab MR creation function where it was incorrectly using body instead of description

Verification

  1. All tests in tests/unit/test_mcp_routes.py now pass
  2. All MCP-related tests (tests/unit/test_mcp_*.py) also pass

Commit and Push

The changes have been committed with the message "Fix conversation link in PR/MR creation by using user.name instead of user.login" and pushed to the convo-link-fix branch.

This fix ensures that the conversation link in PR/MR descriptions will correctly include the user's name, making the tests pass and improving the functionality.

@malhotra5 malhotra5 enabled auto-merge (squash) June 6, 2025 01:35
@malhotra5 malhotra5 merged commit aa54a25 into main Jun 6, 2025
18 checks passed
@malhotra5 malhotra5 deleted the convo-link-fix branch June 6, 2025 01:46
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.

3 participants