Skip to content

πŸ™Œ 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.py
index e5c8064c93..eff7b6de12 100644
--- a/enterprise/server/routes/auth.py
+++ b/enterprise/server/routes/auth.py
@@ -3,6 +3,7 @@ import json
import uuid
import warnings
from datetime import datetime, timezone
+from types import MappingProxyType
from typing import Annotated, Optional, cast
from urllib.parse import quote, urlencode
from uuid import UUID as parse_uuid
@@ -46,10 +47,13 @@ from storage.database import a_session_maker
from storage.user import User
from 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, TokenResponse
from openhands.core.logger import openhands_logger as logger
-from openhands.server.services.conversation_service import create_provider_tokens_object
from openhands.server.shared import config
from openhands.server.user_auth import get_access_token
from 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.py
deleted file mode 100644
index 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.py
deleted file mode 100644
index 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)