Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Fix conversation URL format in pull request links (#9143)

Graham Neubig2d2ccf1329f4
diff --git a/openhands/server/routes/mcp.py b/openhands/server/routes/mcp.py
index 606a3c7d48..62f0854b79 100644
--- a/openhands/server/routes/mcp.py
+++ b/openhands/server/routes/mcp.py
@@ -27,7 +27,7 @@ mcp_server = FastMCP(
)
HOST = f'https://{os.getenv("WEB_HOST", "app.all-hands.dev").strip()}'
-CONVO_URL = HOST + '/{}'
+CONVO_URL = HOST + '/conversations/{}'
async def get_convo_link(service: GitService, conversation_id: str, body: str) -> str:
diff --git a/tests/unit/test_mcp_routes.py b/tests/unit/test_mcp_routes.py
index 7721d1678b..9d32984277 100644
--- a/tests/unit/test_mcp_routes.py
+++ b/tests/unit/test_mcp_routes.py
@@ -40,7 +40,10 @@ async def test_get_convo_link_saas_mode():
# Test with SAAS mode
with (
patch('openhands.server.routes.mcp.server_config') as mock_config,
- patch('openhands.server.routes.mcp.CONVO_URL', 'https://test.example.com/{}'),
+ patch(
+ 'openhands.server.routes.mcp.CONVO_URL',
+ 'https://test.example.com/conversations/{}',
+ ),
):
mock_config.app_mode = AppMode.SAAS
@@ -50,7 +53,7 @@ async def test_get_convo_link_saas_mode():
)
# Verify the result
- expected_link = '@testuser can click here to [continue refining the PR](https://test.example.com/test-convo-id)'
+ expected_link = '@testuser can click here to [continue refining the PR](https://test.example.com/conversations/test-convo-id)'
assert result == f'Original body\n\n{expected_link}'
# Verify that get_user was called
@@ -69,7 +72,10 @@ async def test_get_convo_link_empty_body():
# Test with SAAS mode and empty body
with (
patch('openhands.server.routes.mcp.server_config') as mock_config,
- patch('openhands.server.routes.mcp.CONVO_URL', 'https://test.example.com/{}'),
+ patch(
+ 'openhands.server.routes.mcp.CONVO_URL',
+ 'https://test.example.com/conversations/{}',
+ ),
):
mock_config.app_mode = AppMode.SAAS
@@ -79,7 +85,7 @@ async def test_get_convo_link_empty_body():
)
# Verify the result
- expected_link = '@testuser can click here to [continue refining the PR](https://test.example.com/test-convo-id)'
+ expected_link = '@testuser can click here to [continue refining the PR](https://test.example.com/conversations/test-convo-id)'
assert result == f'\n\n{expected_link}'
# Verify that get_user was called