π OpenHands: AI-Driven Development
Remove unused legacy V0 server modules (#14198)
Tim O'Farrell1e023ce56b1d
diff --git a/enterprise/server/routes/auth.py b/enterprise/server/routes/auth.pyindex e5c8064c93..eff7b6de12 100644--- a/enterprise/server/routes/auth.py+++ b/enterprise/server/routes/auth.py@@ -3,6 +3,7 @@ import jsonimport uuidimport warningsfrom datetime import datetime, timezone+from types import MappingProxyTypefrom typing import Annotated, Optional, castfrom urllib.parse import quote, urlencodefrom uuid import UUID as parse_uuid@@ -46,10 +47,13 @@ from storage.database import a_session_makerfrom storage.user import Userfrom storage.user_store import UserStore-from openhands.app_server.integrations.provider import ProviderHandler+from openhands.app_server.integrations.provider import (+ PROVIDER_TOKEN_TYPE,+ ProviderHandler,+ ProviderToken,+)from openhands.app_server.integrations.service_types import ProviderType, TokenResponsefrom openhands.core.logger import openhands_logger as logger-from openhands.server.services.conversation_service import create_provider_tokens_objectfrom openhands.server.shared import configfrom openhands.server.user_auth import get_access_tokenfrom openhands.server.user_auth.user_auth import get_user_auth@@ -63,6 +67,18 @@ oauth_router = APIRouter(prefix='/oauth')token_manager = TokenManager()+def create_provider_tokens_object(+ providers_set: list[ProviderType],+) -> PROVIDER_TOKEN_TYPE:+ """Create provider tokens object for the given providers."""+ provider_information: dict[ProviderType, ProviderToken] = {}++ for provider in providers_set:+ provider_information[provider] = ProviderToken(token=None, user_id=None)++ return MappingProxyType(provider_information)++def set_response_cookie(request: Request,response: Response,diff --git a/openhands/server/constants.py b/openhands/server/constants.pydeleted file mode 100644index 21260641db..0000000000--- a/openhands/server/constants.py+++ /dev/null@@ -1,11 +0,0 @@-# IMPORTANT: LEGACY V0 CODE - Deprecated since version 1.0.0, scheduled for removal April 1, 2026-# This file is part of the legacy (V0) implementation of OpenHands and will be removed soon as we complete the migration to V1.-# OpenHands V1 uses the Software Agent SDK for the agentic core and runs a new application server. Please refer to:-# - V1 agentic core (SDK): https://github.com/OpenHands/software-agent-sdk-# - V1 application server (in this repo): openhands/app_server/-# Unless you are working on deprecation, please avoid extending this legacy file and consult the V1 codepaths above.-# Tag: Legacy-V0-# This module belongs to the old V0 web server. The V1 application server lives under openhands/app_server/.-"""Server constants."""--ROOM_KEY = 'room:{sid}'diff --git a/openhands/server/services/conversation_service.py b/openhands/server/services/conversation_service.pydeleted file mode 100644index 1f84b1ecad..0000000000--- a/openhands/server/services/conversation_service.py+++ /dev/null@@ -1,27 +0,0 @@-# IMPORTANT: LEGACY V0 CODE - Deprecated since version 1.0.0, scheduled for removal April 1, 2026-# This file is part of the legacy (V0) implementation of OpenHands and will be removed soon as we complete the migration to V1.-# OpenHands V1 uses the Software Agent SDK for the agentic core and runs a new application server. Please refer to:-# - V1 agentic core (SDK): https://github.com/OpenHands/software-agent-sdk-# - V1 application server (in this repo): openhands/app_server/-# Unless you are working on deprecation, please avoid extending this legacy file and consult the V1 codepaths above.-# Tag: Legacy-V0-# This module belongs to the old V0 web server. The V1 application server lives under openhands/app_server/.-from types import MappingProxyType--from openhands.app_server.integrations.provider import (- PROVIDER_TOKEN_TYPE,- ProviderToken,-)-from openhands.app_server.integrations.service_types import ProviderType---def create_provider_tokens_object(- providers_set: list[ProviderType],-) -> PROVIDER_TOKEN_TYPE:- """Create provider tokens object for the given providers."""- provider_information: dict[ProviderType, ProviderToken] = {}-- for provider in providers_set:- provider_information[provider] = ProviderToken(token=None, user_id=None)-- return MappingProxyType(provider_information)