🙌 OpenHands: AI-Driven Development
Docs + Code: rename ‘convo’ to ‘conversation’ across codebase and docs (#10447)
Engel Nyst8401641f7eaa
diff --git a/docs/static/img/slack-create-convo.png b/docs/static/img/slack-create-conversation.pngsimilarity index 100%rename from docs/static/img/slack-create-convo.pngrename to docs/static/img/slack-create-conversation.pngdiff --git a/docs/usage/cloud/slack-installation.mdx b/docs/usage/cloud/slack-installation.mdxindex eb228e92de..34c8a8f372 100644--- a/docs/usage/cloud/slack-installation.mdx+++ b/docs/usage/cloud/slack-installation.mdx@@ -65,7 +65,7 @@ To send follow-up messages for the same conversation, mention `@openhands` in aConversation is started by mentioning `@openhands`.-+### See agent response and send follow up messagesdiff --git a/openhands/runtime/impl/kubernetes/kubernetes_runtime.py b/openhands/runtime/impl/kubernetes/kubernetes_runtime.pyindex 825d346463..00e1b0de46 100644--- a/openhands/runtime/impl/kubernetes/kubernetes_runtime.py+++ b/openhands/runtime/impl/kubernetes/kubernetes_runtime.py@@ -735,7 +735,7 @@ class KubernetesRuntime(ActionExecutionClient):@classmethodasync def delete(cls, conversation_id: str):"""Delete resources associated with a conversation."""- # This is triggered when you actually do the delete in the UI on the convo.+ # This is triggered when you actually do the delete in the UI on the conversation.try:cls._cleanup_k8s_resources(namespace=cls._namespace,diff --git a/openhands/server/listen_socket.py b/openhands/server/listen_socket.pyindex cbe9b28069..0fec3bd575 100644--- a/openhands/server/listen_socket.py+++ b/openhands/server/listen_socket.py@@ -21,7 +21,7 @@ from openhands.events.observation.agent import (from openhands.events.serialization import event_to_dictfrom openhands.integrations.service_types import ProviderTypefrom openhands.server.services.conversation_service import (- setup_init_convo_settings,+ setup_init_conversation_settings,)from openhands.server.shared import (conversation_manager,@@ -117,7 +117,7 @@ async def connect(connection_id: str, environ: dict) -> None:f'Finished replaying event stream for conversation {conversation_id}')- conversation_init_data = await setup_init_convo_settings(+ conversation_init_data = await setup_init_conversation_settings(user_id, conversation_id, providers_set)diff --git a/openhands/server/routes/manage_conversations.py b/openhands/server/routes/manage_conversations.pyindex cef6278873..07dead28c4 100644--- a/openhands/server/routes/manage_conversations.py+++ b/openhands/server/routes/manage_conversations.py@@ -44,7 +44,7 @@ from openhands.server.data_models.conversation_info_result_set import (from openhands.server.dependencies import get_dependenciesfrom openhands.server.services.conversation_service import (create_new_conversation,- setup_init_convo_settings,+ setup_init_conversation_settings,)from openhands.server.shared import (ConversationStoreImpl,@@ -466,7 +466,7 @@ async def start_conversation()# Set up conversation init data with provider information- conversation_init_data = await setup_init_convo_settings(+ conversation_init_data = await setup_init_conversation_settings(user_id, conversation_id, providers_set.providers_set or [])diff --git a/openhands/server/routes/mcp.py b/openhands/server/routes/mcp.pyindex 5fe3bc1689..1f33eab9c1 100644--- a/openhands/server/routes/mcp.py+++ b/openhands/server/routes/mcp.py@@ -28,21 +28,23 @@ mcp_server = FastMCP()HOST = f'https://{os.getenv("WEB_HOST", "app.all-hands.dev").strip()}'-CONVO_URL = HOST + '/conversations/{}'+CONVERSATION_URL = HOST + '/conversations/{}'-async def get_convo_link(service: GitService, conversation_id: str, body: str) -> str:+async def get_conversation_link(+ service: GitService, conversation_id: str, body: str+) -> str:"""Appends a followup link, in the PR body, to the OpenHands conversation that opened the PR"""if server_config.app_mode != AppMode.SAAS:return bodyuser = await service.get_user()username = user.login- convo_url = CONVO_URL.format(conversation_id)- convo_link = (- f'@{username} can click here to [continue refining the PR]({convo_url})'+ conversation_url = CONVERSATION_URL.format(conversation_id)+ conversation_link = (+ f'@{username} can click here to [continue refining the PR]({conversation_url})')- body += f'\n\n{convo_link}'+ body += f'\n\n{conversation_link}'return body@@ -68,10 +70,12 @@ async def save_pr_metadata(pr_number = int(match_merge_request.group(1))if pr_number:- logger.info(f'Saving PR number: {pr_number} for convo {conversation_id}')+ logger.info(f'Saving PR number: {pr_number} for conversation {conversation_id}')conversation.pr_number.append(pr_number)else:- logger.warning(f'Failed to extract PR number for convo {conversation_id}')+ logger.warning(+ f'Failed to extract PR number for conversation {conversation_id}'+ )await conversation_store.save_metadata(conversation)@@ -116,9 +120,9 @@ async def create_pr()try:- body = await get_convo_link(github_service, conversation_id, body or '')+ body = await get_conversation_link(github_service, conversation_id, body or '')except Exception as e:- logger.warning(f'Failed to append convo link: {e}')+ logger.warning(f'Failed to append conversation link: {e}')try:response = await github_service.create_pr(@@ -186,11 +190,11 @@ async def create_mr()try:- description = await get_convo_link(+ description = await get_conversation_link(gitlab_service, conversation_id, description or '')except Exception as e:- logger.warning(f'Failed to append convo link: {e}')+ logger.warning(f'Failed to append conversation link: {e}')try:response = await gitlab_service.create_mr(@@ -253,11 +257,11 @@ async def create_bitbucket_pr()try:- description = await get_convo_link(+ description = await get_conversation_link(bitbucket_service, conversation_id, description or '')except Exception as e:- logger.warning(f'Failed to append convo link: {e}')+ logger.warning(f'Failed to append conversation link: {e}')try:response = await bitbucket_service.create_pr(diff --git a/openhands/server/services/conversation_service.py b/openhands/server/services/conversation_service.pyindex 8ed0a755cd..0385168b73 100644--- a/openhands/server/services/conversation_service.py+++ b/openhands/server/services/conversation_service.py@@ -42,7 +42,7 @@ async def create_new_conversation(replay_json: str | None,conversation_instructions: str | None = None,conversation_trigger: ConversationTrigger = ConversationTrigger.GUI,- attach_convo_id: bool = False,+ attach_conversation_id: bool = False,git_provider: ProviderType | None = None,conversation_id: str | None = None,mcp_config: MCPConfig | None = None,@@ -133,8 +133,8 @@ async def create_new_conversation(image_urls=image_urls or [],)- if attach_convo_id:- logger.warning('Attaching convo ID is deprecated, skipping process')+ if attach_conversation_id:+ logger.warning('Attaching conversation ID is deprecated, skipping process')agent_loop_info = await conversation_manager.maybe_start_agent_loop(conversation_id,@@ -159,7 +159,7 @@ def create_provider_tokens_object(return MappingProxyType(provider_information)-async def setup_init_convo_settings(+async def setup_init_conversation_settings(user_id: str | None, conversation_id: str, providers_set: list[ProviderType]) -> ConversationInitData:"""Set up conversation initialization data with provider tokens.@@ -198,8 +198,8 @@ async def setup_init_convo_settings(if user_secrets:session_init_args['custom_secrets'] = user_secrets.custom_secrets- convo_init_data = ConversationInitData(**session_init_args)+ conversation_init_data = ConversationInitData(**session_init_args)# We should recreate the same experiment conditions when restarting a conversationreturn ExperimentManagerImpl.run_conversation_variant_test(- user_id, conversation_id, convo_init_data+ user_id, conversation_id, conversation_init_data)diff --git a/tests/unit/test_mcp_routes.py b/tests/unit/test_mcp_routes.pyindex 9d32984277..1a55cc0a39 100644--- a/tests/unit/test_mcp_routes.py+++ b/tests/unit/test_mcp_routes.py@@ -3,13 +3,13 @@ from unittest.mock import AsyncMock, patchimport pytestfrom openhands.integrations.service_types import GitService-from openhands.server.routes.mcp import get_convo_link+from openhands.server.routes.mcp import get_conversation_linkfrom openhands.server.types import AppMode@pytest.mark.asyncio-async def test_get_convo_link_non_saas_mode():- """Test get_convo_link in non-SAAS mode."""+async def test_get_conversation_link_non_saas_mode():+ """Test get_conversation_link in non-SAAS mode."""# Mock GitServicemock_service = AsyncMock(spec=GitService)@@ -18,7 +18,7 @@ async def test_get_convo_link_non_saas_mode():mock_config.app_mode = AppMode.OSS# Call the function- result = await get_convo_link(+ result = await get_conversation_link(service=mock_service, conversation_id='test-convo-id', body='Original body')@@ -29,8 +29,8 @@ async def test_get_convo_link_non_saas_mode():@pytest.mark.asyncio-async def test_get_convo_link_saas_mode():- """Test get_convo_link in SAAS mode."""+async def test_get_conversation_link_saas_mode():+ """Test get_conversation_link in SAAS mode."""# Mock GitService and usermock_service = AsyncMock(spec=GitService)mock_user = AsyncMock()@@ -41,14 +41,14 @@ async def test_get_convo_link_saas_mode():with (patch('openhands.server.routes.mcp.server_config') as mock_config,patch(- 'openhands.server.routes.mcp.CONVO_URL',+ 'openhands.server.routes.mcp.CONVERSATION_URL','https://test.example.com/conversations/{}',),):mock_config.app_mode = AppMode.SAAS# Call the function- result = await get_convo_link(+ result = await get_conversation_link(service=mock_service, conversation_id='test-convo-id', body='Original body')@@ -61,8 +61,8 @@ async def test_get_convo_link_saas_mode():@pytest.mark.asyncio-async def test_get_convo_link_empty_body():- """Test get_convo_link with an empty body."""+async def test_get_conversation_link_empty_body():+ """Test get_conversation_link with an empty body."""# Mock GitService and usermock_service = AsyncMock(spec=GitService)mock_user = AsyncMock()@@ -73,14 +73,14 @@ async def test_get_convo_link_empty_body():with (patch('openhands.server.routes.mcp.server_config') as mock_config,patch(- 'openhands.server.routes.mcp.CONVO_URL',+ 'openhands.server.routes.mcp.CONVERSATION_URL','https://test.example.com/conversations/{}',),):mock_config.app_mode = AppMode.SAAS# Call the function- result = await get_convo_link(+ result = await get_conversation_link(service=mock_service, conversation_id='test-convo-id', body='')