π OpenHands: AI-Driven Development
refactor: move AppMode class to config_api/config_models.py (#14253)
Tim O'Farrell2b5956683618
diff --git a/enterprise/integrations/github/github_service.py b/enterprise/integrations/github/github_service.pyindex 1d694e193b..7c58ef6732 100644--- a/enterprise/integrations/github/github_service.py+++ b/enterprise/integrations/github/github_service.py@@ -4,10 +4,10 @@ from integrations.store_repo_utils import store_repositories_in_dbfrom pydantic import SecretStrfrom server.auth.token_manager import TokenManager+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.github.github_service import GitHubServicefrom openhands.app_server.integrations.service_types import ProviderType, Repositoryfrom openhands.app_server.utils.logger import openhands_logger as logger-from openhands.server.types import AppModeclass SaaSGitHubService(GitHubService):diff --git a/enterprise/integrations/gitlab/gitlab_service.py b/enterprise/integrations/gitlab/gitlab_service.pyindex 9cd6c0288e..2f9e6c9187 100644--- a/enterprise/integrations/gitlab/gitlab_service.py+++ b/enterprise/integrations/gitlab/gitlab_service.py@@ -7,6 +7,7 @@ from server.auth.token_manager import TokenManagerfrom storage.gitlab_webhook import GitlabWebhook, WebhookStatusfrom storage.gitlab_webhook_store import GitlabWebhookStore+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.gitlab.gitlab_service import GitLabServicefrom openhands.app_server.integrations.service_types import (ProviderType,@@ -15,7 +16,6 @@ from openhands.app_server.integrations.service_types import (RequestMethod,)from openhands.app_server.utils.logger import openhands_logger as logger-from openhands.server.types import AppModeclass SaaSGitLabService(GitLabService):diff --git a/enterprise/server/auth/gitlab_sync.py b/enterprise/server/auth/gitlab_sync.pyindex 8d20af4b51..f03d6e2899 100644--- a/enterprise/server/auth/gitlab_sync.py+++ b/enterprise/server/auth/gitlab_sync.py@@ -3,9 +3,9 @@ import asynciofrom pydantic import SecretStrfrom sqlalchemy import select+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.utils.logger import openhands_logger as logger-from openhands.server.types import AppModeasync def _user_has_gitlab_provider(user_id: str) -> bool:diff --git a/enterprise/server/config.py b/enterprise/server/config.pyindex aec2c5af44..c6da43523a 100644--- a/enterprise/server/config.py+++ b/enterprise/server/config.py@@ -22,9 +22,9 @@ from server.auth.constants import ()from server.constants import DEPLOYMENT_MODE+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.service_types import ProviderTypefrom openhands.server.config.server_config import ServerConfig-from openhands.server.types import AppModedef sign_token(payload: dict[str, object], jwt_secret: str, algorithm='HS256') -> str:diff --git a/openhands/app_server/app_conversation/live_status_app_conversation_service.py b/openhands/app_server/app_conversation/live_status_app_conversation_service.pyindex e16528e70d..bd43f5fe05 100644--- a/openhands/app_server/app_conversation/live_status_app_conversation_service.py+++ b/openhands/app_server/app_conversation/live_status_app_conversation_service.py@@ -61,6 +61,7 @@ from openhands.app_server.config import (get_event_callback_service,resolve_provider_llm_base_url,)+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.errors import SandboxErrorfrom openhands.app_server.event.event_service import EventServicefrom openhands.app_server.event_callback.event_callback_models import EventCallback@@ -105,7 +106,6 @@ from openhands.sdk.secret import LookupSecret, StaticSecretfrom openhands.sdk.settings import ACPAgentSettingsfrom openhands.sdk.utils.paging import page_iteratorfrom openhands.sdk.workspace.remote.async_remote_workspace import AsyncRemoteWorkspace-from openhands.server.types import AppModefrom openhands.tools.preset.default import (get_default_tools,)diff --git a/openhands/app_server/config.py b/openhands/app_server/config.pyindex 3188c8dce0..d9713eb629 100644--- a/openhands/app_server/config.py+++ b/openhands/app_server/config.py@@ -28,6 +28,7 @@ from openhands.app_server.app_lifespan.app_lifespan_service import AppLifespanSefrom openhands.app_server.app_lifespan.oss_app_lifespan_service import (OssAppLifespanService,)+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.config_api.llm_model_service import (LLMModelService,LLMModelServiceInjector,@@ -66,7 +67,6 @@ from openhands.app_server.web_client.web_client_config_injector import (WebClientConfigInjector,)from openhands.sdk.utils.models import OpenHandsModel-from openhands.server.types import AppModedef get_default_persistence_dir() -> Path:diff --git a/openhands/app_server/config_api/config_models.py b/openhands/app_server/config_api/config_models.pyindex 4af43101a7..e725e1a953 100644--- a/openhands/app_server/config_api/config_models.py+++ b/openhands/app_server/config_api/config_models.py@@ -1,8 +1,15 @@"""Config-related models for OpenHands App Server V1 API."""+from enum import Enum+from pydantic import BaseModel, Field+class AppMode(Enum):+ OPENHANDS = 'oss'+ SAAS = 'saas'++class LLMModel(BaseModel):"""LLM Model object for API responses."""diff --git a/openhands/app_server/event_callback/webhook_router.py b/openhands/app_server/event_callback/webhook_router.pyindex 30e4db2fcc..d32e1466fe 100644--- a/openhands/app_server/event_callback/webhook_router.py+++ b/openhands/app_server/event_callback/webhook_router.py@@ -28,6 +28,7 @@ from openhands.app_server.config import (get_global_config,get_sandbox_service,)+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.errors import AuthErrorfrom openhands.app_server.event.event_service import EventServicefrom openhands.app_server.event_callback.event_callback_models import EventCallback@@ -50,7 +51,6 @@ from openhands.app_server.user_auth.user_auth import ()from openhands.sdk import ConversationExecutionStatus, Eventfrom openhands.sdk.event import ConversationStateUpdateEvent-from openhands.server.types import AppModerouter = APIRouter(prefix='/webhooks', tags=['Webhooks'])event_service_dependency = depends_event_service()diff --git a/openhands/app_server/integrations/azure_devops/service/repos.py b/openhands/app_server/integrations/azure_devops/service/repos.pyindex de50c1b016..11cd19e7d1 100644--- a/openhands/app_server/integrations/azure_devops/service/repos.py+++ b/openhands/app_server/integrations/azure_devops/service/repos.py@@ -1,10 +1,10 @@"""Repository operations for Azure DevOps integration."""+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.azure_devops.service.base import (AzureDevOpsMixinBase,)from openhands.app_server.integrations.service_types import ProviderType, Repository-from openhands.server.types import AppModeclass AzureDevOpsReposMixin(AzureDevOpsMixinBase):diff --git a/openhands/app_server/integrations/bitbucket/service/repos.py b/openhands/app_server/integrations/bitbucket/service/repos.pyindex 0c0bba9667..023bfdcadc 100644--- a/openhands/app_server/integrations/bitbucket/service/repos.py+++ b/openhands/app_server/integrations/bitbucket/service/repos.py@@ -2,9 +2,9 @@ import refrom typing import Anyfrom urllib.parse import urlparse+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.bitbucket.service.base import BitBucketMixinBasefrom openhands.app_server.integrations.service_types import Repository, SuggestedTask-from openhands.server.types import AppModeclass BitBucketReposMixin(BitBucketMixinBase):diff --git a/openhands/app_server/integrations/bitbucket_data_center/service/repos.py b/openhands/app_server/integrations/bitbucket_data_center/service/repos.pyindex c1d58371f1..7403d33afe 100644--- a/openhands/app_server/integrations/bitbucket_data_center/service/repos.py+++ b/openhands/app_server/integrations/bitbucket_data_center/service/repos.py@@ -1,11 +1,11 @@from typing import Anyfrom urllib.parse import urlparse+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.bitbucket_data_center.service.base import (BitbucketDCMixinBase,)from openhands.app_server.integrations.service_types import Repository, SuggestedTask-from openhands.server.types import AppModeclass BitbucketDCReposMixin(BitbucketDCMixinBase):diff --git a/openhands/app_server/integrations/forgejo/service/repos.py b/openhands/app_server/integrations/forgejo/service/repos.pyindex 03a7f7c7ea..463c838704 100644--- a/openhands/app_server/integrations/forgejo/service/repos.py+++ b/openhands/app_server/integrations/forgejo/service/repos.py@@ -1,8 +1,8 @@from __future__ import annotations+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.forgejo.service.base import ForgejoMixinBasefrom openhands.app_server.integrations.service_types import Repository-from openhands.server.types import AppModeclass ForgejoReposMixin(ForgejoMixinBase):diff --git a/openhands/app_server/integrations/github/service/repos.py b/openhands/app_server/integrations/github/service/repos.pyindex 04f85f8be3..88f120de21 100644--- a/openhands/app_server/integrations/github/service/repos.py+++ b/openhands/app_server/integrations/github/service/repos.py@@ -1,5 +1,6 @@from datetime import datetime+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.github.service.base import GitHubMixinBasefrom openhands.app_server.integrations.service_types import (OwnerType,@@ -7,7 +8,6 @@ from openhands.app_server.integrations.service_types import (Repository,)from openhands.app_server.utils.logger import openhands_logger as logger-from openhands.server.types import AppModeclass GitHubReposMixin(GitHubMixinBase):diff --git a/openhands/app_server/integrations/gitlab/service/repos.py b/openhands/app_server/integrations/gitlab/service/repos.pyindex fe0568fd3f..5fb31c4a53 100644--- a/openhands/app_server/integrations/gitlab/service/repos.py+++ b/openhands/app_server/integrations/gitlab/service/repos.py@@ -1,3 +1,4 @@+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.gitlab.service.base import GitLabMixinBasefrom openhands.app_server.integrations.service_types import (OwnerType,@@ -5,7 +6,6 @@ from openhands.app_server.integrations.service_types import (Repository,)from openhands.app_server.utils.logger import openhands_logger as logger-from openhands.server.types import AppModeclass GitLabReposMixin(GitLabMixinBase):diff --git a/openhands/app_server/integrations/provider.py b/openhands/app_server/integrations/provider.pyindex cb458211ac..cc7f24d41b 100644--- a/openhands/app_server/integrations/provider.py+++ b/openhands/app_server/integrations/provider.py@@ -14,6 +14,7 @@ from pydantic import (SecretStr,)+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.azure_devops.azure_devops_service import (AzureDevOpsServiceImpl,)@@ -42,7 +43,6 @@ from openhands.app_server.integrations.service_types import ()from openhands.app_server.utils.http_session import httpx_verify_optionfrom openhands.app_server.utils.logger import openhands_logger as logger-from openhands.server.types import AppModeclass ProviderToken(BaseModel):diff --git a/openhands/app_server/integrations/service_types.py b/openhands/app_server/integrations/service_types.pyindex 9676a3618f..2a63944ddb 100644--- a/openhands/app_server/integrations/service_types.py+++ b/openhands/app_server/integrations/service_types.py@@ -6,7 +6,7 @@ from typing import Any, Protocolfrom jinja2 import Environment, FileSystemLoaderfrom pydantic import BaseModel, SecretStr-from openhands.server.types import AppMode+from openhands.app_server.config_api.config_models import AppModeclass TokenResponse(BaseModel):diff --git a/openhands/app_server/mcp/mcp_router.py b/openhands/app_server/mcp/mcp_router.pyindex b28fa75925..5d214b1846 100644--- a/openhands/app_server/mcp/mcp_router.py+++ b/openhands/app_server/mcp/mcp_router.py@@ -12,6 +12,7 @@ from openhands.app_server.config import (get_app_conversation_info_service,get_global_config,)+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.azure_devops.azure_devops_service import (AzureDevOpsServiceImpl,)@@ -36,7 +37,6 @@ from openhands.app_server.user_auth import (get_user_id,)from openhands.app_server.utils.logger import openhands_logger as logger-from openhands.server.types import AppModemcp_server = FastMCP('mcp', mask_error_details=True)diff --git a/openhands/app_server/sandbox/session_auth.py b/openhands/app_server/sandbox/session_auth.pyindex ceecfbfb36..6195642f72 100644--- a/openhands/app_server/sandbox/session_auth.py+++ b/openhands/app_server/sandbox/session_auth.py@@ -23,10 +23,10 @@ from typing import TYPE_CHECKINGfrom fastapi import HTTPException, statusfrom openhands.app_server.config import get_global_config, get_sandbox_service+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.sandbox.sandbox_models import SandboxInfo, SandboxStatusfrom openhands.app_server.services.injector import InjectorStatefrom openhands.app_server.user.specifiy_user_context import ADMIN, USER_CONTEXT_ATTR-from openhands.server.types import AppModeif TYPE_CHECKING:from openhands.app_server.user.user_context import UserContextdiff --git a/openhands/app_server/utils/dependencies.py b/openhands/app_server/utils/dependencies.pyindex 8ca238a94d..0d1499283d 100644--- a/openhands/app_server/utils/dependencies.py+++ b/openhands/app_server/utils/dependencies.py@@ -4,7 +4,7 @@ from fastapi import Depends, HTTPException, statusfrom fastapi.security import APIKeyHeaderfrom openhands.app_server.config import get_global_config-from openhands.server.types import AppMode+from openhands.app_server.config_api.config_models import AppMode_SESSION_API_KEY = os.getenv('SESSION_API_KEY')_SESSION_API_KEY_HEADER = APIKeyHeader(name='X-Session-API-Key', auto_error=False)diff --git a/openhands/app_server/web_client/web_client_models.py b/openhands/app_server/web_client/web_client_models.pyindex a141441a72..8957eef062 100644--- a/openhands/app_server/web_client/web_client_models.py+++ b/openhands/app_server/web_client/web_client_models.py@@ -3,12 +3,12 @@ from datetime import datetimefrom pydantic import BaseModel, Field, model_validatorfrom openhands.agent_server.env_parser import DiscriminatedUnionMixin+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.web_client.web_client_deployment_mode import (DeploymentMode,get_deployment_mode,)-from openhands.server.types import AppModeclass WebClientFeatureFlags(BaseModel):diff --git a/openhands/server/config/server_config.py b/openhands/server/config/server_config.pyindex f169365a1c..babb44ed1e 100644--- a/openhands/server/config/server_config.py+++ b/openhands/server/config/server_config.py@@ -8,9 +8,10 @@# This module belongs to the old V0 web server. The V1 application server lives under openhands/app_server/.import os+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.utils.import_utils import get_implfrom openhands.app_server.utils.logger import openhands_logger as logger-from openhands.server.types import AppMode, ServerConfigInterface+from openhands.server.types import ServerConfigInterfaceclass ServerConfig(ServerConfigInterface):diff --git a/openhands/server/types.py b/openhands/server/types.pyindex 1e52bf7984..4e4b9c7501 100644--- a/openhands/server/types.py+++ b/openhands/server/types.py@@ -7,15 +7,9 @@# Tag: Legacy-V0# This module belongs to the old V0 web server. The V1 application server lives under openhands/app_server/.from abc import ABC, abstractmethod-from enum import Enumfrom typing import Any-class AppMode(Enum):- OPENHANDS = 'oss'- SAAS = 'saas'--class ServerConfigInterface(ABC):@abstractmethoddef verify_config(self) -> None:diff --git a/tests/unit/app_server/test_live_status_app_conversation_service.py b/tests/unit/app_server/test_live_status_app_conversation_service.pyindex 682ef01181..8825057847 100644--- a/tests/unit/app_server/test_live_status_app_conversation_service.py+++ b/tests/unit/app_server/test_live_status_app_conversation_service.py@@ -26,6 +26,7 @@ from openhands.app_server.app_conversation.app_conversation_models import (from openhands.app_server.app_conversation.live_status_app_conversation_service import (LiveStatusAppConversationService,)+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.provider import ProviderToken, ProviderTypefrom openhands.app_server.integrations.service_types import SuggestedTask, TaskTypefrom openhands.app_server.sandbox.sandbox_models import (@@ -47,7 +48,6 @@ from openhands.sdk.llm import LLMfrom openhands.sdk.secret import LookupSecret, StaticSecretfrom openhands.sdk.settings import AgentSettings, ConversationSettingsfrom openhands.sdk.workspace.remote.async_remote_workspace import AsyncRemoteWorkspace-from openhands.server.types import AppMode# True only on SDK versions that include PR #2984 (secrets acp_compatible=True).# When False, _build_acp_start_conversation_request skips the agent_context path.diff --git a/tests/unit/app_server/test_sandbox_secrets_router.py b/tests/unit/app_server/test_sandbox_secrets_router.pyindex 1c08dc65a1..6b89f2d729 100644--- a/tests/unit/app_server/test_sandbox_secrets_router.py+++ b/tests/unit/app_server/test_sandbox_secrets_router.py@@ -135,7 +135,7 @@ class TestValidateSessionKey:mock_get.return_value.__aenter__ = AsyncMock(return_value=mock_svc)mock_get.return_value.__aexit__ = AsyncMock(return_value=False)- from openhands.server.types import AppMode+ from openhands.app_server.config_api.config_models import AppModemock_cfg.return_value.app_mode = AppMode.SAASdiff --git a/tests/unit/app_server/test_webhook_router_auth.py b/tests/unit/app_server/test_webhook_router_auth.pyindex 3d6880b850..5a0e87488b 100644--- a/tests/unit/app_server/test_webhook_router_auth.py+++ b/tests/unit/app_server/test_webhook_router_auth.py@@ -11,6 +11,7 @@ import pytestfrom fastapi import FastAPI, HTTPException, statusfrom fastapi.testclient import TestClient+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.event_callback.webhook_router import (router as webhook_router,)@@ -23,7 +24,6 @@ from openhands.app_server.user.specifiy_user_context import (USER_CONTEXT_ATTR,SpecifyUserContext,)-from openhands.server.types import AppModeclass MockRequestState:diff --git a/tests/unit/integrations/bitbucket/test_bitbucket.py b/tests/unit/integrations/bitbucket/test_bitbucket.pyindex 5f89e7c47e..112351fe07 100644--- a/tests/unit/integrations/bitbucket/test_bitbucket.py+++ b/tests/unit/integrations/bitbucket/test_bitbucket.py@@ -5,6 +5,7 @@ from unittest.mock import AsyncMock, patchimport pytestfrom pydantic import SecretStr+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.bitbucket.bitbucket_service import (BitBucketService,)@@ -16,7 +17,6 @@ from openhands.app_server.integrations.service_types import (from openhands.app_server.integrations.utils import validate_provider_tokenfrom openhands.app_server.secrets.secrets_router import check_provider_tokensfrom openhands.app_server.settings.settings_models import POSTProviderModel-from openhands.server.types import AppMode# Provider Token Validation Testsdiff --git a/tests/unit/integrations/bitbucket/test_bitbucket_repos.py b/tests/unit/integrations/bitbucket/test_bitbucket_repos.pyindex 77ab4ec853..72fb656f19 100644--- a/tests/unit/integrations/bitbucket/test_bitbucket_repos.py+++ b/tests/unit/integrations/bitbucket/test_bitbucket_repos.py@@ -5,6 +5,7 @@ from unittest.mock import patchimport pytestfrom pydantic import SecretStr+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.bitbucket.bitbucket_service import (BitBucketService,)@@ -12,7 +13,6 @@ from openhands.app_server.integrations.service_types import OwnerType, Repositorfrom openhands.app_server.integrations.service_types import (ProviderType as ServiceProviderType,)-from openhands.server.types import AppMode@pytest.fixturediff --git a/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc.py b/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc.pyindex d9d6d0de5b..9ddfa204e2 100644--- a/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc.py+++ b/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc.py@@ -6,11 +6,11 @@ from unittest.mock import patchimport pytestfrom pydantic import SecretStr+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.bitbucket_data_center.bitbucket_dc_service import (BitbucketDCService,)from openhands.app_server.integrations.service_types import AuthenticationError, User-from openhands.server.types import AppMode# ββ init / BASE_URL βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββdiff --git a/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_repos.py b/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_repos.pyindex 03b608f7de..a552deb892 100644--- a/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_repos.py+++ b/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_repos.py@@ -5,10 +5,10 @@ from unittest.mock import AsyncMock, patchimport pytestfrom pydantic import SecretStr+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.bitbucket_data_center.bitbucket_dc_service import (BitbucketDCService,)-from openhands.server.types import AppModedef make_service():diff --git a/tests/unit/integrations/github/test_github_service.py b/tests/unit/integrations/github/test_github_service.pyindex a18e4ace57..c2d86bea14 100644--- a/tests/unit/integrations/github/test_github_service.py+++ b/tests/unit/integrations/github/test_github_service.py@@ -4,6 +4,7 @@ import httpximport pytestfrom pydantic import SecretStr+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.github.github_service import GitHubServicefrom openhands.app_server.integrations.service_types import (AuthenticationError,@@ -12,7 +13,6 @@ from openhands.app_server.integrations.service_types import (Repository,User,)-from openhands.server.types import AppMode@pytest.mark.asynciodiff --git a/tests/unit/integrations/gitlab/test_gitlab.py b/tests/unit/integrations/gitlab/test_gitlab.pyindex b0c63ca7ba..e1cc5ca779 100644--- a/tests/unit/integrations/gitlab/test_gitlab.py+++ b/tests/unit/integrations/gitlab/test_gitlab.py@@ -6,6 +6,7 @@ from unittest.mock import patchimport pytestfrom pydantic import SecretStr+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations import provider as provider_modulefrom openhands.app_server.integrations.gitlab import (constants as gitlab_constants_module,@@ -17,7 +18,6 @@ from openhands.app_server.integrations.service_types import (ProviderType,Repository,)-from openhands.server.types import AppMode@pytest.mark.asynciodiff --git a/tests/unit/server/routes/test_mcp_routes.py b/tests/unit/server/routes/test_mcp_routes.pyindex 96cb93cd70..6e84ff957d 100644--- a/tests/unit/server/routes/test_mcp_routes.py+++ b/tests/unit/server/routes/test_mcp_routes.py@@ -3,9 +3,9 @@ from unittest.mock import AsyncMock, patchimport pytest+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.service_types import GitServicefrom openhands.app_server.mcp.mcp_router import get_conversation_link-from openhands.server.types import AppModedef test_mcp_server_no_stateless_http_deprecation_warning():diff --git a/tests/unit/test_forgejo_service.py b/tests/unit/test_forgejo_service.pyindex e3fc69941c..59a567ac19 100644--- a/tests/unit/test_forgejo_service.py+++ b/tests/unit/test_forgejo_service.py@@ -4,6 +4,7 @@ import httpximport pytestfrom pydantic import SecretStr+from openhands.app_server.config_api.config_models import AppModefrom openhands.app_server.integrations.forgejo.forgejo_service import ForgejoServicefrom openhands.app_server.integrations.service_types import (ProviderType,@@ -11,7 +12,6 @@ from openhands.app_server.integrations.service_types import (RequestMethod,User,)-from openhands.server.types import AppMode@pytest.fixture