mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Fix conversation URL format in pull request links (#9143)
This commit is contained in:
parent
e5bff91e8e
commit
2d2ccf1329
@ -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:
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user