π OpenHands: AI-Driven Development
refactor: move openhands.integrations to openhands.app_server.integrations (#14195)
Tim O'Farrell5b500d640a86
diff --git a/AGENTS.md b/AGENTS.mdindex 1d2675dbb2..203ef9cacd 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -27,7 +27,7 @@ Before pushing any changes, you MUST ensure that any lint errors or simple test* If you've made changes to the backend, you should run `pre-commit run --config ./dev_config/python/.pre-commit-config.yaml` (this will run on staged files).* If you've made changes to the frontend, you should run `cd frontend && npm run lint:fix && npm run build ; cd ..`-* If you've made changes to the VSCode extension, you should run `cd openhands/integrations/vscode && npm run lint:fix && npm run compile ; cd ../../..`+* If you've made changes to the VSCode extension, you should run `cd openhands/app_server/integrations/vscode && npm run lint:fix && npm run compile ; cd ../../..`The pre-commit hooks MUST pass successfully before pushing any changes to the repository. This is a mandatory requirement to maintain code quality and consistency.@@ -150,7 +150,7 @@ Frontend:VSCode Extension:-- Located in the `openhands/integrations/vscode` directory+- Located in the `openhands/app_server/integrations/vscode` directory- Setup: Run `npm install` in the extension directory- Linting:- Run linting with fixes: `npm run lint:fix`diff --git a/enterprise/integrations/bitbucket/bitbucket_service.py b/enterprise/integrations/bitbucket/bitbucket_service.pyindex 24e7f7ea32..391815855e 100644--- a/enterprise/integrations/bitbucket/bitbucket_service.py+++ b/enterprise/integrations/bitbucket/bitbucket_service.py@@ -1,9 +1,11 @@from pydantic import SecretStrfrom server.auth.token_manager import TokenManager+from openhands.app_server.integrations.bitbucket.bitbucket_service import (+ BitBucketService,+)+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.bitbucket.bitbucket_service import BitBucketService-from openhands.integrations.service_types import ProviderTypeclass SaaSBitBucketService(BitBucketService):diff --git a/enterprise/integrations/bitbucket_data_center/bitbucket_dc_service.py b/enterprise/integrations/bitbucket_data_center/bitbucket_dc_service.pyindex eeb0334b95..28e6ef587a 100644--- a/enterprise/integrations/bitbucket_data_center/bitbucket_dc_service.py+++ b/enterprise/integrations/bitbucket_data_center/bitbucket_dc_service.py@@ -1,11 +1,11 @@from pydantic import SecretStrfrom server.auth.token_manager import TokenManager-from openhands.core.logger import openhands_logger as logger-from openhands.integrations.bitbucket_data_center.bitbucket_dc_service import (+from openhands.app_server.integrations.bitbucket_data_center.bitbucket_dc_service import (BitbucketDCService,)-from openhands.integrations.service_types import ProviderType+from openhands.app_server.integrations.service_types import ProviderType+from openhands.core.logger import openhands_logger as loggerclass SaaSBitbucketDCService(BitbucketDCService):diff --git a/enterprise/integrations/github/data_collector.py b/enterprise/integrations/github/data_collector.pyindex 8149ba7ae9..15ce9adeae 100644--- a/enterprise/integrations/github/data_collector.py+++ b/enterprise/integrations/github/data_collector.py@@ -21,10 +21,10 @@ from storage.openhands_pr_store import OpenhandsPRStorefrom openhands.app_server.conversation_paths import get_conversation_dirfrom openhands.app_server.file_store import get_file_store+from openhands.app_server.integrations.github.github_service import GithubServiceImpl+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.core.config import load_openhands_configfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.github.github_service import GithubServiceImpl-from openhands.integrations.service_types import ProviderTypeconfig = load_openhands_config()file_store = get_file_store(config.file_store, config.file_store_path)diff --git a/enterprise/integrations/github/github_manager.py b/enterprise/integrations/github/github_manager.pyindex c9f5980b46..7689f156db 100644--- a/enterprise/integrations/github/github_manager.py+++ b/enterprise/integrations/github/github_manager.py@@ -31,10 +31,10 @@ from server.auth.auth_error import ExpiredErrorfrom server.auth.constants import GITHUB_APP_CLIENT_ID, GITHUB_APP_PRIVATE_KEYfrom server.auth.token_manager import TokenManager+from openhands.app_server.integrations.provider import ProviderToken, ProviderType+from openhands.app_server.integrations.service_types import AuthenticationErrorfrom openhands.app_server.secrets.secrets_models import Secretsfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.provider import ProviderToken, ProviderType-from openhands.integrations.service_types import AuthenticationErrorfrom openhands.server.types import (LLMAuthenticationError,MissingSettingsError,diff --git a/enterprise/integrations/github/github_service.py b/enterprise/integrations/github/github_service.pyindex 6d1fb929a4..b09d2bde44 100644--- a/enterprise/integrations/github/github_service.py+++ b/enterprise/integrations/github/github_service.py@@ -4,9 +4,9 @@ from integrations.store_repo_utils import store_repositories_in_dbfrom pydantic import SecretStrfrom server.auth.token_manager import TokenManager+from openhands.app_server.integrations.github.github_service import GitHubService+from openhands.app_server.integrations.service_types import ProviderType, Repositoryfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.github.github_service import GitHubService-from openhands.integrations.service_types import ProviderType, Repositoryfrom openhands.server.types import AppModediff --git a/enterprise/integrations/github/github_view.py b/enterprise/integrations/github/github_view.pyindex 81328294ca..f6f7edc550 100644--- a/enterprise/integrations/github/github_view.py+++ b/enterprise/integrations/github/github_view.py@@ -34,12 +34,12 @@ from openhands.app_server.app_conversation.app_conversation_models import (ConversationTrigger,)from openhands.app_server.config import get_app_conversation_service+from openhands.app_server.integrations.github.github_service import GithubServiceImpl+from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType+from openhands.app_server.integrations.service_types import Commentfrom openhands.app_server.services.injector import InjectorStatefrom openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTRfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.github.github_service import GithubServiceImpl-from openhands.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType-from openhands.integrations.service_types import Commentfrom openhands.sdk import TextContentfrom openhands.server.user_auth.user_auth import UserAuthfrom openhands.utils.async_utils import call_sync_from_asyncdiff --git a/enterprise/integrations/gitlab/gitlab_manager.py b/enterprise/integrations/gitlab/gitlab_manager.pyindex 34ffc90ebe..1708fbbb7c 100644--- a/enterprise/integrations/gitlab/gitlab_manager.py+++ b/enterprise/integrations/gitlab/gitlab_manager.py@@ -25,10 +25,10 @@ from jinja2 import Environment, FileSystemLoaderfrom pydantic import SecretStrfrom server.auth.token_manager import TokenManager+from openhands.app_server.integrations.gitlab.gitlab_service import GitLabServiceImpl+from openhands.app_server.integrations.provider import ProviderToken, ProviderTypefrom openhands.app_server.secrets.secrets_models import Secretsfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.gitlab.gitlab_service import GitLabServiceImpl-from openhands.integrations.provider import ProviderToken, ProviderTypefrom openhands.server.types import (LLMAuthenticationError,MissingSettingsError,diff --git a/enterprise/integrations/gitlab/gitlab_service.py b/enterprise/integrations/gitlab/gitlab_service.pyindex ac4a947920..b23f0e94bc 100644--- a/enterprise/integrations/gitlab/gitlab_service.py+++ b/enterprise/integrations/gitlab/gitlab_service.py@@ -7,14 +7,14 @@ from server.auth.token_manager import TokenManagerfrom storage.gitlab_webhook import GitlabWebhook, WebhookStatusfrom storage.gitlab_webhook_store import GitlabWebhookStore-from openhands.core.logger import openhands_logger as logger-from openhands.integrations.gitlab.gitlab_service import GitLabService-from openhands.integrations.service_types import (+from openhands.app_server.integrations.gitlab.gitlab_service import GitLabService+from openhands.app_server.integrations.service_types import (ProviderType,RateLimitError,Repository,RequestMethod,)+from openhands.core.logger import openhands_logger as loggerfrom openhands.server.types import AppModediff --git a/enterprise/integrations/gitlab/gitlab_view.py b/enterprise/integrations/gitlab/gitlab_view.pyindex 25a60bfcd5..ba2e0581c6 100644--- a/enterprise/integrations/gitlab/gitlab_view.py+++ b/enterprise/integrations/gitlab/gitlab_view.py@@ -22,12 +22,12 @@ from openhands.app_server.app_conversation.app_conversation_models import (ConversationTrigger,)from openhands.app_server.config import get_app_conversation_service+from openhands.app_server.integrations.gitlab.gitlab_service import GitLabServiceImpl+from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType+from openhands.app_server.integrations.service_types import Commentfrom openhands.app_server.services.injector import InjectorStatefrom openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTRfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.gitlab.gitlab_service import GitLabServiceImpl-from openhands.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType-from openhands.integrations.service_types import Commentfrom openhands.sdk import TextContentfrom openhands.server.user_auth.user_auth import UserAuthdiff --git a/enterprise/integrations/jira/jira_view.py b/enterprise/integrations/jira/jira_view.pyindex 45f3a4c817..39b0a8ac88 100644--- a/enterprise/integrations/jira/jira_view.py+++ b/enterprise/integrations/jira/jira_view.py@@ -38,10 +38,10 @@ from openhands.app_server.app_conversation.app_conversation_models import (ConversationTrigger,)from openhands.app_server.config import get_app_conversation_service+from openhands.app_server.integrations.provider import ProviderHandler, ProviderTypefrom openhands.app_server.services.injector import InjectorStatefrom openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTRfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.provider import ProviderHandler, ProviderTypefrom openhands.sdk import TextContentfrom openhands.server.user_auth.user_auth import UserAuthfrom openhands.utils.http_session import httpx_verify_optiondiff --git a/enterprise/integrations/jira_dc/jira_dc_manager.py b/enterprise/integrations/jira_dc/jira_dc_manager.pyindex 92975fc962..ff9569fe11 100644--- a/enterprise/integrations/jira_dc/jira_dc_manager.py+++ b/enterprise/integrations/jira_dc/jira_dc_manager.py@@ -29,9 +29,9 @@ from storage.jira_dc_integration_store import JiraDcIntegrationStorefrom storage.jira_dc_user import JiraDcUserfrom storage.jira_dc_workspace import JiraDcWorkspace+from openhands.app_server.integrations.provider import ProviderHandler+from openhands.app_server.integrations.service_types import Repositoryfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.provider import ProviderHandler-from openhands.integrations.service_types import Repositoryfrom openhands.server.shared import server_configfrom openhands.server.types import (LLMAuthenticationError,diff --git a/enterprise/integrations/jira_dc/jira_dc_view.py b/enterprise/integrations/jira_dc/jira_dc_view.pyindex 4f4cc0d2e8..328da4b0a0 100644--- a/enterprise/integrations/jira_dc/jira_dc_view.py+++ b/enterprise/integrations/jira_dc/jira_dc_view.py@@ -30,10 +30,10 @@ from openhands.app_server.app_conversation.app_conversation_models import (ConversationTrigger,)from openhands.app_server.config import get_app_conversation_service+from openhands.app_server.integrations.provider import ProviderHandler, ProviderTypefrom openhands.app_server.services.injector import InjectorStatefrom openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTRfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.provider import ProviderHandler, ProviderTypefrom openhands.sdk import TextContentfrom openhands.server.user_auth.user_auth import UserAuthdiff --git a/enterprise/integrations/resolver_context.py b/enterprise/integrations/resolver_context.pyindex 1ec84a0cea..38100b1823 100644--- a/enterprise/integrations/resolver_context.py+++ b/enterprise/integrations/resolver_context.py@@ -1,9 +1,12 @@from uuid import UUID+from openhands.app_server.integrations.provider import (+ PROVIDER_TOKEN_TYPE,+ ProviderHandler,+)+from openhands.app_server.integrations.service_types import ProviderType, UserGitInfofrom openhands.app_server.user.user_context import UserContextfrom openhands.app_server.user.user_models import UserInfo-from openhands.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderHandler-from openhands.integrations.service_types import ProviderType, UserGitInfofrom openhands.sdk.secret import SecretSource, StaticSecretfrom openhands.server.user_auth.user_auth import UserAuthdiff --git a/enterprise/integrations/slack/slack_manager.py b/enterprise/integrations/slack/slack_manager.pyindex d691706b78..58b8903234 100644--- a/enterprise/integrations/slack/slack_manager.py+++ b/enterprise/integrations/slack/slack_manager.py@@ -30,13 +30,13 @@ from sqlalchemy import selectfrom storage.database import a_session_makerfrom storage.slack_user import SlackUser-from openhands.core.logger import openhands_logger as logger-from openhands.integrations.provider import ProviderHandler-from openhands.integrations.service_types import (+from openhands.app_server.integrations.provider import ProviderHandler+from openhands.app_server.integrations.service_types import (AuthenticationError,ProviderTimeoutError,Repository,)+from openhands.core.logger import openhands_logger as loggerfrom openhands.server.shared import config, server_config, siofrom openhands.server.types import (LLMAuthenticationError,diff --git a/enterprise/integrations/slack/slack_view.py b/enterprise/integrations/slack/slack_view.pyindex bc78a0ccb9..743fb4c965 100644--- a/enterprise/integrations/slack/slack_view.py+++ b/enterprise/integrations/slack/slack_view.py@@ -30,11 +30,11 @@ from openhands.app_server.app_conversation.app_conversation_models import (SendMessageRequest,)from openhands.app_server.config import get_app_conversation_service+from openhands.app_server.integrations.provider import ProviderHandlerfrom openhands.app_server.sandbox.sandbox_models import SandboxStatusfrom openhands.app_server.services.injector import InjectorStatefrom openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTRfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.provider import ProviderHandlerfrom openhands.sdk import TextContentfrom openhands.server.user_auth.user_auth import UserAuthfrom openhands.utils.async_utils import GENERAL_TIMEOUTdiff --git a/enterprise/integrations/store_repo_utils.py b/enterprise/integrations/store_repo_utils.pyindex 82371fe854..f977d8a7d5 100644--- a/enterprise/integrations/store_repo_utils.py+++ b/enterprise/integrations/store_repo_utils.py@@ -3,9 +3,9 @@ from storage.stored_repository import StoredRepositoryfrom storage.user_repo_map import UserRepositoryMapfrom storage.user_repo_map_store import UserRepositoryMapStore+from openhands.app_server.integrations.service_types import Repositoryfrom openhands.core.config.openhands_config import OpenHandsConfigfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.service_types import Repositoryasync def store_repositories_in_db(repos: list[Repository], user_id: str) -> None:diff --git a/enterprise/integrations/types.py b/enterprise/integrations/types.pyindex 4de80c8a0d..80a1242495 100644--- a/enterprise/integrations/types.py+++ b/enterprise/integrations/types.py@@ -9,7 +9,7 @@ from pydantic import BaseModelif TYPE_CHECKING:from integrations.models import Message- from openhands.integrations.provider import PROVIDER_TOKEN_TYPE+ from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPEfrom openhands.server.user_auth.user_auth import UserAuthdiff --git a/enterprise/integrations/utils.py b/enterprise/integrations/utils.pyindex 0bf8ef5880..8f047ef31d 100644--- a/enterprise/integrations/utils.py+++ b/enterprise/integrations/utils.py@@ -6,7 +6,7 @@ import refrom jinja2 import Environment, FileSystemLoaderfrom server.constants import WEB_HOST-from openhands.integrations.service_types import Repository+from openhands.app_server.integrations.service_types import Repository# ---- DO NOT REMOVE ----# WARNING: Langfuse depends on the WEB_HOST environment variable being set to track events.@@ -65,7 +65,7 @@ def get_user_not_found_message(username: str | None = None) -> str:OPENHANDS_RESOLVER_TEMPLATES_DIR = (os.getenv('OPENHANDS_RESOLVER_TEMPLATES_DIR')- or 'openhands/integrations/templates/resolver/'+ or 'openhands/app_server/integrations/templates/resolver/')_jinja_env = Environment(loader=FileSystemLoader(OPENHANDS_RESOLVER_TEMPLATES_DIR))diff --git a/enterprise/server/auth/constants.py b/enterprise/server/auth/constants.pyindex 8ae721833a..3cbd8fc524 100644--- a/enterprise/server/auth/constants.py+++ b/enterprise/server/auth/constants.py@@ -1,6 +1,6 @@import os-from openhands.integrations.gitlab.constants import GITLAB_HOST+from openhands.app_server.integrations.gitlab.constants import GITLAB_HOSTGITHUB_APP_CLIENT_ID = os.getenv('GITHUB_APP_CLIENT_ID', '').strip()GITHUB_APP_CLIENT_SECRET = os.getenv('GITHUB_APP_CLIENT_SECRET', '').strip()diff --git a/enterprise/server/auth/github_utils.py b/enterprise/server/auth/github_utils.pyindex 21980ff805..1cc85420c7 100644--- a/enterprise/server/auth/github_utils.py+++ b/enterprise/server/auth/github_utils.py@@ -2,8 +2,8 @@ from integrations.github.github_service import SaaSGitHubServicefrom pydantic import SecretStrfrom server.auth.auth_utils import user_verifier+from openhands.app_server.integrations.github.github_types import GitHubUserfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.github.github_types import GitHubUserdef is_user_allowed(user_login: str):diff --git a/enterprise/server/auth/gitlab_sync.py b/enterprise/server/auth/gitlab_sync.pyindex c1615f9dbf..966a2b377d 100644--- a/enterprise/server/auth/gitlab_sync.py+++ b/enterprise/server/auth/gitlab_sync.py@@ -3,8 +3,8 @@ import asynciofrom pydantic import SecretStrfrom sqlalchemy import select+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.service_types import ProviderTypefrom openhands.server.types import AppMode@@ -55,7 +55,7 @@ def schedule_gitlab_repo_sync(# Lazy import to avoid circular dependency:# middleware -> gitlab_sync -> integrations.gitlab.gitlab_service- # -> openhands.integrations.gitlab.gitlab_service -> get_impl+ # -> openhands.app_server.integrations.gitlab.gitlab_service -> get_impl# -> integrations.gitlab.gitlab_service (circular)from integrations.gitlab.gitlab_service import SaaSGitLabServicediff --git a/enterprise/server/auth/saas_user_auth.py b/enterprise/server/auth/saas_user_auth.pyindex f0078643c3..c0bf0439d2 100644--- a/enterprise/server/auth/saas_user_auth.py+++ b/enterprise/server/auth/saas_user_auth.py@@ -35,14 +35,14 @@ from storage.user_authorization_store import UserAuthorizationStorefrom storage.user_store import UserStorefrom tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_fixed-from openhands.app_server.secrets.secrets_models import Secrets-from openhands.app_server.settings.settings_models import Settings-from openhands.app_server.settings.settings_store import SettingsStore-from openhands.integrations.provider import (+from openhands.app_server.integrations.provider import (PROVIDER_TOKEN_TYPE,ProviderToken,ProviderType,)+from openhands.app_server.secrets.secrets_models import Secrets+from openhands.app_server.settings.settings_models import Settings+from openhands.app_server.settings.settings_store import SettingsStorefrom openhands.server.user_auth.user_auth import AuthType, UserAuthtoken_manager = TokenManager()diff --git a/enterprise/server/auth/token_manager.py b/enterprise/server/auth/token_manager.pyindex 478fc7665c..4bbbcd3667 100644--- a/enterprise/server/auth/token_manager.py+++ b/enterprise/server/auth/token_manager.py@@ -51,7 +51,7 @@ from storage.github_app_installation import GithubAppInstallationfrom storage.offline_token_store import OfflineTokenStorefrom tenacity import RetryCallState, retry, retry_if_exception_type, stop_after_attempt-from openhands.integrations.service_types import ProviderType+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.server.types import SessionExpiredErrorfrom openhands.utils.http_session import httpx_verify_optiondiff --git a/enterprise/server/config.py b/enterprise/server/config.pyindex 52b9cd6ea1..c21db1eafa 100644--- a/enterprise/server/config.py+++ b/enterprise/server/config.py@@ -22,8 +22,8 @@ from server.auth.constants import ()from server.constants import DEPLOYMENT_MODE+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.core.config.utils import load_openhands_config-from openhands.integrations.service_types import ProviderTypefrom openhands.server.config.server_config import ServerConfigfrom openhands.server.types import AppModediff --git a/enterprise/server/models/user_models.py b/enterprise/server/models/user_models.pyindex 894d07e10d..2df44ddcb8 100644--- a/enterprise/server/models/user_models.py+++ b/enterprise/server/models/user_models.py@@ -2,8 +2,8 @@from pydantic import BaseModel+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.user.user_models import UserInfo-from openhands.integrations.service_types import ProviderTypeclass SaasUserInfo(UserInfo):diff --git a/enterprise/server/routes/auth.py b/enterprise/server/routes/auth.pyindex a71b6cd10b..e5c8064c93 100644--- a/enterprise/server/routes/auth.py+++ b/enterprise/server/routes/auth.py@@ -46,9 +46,9 @@ 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.service_types import ProviderType, TokenResponsefrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.provider import ProviderHandler-from openhands.integrations.service_types import ProviderType, TokenResponsefrom openhands.server.services.conversation_service import create_provider_tokens_objectfrom openhands.server.shared import configfrom openhands.server.user_auth import get_access_tokendiff --git a/enterprise/server/routes/integration/github.py b/enterprise/server/routes/integration/github.pyindex be3cf25a11..b953fcc5df 100644--- a/enterprise/server/routes/integration/github.py+++ b/enterprise/server/routes/integration/github.py@@ -15,8 +15,8 @@ from server.auth.constants import (from server.auth.token_manager import TokenManagerfrom server.services.automation_event_service import AutomationEventService+from openhands.app_server.integrations.provider import ProviderTypefrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.provider import ProviderType# Environment variable to disable GitHub webhooksGITHUB_WEBHOOKS_ENABLED = os.environ.get('GITHUB_WEBHOOKS_ENABLED', '1') in (diff --git a/enterprise/server/routes/integration/gitlab.py b/enterprise/server/routes/integration/gitlab.pyindex a1e001bdc8..31f21346c4 100644--- a/enterprise/server/routes/integration/gitlab.py+++ b/enterprise/server/routes/integration/gitlab.py@@ -19,8 +19,8 @@ from server.auth.token_manager import TokenManagerfrom storage.gitlab_webhook import GitlabWebhookfrom storage.gitlab_webhook_store import GitlabWebhookStore+from openhands.app_server.integrations.gitlab.gitlab_service import GitLabServiceImplfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.gitlab.gitlab_service import GitLabServiceImplfrom openhands.server.shared import siofrom openhands.server.user_auth import get_user_iddiff --git a/enterprise/server/routes/integration/slack.py b/enterprise/server/routes/integration/slack.pyindex c5b8e4b199..c61fddf446 100644--- a/enterprise/server/routes/integration/slack.py+++ b/enterprise/server/routes/integration/slack.py@@ -39,7 +39,10 @@ from storage.slack_team_store import SlackTeamStorefrom storage.slack_user import SlackUserfrom storage.user_store import UserStore-from openhands.integrations.service_types import ProviderTimeoutError, ProviderType+from openhands.app_server.integrations.service_types import (+ ProviderTimeoutError,+ ProviderType,+)from openhands.server.shared import config, siosignature_verifier = SignatureVerifier(signing_secret=SLACK_SIGNING_SECRET)diff --git a/enterprise/server/routes/users_v1.py b/enterprise/server/routes/users_v1.pyindex daba59a8ed..9be80de38c 100644--- a/enterprise/server/routes/users_v1.py+++ b/enterprise/server/routes/users_v1.py@@ -17,12 +17,12 @@ from openhands.app_server.config import (depends_user_context,resolve_provider_llm_base_url,)+from openhands.app_server.integrations.provider import ProviderHandler+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.sandbox.session_auth import validate_session_key_ownershipfrom openhands.app_server.user.auth_user_context import AuthUserContextfrom openhands.app_server.user.user_context import UserContextfrom openhands.app_server.utils.dependencies import get_dependencies-from openhands.integrations.provider import ProviderHandler-from openhands.integrations.service_types import ProviderType_logger = logging.getLogger(__name__)diff --git a/enterprise/server/services/automation_event_service.py b/enterprise/server/services/automation_event_service.pyindex 36f1a32dab..9279aa7a6f 100644--- a/enterprise/server/services/automation_event_service.py+++ b/enterprise/server/services/automation_event_service.py@@ -35,8 +35,8 @@ from server.auth.constants import ()from server.auth.token_manager import TokenManager+from openhands.app_server.integrations.provider import ProviderTypefrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.provider import ProviderTypefrom openhands.server.shared import sio# Cache TTL constantsdiff --git a/enterprise/server/sharing/shared_conversation_models.py b/enterprise/server/sharing/shared_conversation_models.pyindex fefaf04613..fd961004fa 100644--- a/enterprise/server/sharing/shared_conversation_models.py+++ b/enterprise/server/sharing/shared_conversation_models.py@@ -1,7 +1,7 @@from datetime import datetime# Simplified imports to avoid dependency chain issues-# from openhands.integrations.service_types import ProviderType+# from openhands.app_server.integrations.service_types import ProviderType# from openhands.sdk.llm import MetricsSnapshot# from openhands.app_server.app_conversation.app_conversation_models import ConversationTrigger# For now, use Any to avoid import issuesdiff --git a/enterprise/server/sharing/sql_shared_conversation_info_service.py b/enterprise/server/sharing/sql_shared_conversation_info_service.pyindex 737d80aa02..8a20a04cb1 100644--- a/enterprise/server/sharing/sql_shared_conversation_info_service.py+++ b/enterprise/server/sharing/sql_shared_conversation_info_service.py@@ -30,8 +30,8 @@ from openhands.agent_server.utils import utc_nowfrom openhands.app_server.app_conversation.sql_app_conversation_info_service import (StoredConversationMetadata,)+from openhands.app_server.integrations.provider import ProviderTypefrom openhands.app_server.services.injector import InjectorState-from openhands.integrations.provider import ProviderTypefrom openhands.sdk.llm import MetricsSnapshot, TokenUsagelogger = logging.getLogger(__name__)diff --git a/enterprise/storage/auth_token_store.py b/enterprise/storage/auth_token_store.pyindex 11ad668587..e34e462657 100644--- a/enterprise/storage/auth_token_store.py+++ b/enterprise/storage/auth_token_store.py@@ -10,8 +10,8 @@ from sqlalchemy.exc import OperationalErrorfrom storage.auth_tokens import AuthTokensfrom storage.database import a_session_maker+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.service_types import ProviderType# Time buffer (in seconds) before actual expiration to consider token expired# This ensures tokens are refreshed before they actually expire. Thediff --git a/enterprise/storage/openhands_pr_store.py b/enterprise/storage/openhands_pr_store.pyindex 2bc3ad661f..1ff6012dec 100644--- a/enterprise/storage/openhands_pr_store.py+++ b/enterprise/storage/openhands_pr_store.py@@ -6,8 +6,8 @@ from sqlalchemy import and_, desc, selectfrom storage.database import a_session_makerfrom storage.openhands_pr import OpenhandsPR+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.service_types import ProviderTypeclass OpenhandsPRStore:diff --git a/enterprise/storage/proactive_conversation_store.py b/enterprise/storage/proactive_conversation_store.pyindex a3942fc9ab..84a8e1f8c2 100644--- a/enterprise/storage/proactive_conversation_store.py+++ b/enterprise/storage/proactive_conversation_store.py@@ -13,8 +13,8 @@ from sqlalchemy import and_, delete, select, updatefrom storage.database import a_session_makerfrom storage.proactive_convos import ProactiveConversation+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.service_types import ProviderType@dataclassdiff --git a/enterprise/sync/install_gitlab_webhooks.py b/enterprise/sync/install_gitlab_webhooks.pyindex bf1f9f7f42..8fa2a02d93 100644--- a/enterprise/sync/install_gitlab_webhooks.py+++ b/enterprise/sync/install_gitlab_webhooks.py@@ -15,8 +15,8 @@ from storage.database import a_session_makerfrom storage.gitlab_webhook import GitlabWebhook, WebhookStatusfrom storage.gitlab_webhook_store import GitlabWebhookStore+from openhands.app_server.integrations.gitlab.gitlab_service import GitLabServiceImplfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.gitlab.gitlab_service import GitLabServiceImplif TYPE_CHECKING:from integrations.gitlab.gitlab_service import SaaSGitLabServicediff --git a/enterprise/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_service.py b/enterprise/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_service.pyindex 935c3ef40c..3402bcc80d 100644--- a/enterprise/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_service.py+++ b/enterprise/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_service.py@@ -34,7 +34,7 @@ class TestSaaSBitbucketDCServiceInit:def test_refresh_flag_is_true(self):# self.refresh = True is required so the base class BitbucketDCService# retries the request with a refreshed token on 401 responses.- # See openhands/integrations/bitbucket_data_center/service/base.py,+ # See openhands/app_server/integrations/bitbucket_data_center/service/base.py,# which checks `if self.refresh` before attempting the retry.service = SaaSBitbucketDCService()assert service.refresh is Truediff --git a/enterprise/tests/unit/integrations/github/test_github_view_v1_initial_user_message.py b/enterprise/tests/unit/integrations/github/test_github_view_v1_initial_user_message.pyindex c0485340cc..6b0e6feee2 100644--- a/enterprise/tests/unit/integrations/github/test_github_view_v1_initial_user_message.py+++ b/enterprise/tests/unit/integrations/github/test_github_view_v1_initial_user_message.py@@ -24,7 +24,10 @@ def jinja_env() -> Environment:repo_root = Path(__file__).resolve().parents[5]return Environment(loader=FileSystemLoader(- str(repo_root / 'openhands/integrations/templates/resolver/github')+ str(+ repo_root+ / 'openhands/app_server/integrations/templates/resolver/github'+ )))diff --git a/enterprise/tests/unit/integrations/jira/conftest.py b/enterprise/tests/unit/integrations/jira/conftest.pyindex e4019e5331..3e1d0cf9aa 100644--- a/enterprise/tests/unit/integrations/jira/conftest.py+++ b/enterprise/tests/unit/integrations/jira/conftest.py@@ -18,7 +18,7 @@ from storage.jira_conversation import JiraConversationfrom storage.jira_user import JiraUserfrom storage.jira_workspace import JiraWorkspace-from openhands.integrations.service_types import ProviderType, Repository+from openhands.app_server.integrations.service_types import ProviderType, Repositoryfrom openhands.server.user_auth.user_auth import UserAuthdiff --git a/enterprise/tests/unit/integrations/jira_dc/conftest.py b/enterprise/tests/unit/integrations/jira_dc/conftest.pyindex 4ccc6be636..60f4158ef1 100644--- a/enterprise/tests/unit/integrations/jira_dc/conftest.py+++ b/enterprise/tests/unit/integrations/jira_dc/conftest.py@@ -16,7 +16,7 @@ from storage.jira_dc_conversation import JiraDcConversationfrom storage.jira_dc_user import JiraDcUserfrom storage.jira_dc_workspace import JiraDcWorkspace-from openhands.integrations.service_types import ProviderType, Repository+from openhands.app_server.integrations.service_types import ProviderType, Repositoryfrom openhands.server.user_auth.user_auth import UserAuthdiff --git a/enterprise/tests/unit/integrations/jira_dc/test_jira_dc_manager.py b/enterprise/tests/unit/integrations/jira_dc/test_jira_dc_manager.pyindex 7b68118223..b34a24820d 100644--- a/enterprise/tests/unit/integrations/jira_dc/test_jira_dc_manager.py+++ b/enterprise/tests/unit/integrations/jira_dc/test_jira_dc_manager.py@@ -17,7 +17,7 @@ from integrations.jira_dc.jira_dc_view import ()from integrations.models import Message, SourceType-from openhands.integrations.service_types import ProviderType, Repository+from openhands.app_server.integrations.service_types import ProviderType, Repositoryfrom openhands.server.types import (LLMAuthenticationError,MissingSettingsError,diff --git a/enterprise/tests/unit/integrations/test_resolver_context.py b/enterprise/tests/unit/integrations/test_resolver_context.pyindex 1a1bb11c63..5aed7fc42a 100644--- a/enterprise/tests/unit/integrations/test_resolver_context.py+++ b/enterprise/tests/unit/integrations/test_resolver_context.py@@ -10,11 +10,11 @@ import pytestfrom pydantic import SecretStrfrom enterprise.integrations.resolver_context import ResolverUserContext-from openhands.app_server.secrets.secrets_models import Secrets# Import the real classes we want to test-from openhands.integrations.provider import CustomSecret, ProviderToken-from openhands.integrations.service_types import ProviderType+from openhands.app_server.integrations.provider import CustomSecret, ProviderToken+from openhands.app_server.integrations.service_types import ProviderType+from openhands.app_server.secrets.secrets_models import Secrets# Import the SDK types we need for testingfrom openhands.sdk.secret import SecretSource, StaticSecret@@ -344,7 +344,7 @@ async def test_get_provider_handler_creates_handler_with_correct_params(handler = await resolver_context._get_provider_handler()# Assert- from openhands.integrations.provider import ProviderHandler+ from openhands.app_server.integrations.provider import ProviderHandlerassert isinstance(handler, ProviderHandler)assert handler.provider_tokens == provider_tokensdiff --git a/enterprise/tests/unit/server/services/test_automation_event_service.py b/enterprise/tests/unit/server/services/test_automation_event_service.pyindex 53c57ffdcd..b08be34da7 100644--- a/enterprise/tests/unit/server/services/test_automation_event_service.py+++ b/enterprise/tests/unit/server/services/test_automation_event_service.py@@ -15,7 +15,7 @@ from unittest.mock import AsyncMock, MagicMock, patchimport pytest-from openhands.integrations.service_types import ProviderType+from openhands.app_server.integrations.service_types import ProviderType# Default patches for constantsCONSTANT_PATCHES = {diff --git a/enterprise/tests/unit/storage/test_auth_token_store.py b/enterprise/tests/unit/storage/test_auth_token_store.pyindex d3b884abe8..c6ed61eeea 100644--- a/enterprise/tests/unit/storage/test_auth_token_store.py+++ b/enterprise/tests/unit/storage/test_auth_token_store.py@@ -15,7 +15,7 @@ from storage.auth_token_store import (from storage.auth_tokens import AuthTokensfrom storage.base import Base-from openhands.integrations.service_types import ProviderType+from openhands.app_server.integrations.service_types import ProviderType@pytest.fixturediff --git a/enterprise/tests/unit/storage/test_saas_sql_app_conversation_info_service.py b/enterprise/tests/unit/storage/test_saas_sql_app_conversation_info_service.pyindex ccbfef57e9..a2541fd987 100644--- a/enterprise/tests/unit/storage/test_saas_sql_app_conversation_info_service.py+++ b/enterprise/tests/unit/storage/test_saas_sql_app_conversation_info_service.py@@ -24,8 +24,8 @@ from openhands.app_server.app_conversation.app_conversation_models import (AppConversationInfo,ConversationTrigger,)+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.user.specifiy_user_context import SpecifyUserContext-from openhands.integrations.service_types import ProviderType# Test UUIDsUSER1_ID = UUID('a1111111-1111-1111-1111-111111111111')diff --git a/enterprise/tests/unit/test_auth_routes.py b/enterprise/tests/unit/test_auth_routes.pyindex 5ebda80769..c5eb8f35ca 100644--- a/enterprise/tests/unit/test_auth_routes.py+++ b/enterprise/tests/unit/test_auth_routes.py@@ -19,7 +19,7 @@ from server.routes.auth import (set_response_cookie,)-from openhands.integrations.service_types import ProviderType+from openhands.app_server.integrations.service_types import ProviderTypedef create_mock_user_authorizer(success: bool = True, error_detail: str | None = None):diff --git a/enterprise/tests/unit/test_saas_secrets_store.py b/enterprise/tests/unit/test_saas_secrets_store.pyindex e609d90b9c..b62a563c40 100644--- a/enterprise/tests/unit/test_saas_secrets_store.py+++ b/enterprise/tests/unit/test_saas_secrets_store.py@@ -8,9 +8,9 @@ from pydantic import SecretStrfrom storage.saas_secrets_store import SaasSecretsStorefrom storage.stored_custom_secrets import StoredCustomSecrets+from openhands.app_server.integrations.provider import CustomSecretfrom openhands.app_server.secrets.secrets_models import Secretsfrom openhands.core.config.openhands_config import OpenHandsConfig-from openhands.integrations.provider import CustomSecret@pytest.fixturediff --git a/enterprise/tests/unit/test_saas_user_auth.py b/enterprise/tests/unit/test_saas_user_auth.pyindex 55951f9219..ea8eb5ec84 100644--- a/enterprise/tests/unit/test_saas_user_auth.py+++ b/enterprise/tests/unit/test_saas_user_auth.py@@ -22,8 +22,8 @@ from server.auth.saas_user_auth import (from storage.api_key_store import ApiKeyValidationResultfrom storage.user_authorization import UserAuthorizationType+from openhands.app_server.integrations.provider import ProviderToken, ProviderTypefrom openhands.app_server.secrets.secrets_models import Secrets-from openhands.integrations.provider import ProviderToken, ProviderType@pytest.fixturediff --git a/enterprise/tests/unit/test_sharing/test_sharing_shared_conversation_info_service.py b/enterprise/tests/unit/test_sharing/test_sharing_shared_conversation_info_service.pyindex 915ae4c48d..7ee829599c 100644--- a/enterprise/tests/unit/test_sharing/test_sharing_shared_conversation_info_service.py+++ b/enterprise/tests/unit/test_sharing/test_sharing_shared_conversation_info_service.py@@ -21,9 +21,9 @@ from openhands.app_server.app_conversation.app_conversation_models import (from openhands.app_server.app_conversation.sql_app_conversation_info_service import (SQLAppConversationInfoService,)+from openhands.app_server.integrations.provider import ProviderTypefrom openhands.app_server.user.specifiy_user_context import SpecifyUserContextfrom openhands.app_server.utils.sql_utils import Base-from openhands.integrations.provider import ProviderTypefrom openhands.sdk.llm import MetricsSnapshot, TokenUsagediff --git a/enterprise/tests/unit/test_slack_integration.py b/enterprise/tests/unit/test_slack_integration.pyindex 1403e287cb..2ca5564cc4 100644--- a/enterprise/tests/unit/test_slack_integration.py+++ b/enterprise/tests/unit/test_slack_integration.py@@ -11,7 +11,7 @@ from integrations.slack.slack_manager import (from integrations.slack.slack_view import SlackNewConversationViewfrom storage.slack_user import SlackUser-from openhands.integrations.service_types import (+from openhands.app_server.integrations.service_types import (ProviderTimeoutError,ProviderType,Repository,diff --git a/enterprise/tests/unit/test_token_manager_extended.py b/enterprise/tests/unit/test_token_manager_extended.pyindex 90b7df0a6b..542b17eb70 100644--- a/enterprise/tests/unit/test_token_manager_extended.py+++ b/enterprise/tests/unit/test_token_manager_extended.py@@ -3,7 +3,7 @@ from unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom server.auth.token_manager import TokenManager, create_encryption_utility-from openhands.integrations.service_types import ProviderType+from openhands.app_server.integrations.service_types import ProviderType@pytest.fixturediff --git a/enterprise/tests/unit/test_user_git_organizations.py b/enterprise/tests/unit/test_user_git_organizations.pyindex 07f250771b..f2f7e4e562 100644--- a/enterprise/tests/unit/test_user_git_organizations.py+++ b/enterprise/tests/unit/test_user_git_organizations.py@@ -12,9 +12,9 @@ import pytestfrom fastapi import HTTPException, statusfrom pydantic import SecretStr+from openhands.app_server.integrations.provider import ProviderToken+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.user.user_context import UserContext-from openhands.integrations.provider import ProviderToken-from openhands.integrations.service_types import ProviderTypedef _make_user_context(provider_tokens, user_id: str = 'user-1') -> UserContext:@@ -97,7 +97,7 @@ async def test_returns_organizations_for_supported_provider()with patch(- 'openhands.integrations.provider.ProviderHandler.get_service'+ 'openhands.app_server.integrations.provider.ProviderHandler.get_service') as mock_get_service:mock_service = mock_get_service.return_valuesetattr(mock_service, service_method, AsyncMock(return_value=service_return))diff --git a/openhands/app_server/app_conversation/app_conversation_models.py b/openhands/app_server/app_conversation/app_conversation_models.pyindex 88cc1f3699..f151ea8a7d 100644--- a/openhands/app_server/app_conversation/app_conversation_models.py+++ b/openhands/app_server/app_conversation/app_conversation_models.py@@ -15,11 +15,11 @@ from openhands.agent_server.utils import OpenHandsUUID, utc_nowfrom openhands.app_server.event_callback.event_callback_models import (EventCallbackProcessor,)+from openhands.app_server.integrations.service_types import ProviderType, SuggestedTaskfrom openhands.app_server.sandbox.sandbox_models import SandboxStatus# Import from new location and re-export for backward compatibilityfrom openhands.app_server.settings.settings_models import SandboxGroupingStrategy-from openhands.integrations.service_types import ProviderType, SuggestedTaskfrom openhands.sdk.conversation import ConversationExecutionStatusfrom openhands.sdk.llm import MetricsSnapshotfrom openhands.sdk.plugin import PluginSourcediff --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 132ded364f..ef8dd45eab 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@@ -70,6 +70,8 @@ from openhands.app_server.event_callback.event_callback_service import (from openhands.app_server.event_callback.set_title_callback_processor import (SetTitleCallbackProcessor,)+from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType+from openhands.app_server.integrations.service_types import SuggestedTaskfrom openhands.app_server.pending_messages.pending_message_service import (PendingMessageService,)@@ -92,8 +94,6 @@ from openhands.app_server.utils.llm_metadata import (get_llm_metadata,should_set_litellm_extra_body,)-from openhands.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType-from openhands.integrations.service_types import SuggestedTaskfrom openhands.sdk import Agent, AgentContext, LocalWorkspacefrom openhands.sdk.agent.acp_agent import ACPAgentfrom openhands.sdk.hooks import HookConfigdiff --git a/openhands/app_server/app_conversation/skill_loader.py b/openhands/app_server/app_conversation/skill_loader.pyindex b242ac7818..c61fedede8 100644--- a/openhands/app_server/app_conversation/skill_loader.py+++ b/openhands/app_server/app_conversation/skill_loader.py@@ -15,10 +15,10 @@ import loggingimport httpxfrom pydantic import BaseModel+from openhands.app_server.integrations.provider import ProviderType+from openhands.app_server.integrations.service_types import AuthenticationErrorfrom openhands.app_server.sandbox.sandbox_models import SandboxInfofrom openhands.app_server.user.user_context import UserContext-from openhands.integrations.provider import ProviderType-from openhands.integrations.service_types import AuthenticationErrorfrom openhands.sdk.context.skills import KeywordTrigger, Skill, TaskTrigger_logger = logging.getLogger(__name__)diff --git a/openhands/app_server/app_conversation/sql_app_conversation_info_service.py b/openhands/app_server/app_conversation/sql_app_conversation_info_service.pyindex 700dfc728a..9a14e6b153 100644--- a/openhands/app_server/app_conversation/sql_app_conversation_info_service.py+++ b/openhands/app_server/app_conversation/sql_app_conversation_info_service.py@@ -48,13 +48,13 @@ from openhands.app_server.app_conversation.app_conversation_models import (AppConversationSortOrder,ConversationTrigger,)+from openhands.app_server.integrations.provider import ProviderTypefrom openhands.app_server.services.injector import InjectorStatefrom openhands.app_server.user.user_context import UserContextfrom openhands.app_server.utils.sql_utils import (Base,create_json_type_decorator,)-from openhands.integrations.provider import ProviderTypefrom openhands.sdk import ConversationStatsfrom openhands.sdk.event import ConversationStateUpdateEventfrom openhands.sdk.llm import MetricsSnapshot, TokenUsagediff --git a/openhands/app_server/event_callback/webhook_router.py b/openhands/app_server/event_callback/webhook_router.pyindex dc77d605d2..18362fdff0 100644--- a/openhands/app_server/event_callback/webhook_router.py+++ b/openhands/app_server/event_callback/webhook_router.py@@ -34,6 +34,7 @@ from openhands.app_server.event_callback.event_callback_models import EventCallbfrom openhands.app_server.event_callback.set_title_callback_processor import (SetTitleCallbackProcessor,)+from openhands.app_server.integrations.provider import ProviderTypefrom openhands.app_server.sandbox.sandbox_models import SandboxInfofrom openhands.app_server.services.injector import InjectorStatefrom openhands.app_server.services.jwt_service import JwtService@@ -43,7 +44,6 @@ from openhands.app_server.user.specifiy_user_context import (USER_CONTEXT_ATTR,SpecifyUserContext,)-from openhands.integrations.provider import ProviderTypefrom openhands.sdk import ConversationExecutionStatus, Eventfrom openhands.sdk.event import ConversationStateUpdateEventfrom openhands.server.types import AppModediff --git a/openhands/app_server/git/git_models.py b/openhands/app_server/git/git_models.pyindex 10dc9abdfd..21d03bd5c2 100644--- a/openhands/app_server/git/git_models.py+++ b/openhands/app_server/git/git_models.py@@ -4,7 +4,7 @@ from enum import StrEnumfrom pydantic import BaseModel-from openhands.integrations.service_types import (+from openhands.app_server.integrations.service_types import (Branch,Repository,SuggestedTask,diff --git a/openhands/app_server/git/git_router.py b/openhands/app_server/git/git_router.pyindex 932cc053cd..d580d6e8fb 100644--- a/openhands/app_server/git/git_router.py+++ b/openhands/app_server/git/git_router.py@@ -18,6 +18,13 @@ from openhands.app_server.git.git_models import (SortOrder,SuggestedTaskPage,)+from openhands.app_server.integrations.provider import ProviderHandler+from openhands.app_server.integrations.service_types import (+ Branch,+ ProviderType,+ Repository,+ SuggestedTask,+)from openhands.app_server.user.user_context import UserContextfrom openhands.app_server.utils.dependencies import get_dependenciesfrom openhands.app_server.utils.paging_utils import (@@ -25,16 +32,9 @@ from openhands.app_server.utils.paging_utils import (encode_page_id,paginate_results,)-from openhands.integrations.provider import ProviderHandler-from openhands.integrations.service_types import (- Branch,- ProviderType,- Repository,- SuggestedTask,-)if TYPE_CHECKING:- from openhands.integrations.provider import PROVIDER_TOKEN_TYPE+ from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPE# We use the get_dependencies method here to signal to the OpenAPI docs that this endpoint# is protected. The actual protection is provided by SetAuthCookieMiddlewarediff --git a/openhands/integrations/azure_devops/azure_devops_service.py b/openhands/app_server/integrations/azure_devops/azure_devops_service.pysimilarity index 92%rename from openhands/integrations/azure_devops/azure_devops_service.pyrename to openhands/app_server/integrations/azure_devops/azure_devops_service.pyindex e93bd650c9..766098463f 100644--- a/openhands/integrations/azure_devops/azure_devops_service.py+++ b/openhands/app_server/integrations/azure_devops/azure_devops_service.py@@ -4,22 +4,26 @@ from typing import Anyimport httpxfrom pydantic import SecretStr-from openhands.integrations.azure_devops.service.branches import (+from openhands.app_server.integrations.azure_devops.service.branches import (AzureDevOpsBranchesMixin,)-from openhands.integrations.azure_devops.service.features import (+from openhands.app_server.integrations.azure_devops.service.features import (AzureDevOpsFeaturesMixin,)-from openhands.integrations.azure_devops.service.prs import AzureDevOpsPRsMixin-from openhands.integrations.azure_devops.service.repos import AzureDevOpsReposMixin-from openhands.integrations.azure_devops.service.resolver import (+from openhands.app_server.integrations.azure_devops.service.prs import (+ AzureDevOpsPRsMixin,+)+from openhands.app_server.integrations.azure_devops.service.repos import (+ AzureDevOpsReposMixin,+)+from openhands.app_server.integrations.azure_devops.service.resolver import (AzureDevOpsResolverMixin,)-from openhands.integrations.azure_devops.service.work_items import (+from openhands.app_server.integrations.azure_devops.service.work_items import (AzureDevOpsWorkItemsMixin,)-from openhands.integrations.protocols.http_client import HTTPClient-from openhands.integrations.service_types import (+from openhands.app_server.integrations.protocols.http_client import HTTPClient+from openhands.app_server.integrations.service_types import (BaseGitService,GitService,ProviderType,@@ -242,7 +246,7 @@ class AzureDevOpsService(# Dynamic class loading to support custom implementations (e.g., SaaS)azure_devops_service_cls = os.environ.get('OPENHANDS_AZURE_DEVOPS_SERVICE_CLS',- 'openhands.integrations.azure_devops.azure_devops_service.AzureDevOpsService',+ 'openhands.app_server.integrations.azure_devops.azure_devops_service.AzureDevOpsService',)# Lazy loading to avoid circular importsdiff --git a/openhands/integrations/azure_devops/service/__init__.py b/openhands/app_server/integrations/azure_devops/service/__init__.pysimilarity index 100%rename from openhands/integrations/azure_devops/service/__init__.pyrename to openhands/app_server/integrations/azure_devops/service/__init__.pydiff --git a/openhands/integrations/azure_devops/service/base.py b/openhands/app_server/integrations/azure_devops/service/base.pysimilarity index 93%rename from openhands/integrations/azure_devops/service/base.pyrename to openhands/app_server/integrations/azure_devops/service/base.pyindex 438308b282..469734ade5 100644--- a/openhands/integrations/azure_devops/service/base.py+++ b/openhands/app_server/integrations/azure_devops/service/base.py@@ -4,8 +4,8 @@ from urllib.parse import quotefrom pydantic import SecretStr-from openhands.integrations.protocols.http_client import HTTPClient-from openhands.integrations.service_types import (+from openhands.app_server.integrations.protocols.http_client import HTTPClient+from openhands.app_server.integrations.service_types import (BaseGitService,RequestMethod,)diff --git a/openhands/integrations/azure_devops/service/branches.py b/openhands/app_server/integrations/azure_devops/service/branches.pysimilarity index 97%rename from openhands/integrations/azure_devops/service/branches.pyrename to openhands/app_server/integrations/azure_devops/service/branches.pyindex 84fbe3f7f0..83b89aea8b 100644--- a/openhands/integrations/azure_devops/service/branches.py+++ b/openhands/app_server/integrations/azure_devops/service/branches.py@@ -1,7 +1,12 @@"""Branch operations for Azure DevOps integration."""-from openhands.integrations.azure_devops.service.base import AzureDevOpsMixinBase-from openhands.integrations.service_types import Branch, PaginatedBranchesResponse+from openhands.app_server.integrations.azure_devops.service.base import (+ AzureDevOpsMixinBase,+)+from openhands.app_server.integrations.service_types import (+ Branch,+ PaginatedBranchesResponse,+)class AzureDevOpsBranchesMixin(AzureDevOpsMixinBase):diff --git a/openhands/integrations/azure_devops/service/features.py b/openhands/app_server/integrations/azure_devops/service/features.pysimilarity index 97%rename from openhands/integrations/azure_devops/service/features.pyrename to openhands/app_server/integrations/azure_devops/service/features.pyindex 544c2a5c51..c9b9762f96 100644--- a/openhands/integrations/azure_devops/service/features.py+++ b/openhands/app_server/integrations/azure_devops/service/features.py@@ -1,7 +1,9 @@"""Feature operations for Azure DevOps integration (microagents, suggested tasks, user)."""-from openhands.integrations.azure_devops.service.base import AzureDevOpsMixinBase-from openhands.integrations.service_types import (+from openhands.app_server.integrations.azure_devops.service.base import (+ AzureDevOpsMixinBase,+)+from openhands.app_server.integrations.service_types import (ProviderType,RequestMethod,SuggestedTask,diff --git a/openhands/integrations/azure_devops/service/prs.py b/openhands/app_server/integrations/azure_devops/service/prs.pysimilarity index 98%rename from openhands/integrations/azure_devops/service/prs.pyrename to openhands/app_server/integrations/azure_devops/service/prs.pyindex c4cfefe09c..6a2c37386d 100644--- a/openhands/integrations/azure_devops/service/prs.py+++ b/openhands/app_server/integrations/azure_devops/service/prs.py@@ -2,9 +2,11 @@from datetime import datetime+from openhands.app_server.integrations.azure_devops.service.base import (+ AzureDevOpsMixinBase,+)+from openhands.app_server.integrations.service_types import Comment, RequestMethodfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.azure_devops.service.base import AzureDevOpsMixinBase-from openhands.integrations.service_types import Comment, RequestMethodclass AzureDevOpsPRsMixin(AzureDevOpsMixinBase):diff --git a/openhands/integrations/azure_devops/service/repos.py b/openhands/app_server/integrations/azure_devops/service/repos.pysimilarity index 97%rename from openhands/integrations/azure_devops/service/repos.pyrename to openhands/app_server/integrations/azure_devops/service/repos.pyindex 53efc324d1..de50c1b016 100644--- a/openhands/integrations/azure_devops/service/repos.py+++ b/openhands/app_server/integrations/azure_devops/service/repos.py@@ -1,7 +1,9 @@"""Repository operations for Azure DevOps integration."""-from openhands.integrations.azure_devops.service.base import AzureDevOpsMixinBase-from openhands.integrations.service_types import ProviderType, Repository+from openhands.app_server.integrations.azure_devops.service.base import (+ AzureDevOpsMixinBase,+)+from openhands.app_server.integrations.service_types import ProviderType, Repositoryfrom openhands.server.types import AppModediff --git a/openhands/integrations/azure_devops/service/resolver.py b/openhands/app_server/integrations/azure_devops/service/resolver.pysimilarity index 97%rename from openhands/integrations/azure_devops/service/resolver.pyrename to openhands/app_server/integrations/azure_devops/service/resolver.pyindex 10bfeaa4b6..49fc2b6bd8 100644--- a/openhands/integrations/azure_devops/service/resolver.py+++ b/openhands/app_server/integrations/azure_devops/service/resolver.py@@ -1,8 +1,10 @@from datetime import datetime+from openhands.app_server.integrations.azure_devops.service.base import (+ AzureDevOpsMixinBase,+)+from openhands.app_server.integrations.service_types import Commentfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.azure_devops.service.base import AzureDevOpsMixinBase-from openhands.integrations.service_types import Commentclass AzureDevOpsResolverMixin(AzureDevOpsMixinBase):diff --git a/openhands/integrations/azure_devops/service/work_items.py b/openhands/app_server/integrations/azure_devops/service/work_items.pysimilarity index 96%rename from openhands/integrations/azure_devops/service/work_items.pyrename to openhands/app_server/integrations/azure_devops/service/work_items.pyindex fc4a6b6eff..966c950756 100644--- a/openhands/integrations/azure_devops/service/work_items.py+++ b/openhands/app_server/integrations/azure_devops/service/work_items.py@@ -2,9 +2,11 @@from datetime import datetime+from openhands.app_server.integrations.azure_devops.service.base import (+ AzureDevOpsMixinBase,+)+from openhands.app_server.integrations.service_types import Comment, RequestMethodfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.azure_devops.service.base import AzureDevOpsMixinBase-from openhands.integrations.service_types import Comment, RequestMethodclass AzureDevOpsWorkItemsMixin(AzureDevOpsMixinBase):diff --git a/openhands/integrations/bitbucket/bitbucket_service.py b/openhands/app_server/integrations/bitbucket/bitbucket_service.pysimilarity index 92%rename from openhands/integrations/bitbucket/bitbucket_service.pyrename to openhands/app_server/integrations/bitbucket/bitbucket_service.pyindex f36beb270a..49b132ee4e 100644--- a/openhands/integrations/bitbucket/bitbucket_service.py+++ b/openhands/app_server/integrations/bitbucket/bitbucket_service.py@@ -2,12 +2,12 @@ import osfrom pydantic import SecretStr-from openhands.integrations.bitbucket.service import (+from openhands.app_server.integrations.bitbucket.service import (BitBucketBranchesMixin,BitBucketPRsMixin,BitBucketReposMixin,)-from openhands.integrations.service_types import (+from openhands.app_server.integrations.service_types import (GitService,InstallationsService,ProviderType,@@ -60,7 +60,7 @@ class BitBucketService(bitbucket_service_cls = os.environ.get('OPENHANDS_BITBUCKET_SERVICE_CLS',- 'openhands.integrations.bitbucket.bitbucket_service.BitBucketService',+ 'openhands.app_server.integrations.bitbucket.bitbucket_service.BitBucketService',)# Lazy loading to avoid circular importsdiff --git a/openhands/integrations/bitbucket/service/__init__.py b/openhands/app_server/integrations/bitbucket/service/__init__.pysimilarity index 100%rename from openhands/integrations/bitbucket/service/__init__.pyrename to openhands/app_server/integrations/bitbucket/service/__init__.pydiff --git a/openhands/integrations/bitbucket/service/base.py b/openhands/app_server/integrations/bitbucket/service/base.pysimilarity index 98%rename from openhands/integrations/bitbucket/service/base.pyrename to openhands/app_server/integrations/bitbucket/service/base.pyindex 81eb0a98ad..61ff109793 100644--- a/openhands/integrations/bitbucket/service/base.py+++ b/openhands/app_server/integrations/bitbucket/service/base.py@@ -4,9 +4,8 @@ from typing import Anyimport httpxfrom pydantic import SecretStr-from openhands.core.logger import openhands_logger as logger-from openhands.integrations.protocols.http_client import HTTPClient-from openhands.integrations.service_types import (+from openhands.app_server.integrations.protocols.http_client import HTTPClient+from openhands.app_server.integrations.service_types import (BaseGitService,OwnerType,ProviderType,@@ -14,6 +13,7 @@ from openhands.integrations.service_types import (RequestMethod,User,)+from openhands.core.logger import openhands_logger as loggerfrom openhands.utils.http_session import httpx_verify_optiondiff --git a/openhands/integrations/bitbucket/service/branches.py b/openhands/app_server/integrations/bitbucket/service/branches.pysimilarity index 95%rename from openhands/integrations/bitbucket/service/branches.pyrename to openhands/app_server/integrations/bitbucket/service/branches.pyindex 4d04cf8ca9..ead7a51238 100644--- a/openhands/integrations/bitbucket/service/branches.py+++ b/openhands/app_server/integrations/bitbucket/service/branches.py@@ -1,5 +1,8 @@-from openhands.integrations.bitbucket.service.base import BitBucketMixinBase-from openhands.integrations.service_types import Branch, PaginatedBranchesResponse+from openhands.app_server.integrations.bitbucket.service.base import BitBucketMixinBase+from openhands.app_server.integrations.service_types import (+ Branch,+ PaginatedBranchesResponse,+)class BitBucketBranchesMixin(BitBucketMixinBase):diff --git a/openhands/integrations/bitbucket/service/prs.py b/openhands/app_server/integrations/bitbucket/service/prs.pysimilarity index 95%rename from openhands/integrations/bitbucket/service/prs.pyrename to openhands/app_server/integrations/bitbucket/service/prs.pyindex 89e9d22dde..d1065fe4fa 100644--- a/openhands/integrations/bitbucket/service/prs.py+++ b/openhands/app_server/integrations/bitbucket/service/prs.py@@ -1,6 +1,6 @@+from openhands.app_server.integrations.bitbucket.service.base import BitBucketMixinBase+from openhands.app_server.integrations.service_types import RequestMethodfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.bitbucket.service.base import BitBucketMixinBase-from openhands.integrations.service_types import RequestMethodclass BitBucketPRsMixin(BitBucketMixinBase):diff --git a/openhands/integrations/bitbucket/service/repos.py b/openhands/app_server/integrations/bitbucket/service/repos.pysimilarity index 98%rename from openhands/integrations/bitbucket/service/repos.pyrename to openhands/app_server/integrations/bitbucket/service/repos.pyindex 5b29742b8d..0c0bba9667 100644--- a/openhands/integrations/bitbucket/service/repos.py+++ b/openhands/app_server/integrations/bitbucket/service/repos.py@@ -2,8 +2,8 @@ import refrom typing import Anyfrom urllib.parse import urlparse-from openhands.integrations.bitbucket.service.base import BitBucketMixinBase-from openhands.integrations.service_types import Repository, SuggestedTask+from openhands.app_server.integrations.bitbucket.service.base import BitBucketMixinBase+from openhands.app_server.integrations.service_types import Repository, SuggestedTaskfrom openhands.server.types import AppModediff --git a/openhands/integrations/bitbucket_data_center/bitbucket_dc_service.py b/openhands/app_server/integrations/bitbucket_data_center/bitbucket_dc_service.pysimilarity index 93%rename from openhands/integrations/bitbucket_data_center/bitbucket_dc_service.pyrename to openhands/app_server/integrations/bitbucket_data_center/bitbucket_dc_service.pyindex d8d30b3389..404bb9c8f6 100644--- a/openhands/integrations/bitbucket_data_center/bitbucket_dc_service.py+++ b/openhands/app_server/integrations/bitbucket_data_center/bitbucket_dc_service.py@@ -2,13 +2,13 @@ import osfrom pydantic import SecretStr-from openhands.integrations.bitbucket_data_center.service import (+from openhands.app_server.integrations.bitbucket_data_center.service import (BitbucketDCBranchesMixin,BitbucketDCPRsMixin,BitbucketDCReposMixin,BitbucketDCResolverMixin,)-from openhands.integrations.service_types import (+from openhands.app_server.integrations.service_types import (GitService,InstallationsService,ProviderType,@@ -72,7 +72,7 @@ class BitbucketDCService(bitbucket_dc_service_cls = os.environ.get('OPENHANDS_BITBUCKET_DATA_CENTER_SERVICE_CLS',- 'openhands.integrations.bitbucket_data_center.bitbucket_dc_service.BitbucketDCService',+ 'openhands.app_server.integrations.bitbucket_data_center.bitbucket_dc_service.BitbucketDCService',)# Lazy loading to avoid circular importsdiff --git a/openhands/integrations/bitbucket_data_center/service/__init__.py b/openhands/app_server/integrations/bitbucket_data_center/service/__init__.pysimilarity index 100%rename from openhands/integrations/bitbucket_data_center/service/__init__.pyrename to openhands/app_server/integrations/bitbucket_data_center/service/__init__.pydiff --git a/openhands/integrations/bitbucket_data_center/service/base.py b/openhands/app_server/integrations/bitbucket_data_center/service/base.pysimilarity index 98%rename from openhands/integrations/bitbucket_data_center/service/base.pyrename to openhands/app_server/integrations/bitbucket_data_center/service/base.pyindex b90201b37b..7270a6357b 100644--- a/openhands/integrations/bitbucket_data_center/service/base.py+++ b/openhands/app_server/integrations/bitbucket_data_center/service/base.py@@ -4,9 +4,8 @@ from typing import Anyimport httpxfrom pydantic import SecretStr-from openhands.core.logger import openhands_logger as logger-from openhands.integrations.protocols.http_client import HTTPClient-from openhands.integrations.service_types import (+from openhands.app_server.integrations.protocols.http_client import HTTPClient+from openhands.app_server.integrations.service_types import (AuthenticationError,BaseGitService,OwnerType,@@ -15,6 +14,7 @@ from openhands.integrations.service_types import (RequestMethod,User,)+from openhands.core.logger import openhands_logger as loggerfrom openhands.utils.http_session import httpx_verify_optiondiff --git a/openhands/integrations/bitbucket_data_center/service/branches.py b/openhands/app_server/integrations/bitbucket_data_center/service/branches.pysimilarity index 96%rename from openhands/integrations/bitbucket_data_center/service/branches.pyrename to openhands/app_server/integrations/bitbucket_data_center/service/branches.pyindex bbf4be1996..7a96438caf 100644--- a/openhands/integrations/bitbucket_data_center/service/branches.py+++ b/openhands/app_server/integrations/bitbucket_data_center/service/branches.py@@ -1,9 +1,12 @@from datetime import datetime, timezone-from openhands.integrations.bitbucket_data_center.service.base import (+from openhands.app_server.integrations.bitbucket_data_center.service.base import (BitbucketDCMixinBase,)-from openhands.integrations.service_types import Branch, PaginatedBranchesResponse+from openhands.app_server.integrations.service_types import (+ Branch,+ PaginatedBranchesResponse,+)class BitbucketDCBranchesMixin(BitbucketDCMixinBase):diff --git a/openhands/integrations/bitbucket_data_center/service/prs.py b/openhands/app_server/integrations/bitbucket_data_center/service/prs.pysimilarity index 96%rename from openhands/integrations/bitbucket_data_center/service/prs.pyrename to openhands/app_server/integrations/bitbucket_data_center/service/prs.pyindex 14844eb4f2..49792488c5 100644--- a/openhands/integrations/bitbucket_data_center/service/prs.py+++ b/openhands/app_server/integrations/bitbucket_data_center/service/prs.py@@ -1,10 +1,10 @@from typing import Any-from openhands.core.logger import openhands_logger as logger-from openhands.integrations.bitbucket_data_center.service.base import (+from openhands.app_server.integrations.bitbucket_data_center.service.base import (BitbucketDCMixinBase,)-from openhands.integrations.service_types import RequestMethod+from openhands.app_server.integrations.service_types import RequestMethod+from openhands.core.logger import openhands_logger as loggerclass BitbucketDCPRsMixin(BitbucketDCMixinBase):diff --git a/openhands/integrations/bitbucket_data_center/service/repos.py b/openhands/app_server/integrations/bitbucket_data_center/service/repos.pysimilarity index 97%rename from openhands/integrations/bitbucket_data_center/service/repos.pyrename to openhands/app_server/integrations/bitbucket_data_center/service/repos.pyindex 5a587cd81e..c1d58371f1 100644--- a/openhands/integrations/bitbucket_data_center/service/repos.py+++ b/openhands/app_server/integrations/bitbucket_data_center/service/repos.py@@ -1,10 +1,10 @@from typing import Anyfrom urllib.parse import urlparse-from openhands.integrations.bitbucket_data_center.service.base import (+from openhands.app_server.integrations.bitbucket_data_center.service.base import (BitbucketDCMixinBase,)-from openhands.integrations.service_types import Repository, SuggestedTask+from openhands.app_server.integrations.service_types import Repository, SuggestedTaskfrom openhands.server.types import AppModediff --git a/openhands/integrations/bitbucket_data_center/service/resolver.py b/openhands/app_server/integrations/bitbucket_data_center/service/resolver.pysimilarity index 96%rename from openhands/integrations/bitbucket_data_center/service/resolver.pyrename to openhands/app_server/integrations/bitbucket_data_center/service/resolver.pyindex 1559eba191..03600b00be 100644--- a/openhands/integrations/bitbucket_data_center/service/resolver.py+++ b/openhands/app_server/integrations/bitbucket_data_center/service/resolver.py@@ -1,9 +1,9 @@from datetime import datetime, timezone-from openhands.integrations.bitbucket_data_center.service.base import (+from openhands.app_server.integrations.bitbucket_data_center.service.base import (BitbucketDCMixinBase,)-from openhands.integrations.service_types import Comment+from openhands.app_server.integrations.service_types import Commentclass BitbucketDCResolverMixin(BitbucketDCMixinBase):diff --git a/openhands/integrations/forgejo/__init__.py b/openhands/app_server/integrations/forgejo/__init__.pysimilarity index 100%rename from openhands/integrations/forgejo/__init__.pyrename to openhands/app_server/integrations/forgejo/__init__.pydiff --git a/openhands/integrations/forgejo/forgejo_service.py b/openhands/app_server/integrations/forgejo/forgejo_service.pysimilarity index 86%rename from openhands/integrations/forgejo/forgejo_service.pyrename to openhands/app_server/integrations/forgejo/forgejo_service.pyindex d34e27ac2c..6f32d8e04d 100644--- a/openhands/integrations/forgejo/forgejo_service.py+++ b/openhands/app_server/integrations/forgejo/forgejo_service.py@@ -4,7 +4,7 @@ import osfrom pydantic import SecretStr-from openhands.integrations.forgejo.service import (+from openhands.app_server.integrations.forgejo.service import (ForgejoBranchesMixin,ForgejoFeaturesMixin,ForgejoMixinBase,@@ -12,7 +12,7 @@ from openhands.integrations.forgejo.service import (ForgejoReposMixin,ForgejoResolverMixin,)-from openhands.integrations.service_types import GitService+from openhands.app_server.integrations.service_types import GitServicefrom openhands.utils.import_utils import get_impl@@ -51,6 +51,6 @@ class ForgejoService(forgejo_service_cls = os.environ.get('OPENHANDS_FORGEJO_SERVICE_CLS',- 'openhands.integrations.forgejo.forgejo_service.ForgejoService',+ 'openhands.app_server.integrations.forgejo.forgejo_service.ForgejoService',)ForgejoServiceImpl = get_impl(ForgejoService, forgejo_service_cls)diff --git a/openhands/integrations/forgejo/service/__init__.py b/openhands/app_server/integrations/forgejo/service/__init__.pysimilarity index 100%rename from openhands/integrations/forgejo/service/__init__.pyrename to openhands/app_server/integrations/forgejo/service/__init__.pydiff --git a/openhands/integrations/forgejo/service/base.py b/openhands/app_server/integrations/forgejo/service/base.pysimilarity index 98%rename from openhands/integrations/forgejo/service/base.pyrename to openhands/app_server/integrations/forgejo/service/base.pyindex db995d08d0..bfd422c58c 100644--- a/openhands/integrations/forgejo/service/base.py+++ b/openhands/app_server/integrations/forgejo/service/base.py@@ -7,9 +7,8 @@ from urllib.parse import urlparseimport httpxfrom pydantic import SecretStr-from openhands.core.logger import openhands_logger as logger-from openhands.integrations.protocols.http_client import HTTPClient-from openhands.integrations.service_types import (+from openhands.app_server.integrations.protocols.http_client import HTTPClient+from openhands.app_server.integrations.service_types import (BaseGitService,OwnerType,ProviderType,@@ -18,6 +17,7 @@ from openhands.integrations.service_types import (UnknownException,User,)+from openhands.core.logger import openhands_logger as loggerfrom openhands.utils.http_session import httpx_verify_optiondiff --git a/openhands/integrations/forgejo/service/branches.py b/openhands/app_server/integrations/forgejo/service/branches.pysimilarity index 92%rename from openhands/integrations/forgejo/service/branches.pyrename to openhands/app_server/integrations/forgejo/service/branches.pyindex c163212dea..f1328b1ef0 100644--- a/openhands/integrations/forgejo/service/branches.py+++ b/openhands/app_server/integrations/forgejo/service/branches.py@@ -1,7 +1,10 @@from __future__ import annotations-from openhands.integrations.forgejo.service.base import ForgejoMixinBase-from openhands.integrations.service_types import Branch, PaginatedBranchesResponse+from openhands.app_server.integrations.forgejo.service.base import ForgejoMixinBase+from openhands.app_server.integrations.service_types import (+ Branch,+ PaginatedBranchesResponse,+)class ForgejoBranchesMixin(ForgejoMixinBase):diff --git a/openhands/integrations/forgejo/service/features.py b/openhands/app_server/integrations/forgejo/service/features.pysimilarity index 66%rename from openhands/integrations/forgejo/service/features.pyrename to openhands/app_server/integrations/forgejo/service/features.pyindex d11496a6e4..6795671ca7 100644--- a/openhands/integrations/forgejo/service/features.py+++ b/openhands/app_server/integrations/forgejo/service/features.py@@ -1,7 +1,7 @@from __future__ import annotations-from openhands.integrations.forgejo.service.base import ForgejoMixinBase-from openhands.integrations.service_types import SuggestedTask+from openhands.app_server.integrations.forgejo.service.base import ForgejoMixinBase+from openhands.app_server.integrations.service_types import SuggestedTaskclass ForgejoFeaturesMixin(ForgejoMixinBase):diff --git a/openhands/integrations/forgejo/service/prs.py b/openhands/app_server/integrations/forgejo/service/prs.pysimilarity index 93%rename from openhands/integrations/forgejo/service/prs.pyrename to openhands/app_server/integrations/forgejo/service/prs.pyindex 17d22ec5b0..4e23849ee7 100644--- a/openhands/integrations/forgejo/service/prs.py+++ b/openhands/app_server/integrations/forgejo/service/prs.py@@ -2,9 +2,12 @@ from __future__ import annotationsfrom typing import Any+from openhands.app_server.integrations.forgejo.service.base import ForgejoMixinBase+from openhands.app_server.integrations.service_types import (+ RequestMethod,+ UnknownException,+)from openhands.core.logger import openhands_logger as logger-from openhands.integrations.forgejo.service.base import ForgejoMixinBase-from openhands.integrations.service_types import RequestMethod, UnknownExceptionclass ForgejoPRsMixin(ForgejoMixinBase):diff --git a/openhands/integrations/forgejo/service/repos.py b/openhands/app_server/integrations/forgejo/service/repos.pysimilarity index 95%rename from openhands/integrations/forgejo/service/repos.pyrename to openhands/app_server/integrations/forgejo/service/repos.pyindex 10339514b0..03a7f7c7ea 100644--- a/openhands/integrations/forgejo/service/repos.py+++ b/openhands/app_server/integrations/forgejo/service/repos.py@@ -1,7 +1,7 @@from __future__ import annotations-from openhands.integrations.forgejo.service.base import ForgejoMixinBase-from openhands.integrations.service_types import Repository+from openhands.app_server.integrations.forgejo.service.base import ForgejoMixinBase+from openhands.app_server.integrations.service_types import Repositoryfrom openhands.server.types import AppModediff --git a/openhands/integrations/forgejo/service/resolver.py b/openhands/app_server/integrations/forgejo/service/resolver.pysimilarity index 95%rename from openhands/integrations/forgejo/service/resolver.pyrename to openhands/app_server/integrations/forgejo/service/resolver.pyindex f84104000e..a9b6377887 100644--- a/openhands/integrations/forgejo/service/resolver.py+++ b/openhands/app_server/integrations/forgejo/service/resolver.py@@ -2,8 +2,8 @@ from __future__ import annotationsfrom datetime import datetime-from openhands.integrations.forgejo.service.base import ForgejoMixinBase-from openhands.integrations.service_types import Comment+from openhands.app_server.integrations.forgejo.service.base import ForgejoMixinBase+from openhands.app_server.integrations.service_types import Commentclass ForgejoResolverMixin(ForgejoMixinBase):diff --git a/openhands/integrations/github/github_service.py b/openhands/app_server/integrations/github/github_service.pysimilarity index 93%rename from openhands/integrations/github/github_service.pyrename to openhands/app_server/integrations/github/github_service.pyindex c56940a0af..4c453efe91 100644--- a/openhands/integrations/github/github_service.py+++ b/openhands/app_server/integrations/github/github_service.py@@ -2,14 +2,14 @@ import osfrom pydantic import SecretStr-from openhands.integrations.github.service import (+from openhands.app_server.integrations.github.service import (GitHubBranchesMixin,GitHubFeaturesMixin,GitHubPRsMixin,GitHubReposMixin,GitHubResolverMixin,)-from openhands.integrations.service_types import (+from openhands.app_server.integrations.service_types import (BaseGitService,GitService,InstallationsService,@@ -73,7 +73,7 @@ class GitHubService(github_service_cls = os.environ.get('OPENHANDS_GITHUB_SERVICE_CLS',- 'openhands.integrations.github.github_service.GitHubService',+ 'openhands.app_server.integrations.github.github_service.GitHubService',)# Lazy loading to avoid circular importsdiff --git a/openhands/integrations/github/queries.py b/openhands/app_server/integrations/github/queries.pysimilarity index 100%rename from openhands/integrations/github/queries.pyrename to openhands/app_server/integrations/github/queries.pydiff --git a/openhands/integrations/github/service/__init__.py b/openhands/app_server/integrations/github/service/__init__.pysimilarity index 86%rename from openhands/integrations/github/service/__init__.pyrename to openhands/app_server/integrations/github/service/__init__.pyindex 3509f4056b..e2c0a0d803 100644--- a/openhands/integrations/github/service/__init__.py+++ b/openhands/app_server/integrations/github/service/__init__.py@@ -1,4 +1,4 @@-# openhands/integrations/github/service/__init__.py+# openhands/app_server/integrations/github/service/__init__.pyfrom .base import GitHubMixinBasefrom .branches_prs import GitHubBranchesMixindiff --git a/openhands/integrations/github/service/base.py b/openhands/app_server/integrations/github/service/base.pysimilarity index 97%rename from openhands/integrations/github/service/base.pyrename to openhands/app_server/integrations/github/service/base.pyindex 36bac4bfbd..bf8b834c31 100644--- a/openhands/integrations/github/service/base.py+++ b/openhands/app_server/integrations/github/service/base.py@@ -4,14 +4,14 @@ from typing import Any, castimport httpxfrom pydantic import SecretStr-from openhands.core.logger import openhands_logger as logger-from openhands.integrations.protocols.http_client import HTTPClient-from openhands.integrations.service_types import (+from openhands.app_server.integrations.protocols.http_client import HTTPClient+from openhands.app_server.integrations.service_types import (BaseGitService,RequestMethod,UnknownException,User,)+from openhands.core.logger import openhands_logger as loggerfrom openhands.utils.http_session import httpx_verify_optiondiff --git a/openhands/integrations/github/service/branches_prs.py b/openhands/app_server/integrations/github/service/branches_prs.pysimilarity index 95%rename from openhands/integrations/github/service/branches_prs.pyrename to openhands/app_server/integrations/github/service/branches_prs.pyindex 4437c33d41..4acd87d1c5 100644--- a/openhands/integrations/github/service/branches_prs.py+++ b/openhands/app_server/integrations/github/service/branches_prs.py@@ -1,9 +1,12 @@-from openhands.core.logger import openhands_logger as logger-from openhands.integrations.github.queries import (+from openhands.app_server.integrations.github.queries import (search_branches_graphql_query,)-from openhands.integrations.github.service.base import GitHubMixinBase-from openhands.integrations.service_types import Branch, PaginatedBranchesResponse+from openhands.app_server.integrations.github.service.base import GitHubMixinBase+from openhands.app_server.integrations.service_types import (+ Branch,+ PaginatedBranchesResponse,+)+from openhands.core.logger import openhands_logger as loggerclass GitHubBranchesMixin(GitHubMixinBase):diff --git a/openhands/integrations/github/service/features.py b/openhands/app_server/integrations/github/service/features.pysimilarity index 94%rename from openhands/integrations/github/service/features.pyrename to openhands/app_server/integrations/github/service/features.pyindex 9cbcb812f7..120f7ab109 100644--- a/openhands/integrations/github/service/features.py+++ b/openhands/app_server/integrations/github/service/features.py@@ -1,14 +1,14 @@-from openhands.core.logger import openhands_logger as logger-from openhands.integrations.github.queries import (+from openhands.app_server.integrations.github.queries import (suggested_task_issue_graphql_query,suggested_task_pr_graphql_query,)-from openhands.integrations.github.service.base import GitHubMixinBase-from openhands.integrations.service_types import (+from openhands.app_server.integrations.github.service.base import GitHubMixinBase+from openhands.app_server.integrations.service_types import (ProviderType,SuggestedTask,TaskType,)+from openhands.core.logger import openhands_logger as loggerclass GitHubFeaturesMixin(GitHubMixinBase):diff --git a/openhands/integrations/github/service/prs.py b/openhands/app_server/integrations/github/service/prs.pysimilarity index 96%rename from openhands/integrations/github/service/prs.pyrename to openhands/app_server/integrations/github/service/prs.pyindex 8192d69079..ef63008540 100644--- a/openhands/integrations/github/service/prs.py+++ b/openhands/app_server/integrations/github/service/prs.py@@ -1,6 +1,6 @@+from openhands.app_server.integrations.github.service.base import GitHubMixinBase+from openhands.app_server.integrations.service_types import RequestMethodfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.github.service.base import GitHubMixinBase-from openhands.integrations.service_types import RequestMethodclass GitHubPRsMixin(GitHubMixinBase):diff --git a/openhands/integrations/github/service/repos.py b/openhands/app_server/integrations/github/service/repos.pysimilarity index 98%rename from openhands/integrations/github/service/repos.pyrename to openhands/app_server/integrations/github/service/repos.pyindex 855eb08275..a5e4df3104 100644--- a/openhands/integrations/github/service/repos.py+++ b/openhands/app_server/integrations/github/service/repos.py@@ -1,8 +1,12 @@from datetime import datetime+from openhands.app_server.integrations.github.service.base import GitHubMixinBase+from openhands.app_server.integrations.service_types import (+ OwnerType,+ ProviderType,+ Repository,+)from openhands.core.logger import openhands_logger as logger-from openhands.integrations.github.service.base import GitHubMixinBase-from openhands.integrations.service_types import OwnerType, ProviderType, Repositoryfrom openhands.server.types import AppModediff --git a/openhands/integrations/github/service/resolver.py b/openhands/app_server/integrations/github/service/resolver.pysimilarity index 97%rename from openhands/integrations/github/service/resolver.pyrename to openhands/app_server/integrations/github/service/resolver.pyindex bda668053e..8cf4e9a274 100644--- a/openhands/integrations/github/service/resolver.py+++ b/openhands/app_server/integrations/github/service/resolver.py@@ -1,14 +1,14 @@from datetime import datetimefrom typing import Any-from openhands.core.logger import openhands_logger as logger-from openhands.integrations.github.queries import (+from openhands.app_server.integrations.github.queries import (get_review_threads_graphql_query,get_thread_comments_graphql_query,get_thread_from_comment_graphql_query,)-from openhands.integrations.github.service.base import GitHubMixinBase-from openhands.integrations.service_types import Comment+from openhands.app_server.integrations.github.service.base import GitHubMixinBase+from openhands.app_server.integrations.service_types import Comment+from openhands.core.logger import openhands_logger as loggerclass GitHubResolverMixin(GitHubMixinBase):diff --git a/openhands/integrations/gitlab/constants.py b/openhands/app_server/integrations/gitlab/constants.pysimilarity index 100%rename from openhands/integrations/gitlab/constants.pyrename to openhands/app_server/integrations/gitlab/constants.pydiff --git a/openhands/integrations/gitlab/gitlab_service.py b/openhands/app_server/integrations/gitlab/gitlab_service.pysimilarity index 92%rename from openhands/integrations/gitlab/gitlab_service.pyrename to openhands/app_server/integrations/gitlab/gitlab_service.pyindex 144737e280..1a34518f87 100644--- a/openhands/integrations/gitlab/gitlab_service.py+++ b/openhands/app_server/integrations/gitlab/gitlab_service.py@@ -2,15 +2,15 @@ import osfrom pydantic import SecretStr-from openhands.integrations.gitlab.constants import GITLAB_HOST-from openhands.integrations.gitlab.service import (+from openhands.app_server.integrations.gitlab.constants import GITLAB_HOST+from openhands.app_server.integrations.gitlab.service import (GitLabBranchesMixin,GitLabFeaturesMixin,GitLabPRsMixin,GitLabReposMixin,GitLabResolverMixin,)-from openhands.integrations.service_types import (+from openhands.app_server.integrations.service_types import (BaseGitService,GitService,ProviderType,@@ -78,7 +78,7 @@ class GitLabService(gitlab_service_cls = os.environ.get('OPENHANDS_GITLAB_SERVICE_CLS',- 'openhands.integrations.gitlab.gitlab_service.GitLabService',+ 'openhands.app_server.integrations.gitlab.gitlab_service.GitLabService',)# Lazy loading to avoid circular importsdiff --git a/openhands/integrations/gitlab/service/__init__.py b/openhands/app_server/integrations/gitlab/service/__init__.pysimilarity index 86%rename from openhands/integrations/gitlab/service/__init__.pyrename to openhands/app_server/integrations/gitlab/service/__init__.pyindex b90c66ed40..a2c5e66a1c 100644--- a/openhands/integrations/gitlab/service/__init__.py+++ b/openhands/app_server/integrations/gitlab/service/__init__.py@@ -1,4 +1,4 @@-# openhands/integrations/gitlab/service/__init__.py+# openhands/app_server/integrations/gitlab/service/__init__.pyfrom .base import GitLabMixinBasefrom .branches import GitLabBranchesMixindiff --git a/openhands/integrations/gitlab/service/base.py b/openhands/app_server/integrations/gitlab/service/base.pysimilarity index 97%rename from openhands/integrations/gitlab/service/base.pyrename to openhands/app_server/integrations/gitlab/service/base.pyindex fca1171942..ee0ad66a9d 100644--- a/openhands/integrations/gitlab/service/base.py+++ b/openhands/app_server/integrations/gitlab/service/base.py@@ -3,8 +3,8 @@ from typing import Anyimport httpxfrom pydantic import SecretStr-from openhands.integrations.protocols.http_client import HTTPClient-from openhands.integrations.service_types import (+from openhands.app_server.integrations.protocols.http_client import HTTPClient+from openhands.app_server.integrations.service_types import (BaseGitService,RequestMethod,UnknownException,diff --git a/openhands/integrations/gitlab/service/branches.py b/openhands/app_server/integrations/gitlab/service/branches.pysimilarity index 95%rename from openhands/integrations/gitlab/service/branches.pyrename to openhands/app_server/integrations/gitlab/service/branches.pyindex d4bc1d9e9d..7c5bb8fcb0 100644--- a/openhands/integrations/gitlab/service/branches.py+++ b/openhands/app_server/integrations/gitlab/service/branches.py@@ -1,5 +1,8 @@-from openhands.integrations.gitlab.service.base import GitLabMixinBase-from openhands.integrations.service_types import Branch, PaginatedBranchesResponse+from openhands.app_server.integrations.gitlab.service.base import GitLabMixinBase+from openhands.app_server.integrations.service_types import (+ Branch,+ PaginatedBranchesResponse,+)class GitLabBranchesMixin(GitLabMixinBase):diff --git a/openhands/integrations/gitlab/service/features.py b/openhands/app_server/integrations/gitlab/service/features.pysimilarity index 97%rename from openhands/integrations/gitlab/service/features.pyrename to openhands/app_server/integrations/gitlab/service/features.pyindex 142316f1b5..22e202a76b 100644--- a/openhands/integrations/gitlab/service/features.py+++ b/openhands/app_server/integrations/gitlab/service/features.py@@ -1,5 +1,5 @@-from openhands.integrations.gitlab.service.base import GitLabMixinBase-from openhands.integrations.service_types import (+from openhands.app_server.integrations.gitlab.service.base import GitLabMixinBase+from openhands.app_server.integrations.service_types import (ProviderType,RequestMethod,SuggestedTask,diff --git a/openhands/integrations/gitlab/service/prs.py b/openhands/app_server/integrations/gitlab/service/prs.pysimilarity index 96%rename from openhands/integrations/gitlab/service/prs.pyrename to openhands/app_server/integrations/gitlab/service/prs.pyindex dd1366ac5e..1418e49b42 100644--- a/openhands/integrations/gitlab/service/prs.py+++ b/openhands/app_server/integrations/gitlab/service/prs.py@@ -1,6 +1,6 @@+from openhands.app_server.integrations.gitlab.service.base import GitLabMixinBase+from openhands.app_server.integrations.service_types import RequestMethodfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.gitlab.service.base import GitLabMixinBase-from openhands.integrations.service_types import RequestMethodclass GitLabPRsMixin(GitLabMixinBase):diff --git a/openhands/integrations/gitlab/service/repos.py b/openhands/app_server/integrations/gitlab/service/repos.pysimilarity index 97%rename from openhands/integrations/gitlab/service/repos.pyrename to openhands/app_server/integrations/gitlab/service/repos.pyindex 08be876fbd..0faed90516 100644--- a/openhands/integrations/gitlab/service/repos.py+++ b/openhands/app_server/integrations/gitlab/service/repos.py@@ -1,6 +1,10 @@+from openhands.app_server.integrations.gitlab.service.base import GitLabMixinBase+from openhands.app_server.integrations.service_types import (+ OwnerType,+ ProviderType,+ Repository,+)from openhands.core.logger import openhands_logger as logger-from openhands.integrations.gitlab.service.base import GitLabMixinBase-from openhands.integrations.service_types import OwnerType, ProviderType, Repositoryfrom openhands.server.types import AppModediff --git a/openhands/integrations/gitlab/service/resolver.py b/openhands/app_server/integrations/gitlab/service/resolver.pysimilarity index 97%rename from openhands/integrations/gitlab/service/resolver.pyrename to openhands/app_server/integrations/gitlab/service/resolver.pyindex ec79cade63..b7cb72bfa7 100644--- a/openhands/integrations/gitlab/service/resolver.py+++ b/openhands/app_server/integrations/gitlab/service/resolver.py@@ -1,7 +1,7 @@from datetime import datetime-from openhands.integrations.gitlab.service.base import GitLabMixinBase-from openhands.integrations.service_types import Comment+from openhands.app_server.integrations.gitlab.service.base import GitLabMixinBase+from openhands.app_server.integrations.service_types import Commentclass GitLabResolverMixin(GitLabMixinBase):diff --git a/openhands/integrations/protocols/http_client.py b/openhands/app_server/integrations/protocols/http_client.pysimilarity index 98%rename from openhands/integrations/protocols/http_client.pyrename to openhands/app_server/integrations/protocols/http_client.pyindex 92dba3dade..c825302e58 100644--- a/openhands/integrations/protocols/http_client.py+++ b/openhands/app_server/integrations/protocols/http_client.py@@ -6,8 +6,7 @@ from typing import Anyfrom httpx import AsyncClient, HTTPError, HTTPStatusError, TimeoutExceptionfrom pydantic import SecretStr-from openhands.core.logger import openhands_logger as logger-from openhands.integrations.service_types import (+from openhands.app_server.integrations.service_types import (AuthenticationError,ProviderTimeoutError,RateLimitError,@@ -15,6 +14,7 @@ from openhands.integrations.service_types import (ResourceNotFoundError,UnknownException,)+from openhands.core.logger import openhands_logger as loggerclass HTTPClient(ABC):diff --git a/openhands/integrations/provider.py b/openhands/app_server/integrations/provider.pysimilarity index 97%rename from openhands/integrations/provider.pyrename to openhands/app_server/integrations/provider.pyindex 2a57234b9c..6f86ecd901 100644--- a/openhands/integrations/provider.py+++ b/openhands/app_server/integrations/provider.py@@ -14,19 +14,20 @@ from pydantic import (SecretStr,)-from openhands.core.logger import openhands_logger as logger-from openhands.integrations.azure_devops.azure_devops_service import (+from openhands.app_server.integrations.azure_devops.azure_devops_service import (AzureDevOpsServiceImpl,)-from openhands.integrations.bitbucket.bitbucket_service import BitBucketServiceImpl-from openhands.integrations.bitbucket_data_center.bitbucket_dc_service import (+from openhands.app_server.integrations.bitbucket.bitbucket_service import (+ BitBucketServiceImpl,+)+from openhands.app_server.integrations.bitbucket_data_center.bitbucket_dc_service import (BitbucketDCServiceImpl,)-from openhands.integrations.forgejo.forgejo_service import ForgejoServiceImpl-from openhands.integrations.github.github_service import GithubServiceImpl-from openhands.integrations.gitlab.constants import GITLAB_HOST-from openhands.integrations.gitlab.gitlab_service import GitLabServiceImpl-from openhands.integrations.service_types import (+from openhands.app_server.integrations.forgejo.forgejo_service import ForgejoServiceImpl+from openhands.app_server.integrations.github.github_service import GithubServiceImpl+from openhands.app_server.integrations.gitlab.constants import GITLAB_HOST+from openhands.app_server.integrations.gitlab.gitlab_service import GitLabServiceImpl+from openhands.app_server.integrations.service_types import (AuthenticationError,Branch,GitService,@@ -39,6 +40,7 @@ from openhands.integrations.service_types import (TokenResponse,User,)+from openhands.core.logger import openhands_logger as loggerfrom openhands.server.types import AppModefrom openhands.utils.http_session import httpx_verify_optiondiff --git a/openhands/integrations/service_types.py b/openhands/app_server/integrations/service_types.pysimilarity index 98%rename from openhands/integrations/service_types.pyrename to openhands/app_server/integrations/service_types.pyindex 3306e5964d..9676a3618f 100644--- a/openhands/integrations/service_types.py+++ b/openhands/app_server/integrations/service_types.py@@ -95,7 +95,9 @@ class SuggestedTask(BaseModel):repo = self.repoenv = Environment(- loader=FileSystemLoader('openhands/integrations/templates/suggested_task')+ loader=FileSystemLoader(+ 'openhands/app_server/integrations/templates/suggested_task'+ ))template = Nonediff --git a/openhands/integrations/templates/resolver/azure_devops/issue_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/azure_devops/issue_conversation_instructions.j2similarity index 100%rename from openhands/integrations/templates/resolver/azure_devops/issue_conversation_instructions.j2rename to openhands/app_server/integrations/templates/resolver/azure_devops/issue_conversation_instructions.j2diff --git a/openhands/integrations/templates/resolver/azure_devops/issue_prompt.j2 b/openhands/app_server/integrations/templates/resolver/azure_devops/issue_prompt.j2similarity index 100%rename from openhands/integrations/templates/resolver/azure_devops/issue_prompt.j2rename to openhands/app_server/integrations/templates/resolver/azure_devops/issue_prompt.j2diff --git a/openhands/integrations/templates/resolver/azure_devops/pr_update_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/azure_devops/pr_update_conversation_instructions.j2similarity index 100%rename from openhands/integrations/templates/resolver/azure_devops/pr_update_conversation_instructions.j2rename to openhands/app_server/integrations/templates/resolver/azure_devops/pr_update_conversation_instructions.j2diff --git a/openhands/integrations/templates/resolver/azure_devops/pr_update_prompt.j2 b/openhands/app_server/integrations/templates/resolver/azure_devops/pr_update_prompt.j2similarity index 100%rename from openhands/integrations/templates/resolver/azure_devops/pr_update_prompt.j2rename to openhands/app_server/integrations/templates/resolver/azure_devops/pr_update_prompt.j2diff --git a/openhands/integrations/templates/resolver/bitbucket/issue_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/bitbucket/issue_conversation_instructions.j2similarity index 100%rename from openhands/integrations/templates/resolver/bitbucket/issue_conversation_instructions.j2rename to openhands/app_server/integrations/templates/resolver/bitbucket/issue_conversation_instructions.j2diff --git a/openhands/integrations/templates/resolver/bitbucket/issue_prompt.j2 b/openhands/app_server/integrations/templates/resolver/bitbucket/issue_prompt.j2similarity index 100%rename from openhands/integrations/templates/resolver/bitbucket/issue_prompt.j2rename to openhands/app_server/integrations/templates/resolver/bitbucket/issue_prompt.j2diff --git a/openhands/integrations/templates/resolver/bitbucket/pr_update_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/bitbucket/pr_update_conversation_instructions.j2similarity index 100%rename from openhands/integrations/templates/resolver/bitbucket/pr_update_conversation_instructions.j2rename to openhands/app_server/integrations/templates/resolver/bitbucket/pr_update_conversation_instructions.j2diff --git a/openhands/integrations/templates/resolver/bitbucket/pr_update_prompt.j2 b/openhands/app_server/integrations/templates/resolver/bitbucket/pr_update_prompt.j2similarity index 100%rename from openhands/integrations/templates/resolver/bitbucket/pr_update_prompt.j2rename to openhands/app_server/integrations/templates/resolver/bitbucket/pr_update_prompt.j2diff --git a/openhands/integrations/templates/resolver/github/issue_comment_initial_message.j2 b/openhands/app_server/integrations/templates/resolver/github/issue_comment_initial_message.j2similarity index 100%rename from openhands/integrations/templates/resolver/github/issue_comment_initial_message.j2rename to openhands/app_server/integrations/templates/resolver/github/issue_comment_initial_message.j2diff --git a/openhands/integrations/templates/resolver/github/issue_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/github/issue_conversation_instructions.j2similarity index 100%rename from openhands/integrations/templates/resolver/github/issue_conversation_instructions.j2rename to openhands/app_server/integrations/templates/resolver/github/issue_conversation_instructions.j2diff --git a/openhands/integrations/templates/resolver/github/issue_prompt.j2 b/openhands/app_server/integrations/templates/resolver/github/issue_prompt.j2similarity index 100%rename from openhands/integrations/templates/resolver/github/issue_prompt.j2rename to openhands/app_server/integrations/templates/resolver/github/issue_prompt.j2diff --git a/openhands/integrations/templates/resolver/github/pr_update_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/github/pr_update_conversation_instructions.j2similarity index 100%rename from openhands/integrations/templates/resolver/github/pr_update_conversation_instructions.j2rename to openhands/app_server/integrations/templates/resolver/github/pr_update_conversation_instructions.j2diff --git a/openhands/integrations/templates/resolver/github/pr_update_initial_message.j2 b/openhands/app_server/integrations/templates/resolver/github/pr_update_initial_message.j2similarity index 100%rename from openhands/integrations/templates/resolver/github/pr_update_initial_message.j2rename to openhands/app_server/integrations/templates/resolver/github/pr_update_initial_message.j2diff --git a/openhands/integrations/templates/resolver/github/pr_update_prompt.j2 b/openhands/app_server/integrations/templates/resolver/github/pr_update_prompt.j2similarity index 100%rename from openhands/integrations/templates/resolver/github/pr_update_prompt.j2rename to openhands/app_server/integrations/templates/resolver/github/pr_update_prompt.j2diff --git a/openhands/integrations/templates/resolver/gitlab/issue_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/gitlab/issue_conversation_instructions.j2similarity index 100%rename from openhands/integrations/templates/resolver/gitlab/issue_conversation_instructions.j2rename to openhands/app_server/integrations/templates/resolver/gitlab/issue_conversation_instructions.j2diff --git a/openhands/integrations/templates/resolver/gitlab/issue_prompt.j2 b/openhands/app_server/integrations/templates/resolver/gitlab/issue_prompt.j2similarity index 100%rename from openhands/integrations/templates/resolver/gitlab/issue_prompt.j2rename to openhands/app_server/integrations/templates/resolver/gitlab/issue_prompt.j2diff --git a/openhands/integrations/templates/resolver/gitlab/mr_update_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/gitlab/mr_update_conversation_instructions.j2similarity index 100%rename from openhands/integrations/templates/resolver/gitlab/mr_update_conversation_instructions.j2rename to openhands/app_server/integrations/templates/resolver/gitlab/mr_update_conversation_instructions.j2diff --git a/openhands/integrations/templates/resolver/gitlab/mr_update_prompt.j2 b/openhands/app_server/integrations/templates/resolver/gitlab/mr_update_prompt.j2similarity index 100%rename from openhands/integrations/templates/resolver/gitlab/mr_update_prompt.j2rename to openhands/app_server/integrations/templates/resolver/gitlab/mr_update_prompt.j2diff --git a/openhands/integrations/templates/resolver/jira/jira_existing_conversation.j2 b/openhands/app_server/integrations/templates/resolver/jira/jira_existing_conversation.j2similarity index 100%rename from openhands/integrations/templates/resolver/jira/jira_existing_conversation.j2rename to openhands/app_server/integrations/templates/resolver/jira/jira_existing_conversation.j2diff --git a/openhands/integrations/templates/resolver/jira/jira_instructions.j2 b/openhands/app_server/integrations/templates/resolver/jira/jira_instructions.j2similarity index 100%rename from openhands/integrations/templates/resolver/jira/jira_instructions.j2rename to openhands/app_server/integrations/templates/resolver/jira/jira_instructions.j2diff --git a/openhands/integrations/templates/resolver/jira/jira_new_conversation.j2 b/openhands/app_server/integrations/templates/resolver/jira/jira_new_conversation.j2similarity index 100%rename from openhands/integrations/templates/resolver/jira/jira_new_conversation.j2rename to openhands/app_server/integrations/templates/resolver/jira/jira_new_conversation.j2diff --git a/openhands/integrations/templates/resolver/jira_dc/jira_dc_existing_conversation.j2 b/openhands/app_server/integrations/templates/resolver/jira_dc/jira_dc_existing_conversation.j2similarity index 100%rename from openhands/integrations/templates/resolver/jira_dc/jira_dc_existing_conversation.j2rename to openhands/app_server/integrations/templates/resolver/jira_dc/jira_dc_existing_conversation.j2diff --git a/openhands/integrations/templates/resolver/jira_dc/jira_dc_instructions.j2 b/openhands/app_server/integrations/templates/resolver/jira_dc/jira_dc_instructions.j2similarity index 100%rename from openhands/integrations/templates/resolver/jira_dc/jira_dc_instructions.j2rename to openhands/app_server/integrations/templates/resolver/jira_dc/jira_dc_instructions.j2diff --git a/openhands/integrations/templates/resolver/jira_dc/jira_dc_new_conversation.j2 b/openhands/app_server/integrations/templates/resolver/jira_dc/jira_dc_new_conversation.j2similarity index 100%rename from openhands/integrations/templates/resolver/jira_dc/jira_dc_new_conversation.j2rename to openhands/app_server/integrations/templates/resolver/jira_dc/jira_dc_new_conversation.j2diff --git a/openhands/integrations/templates/resolver/linear/linear_existing_conversation.j2 b/openhands/app_server/integrations/templates/resolver/linear/linear_existing_conversation.j2similarity index 100%rename from openhands/integrations/templates/resolver/linear/linear_existing_conversation.j2rename to openhands/app_server/integrations/templates/resolver/linear/linear_existing_conversation.j2diff --git a/openhands/integrations/templates/resolver/linear/linear_instructions.j2 b/openhands/app_server/integrations/templates/resolver/linear/linear_instructions.j2similarity index 100%rename from openhands/integrations/templates/resolver/linear/linear_instructions.j2rename to openhands/app_server/integrations/templates/resolver/linear/linear_instructions.j2diff --git a/openhands/integrations/templates/resolver/linear/linear_new_conversation.j2 b/openhands/app_server/integrations/templates/resolver/linear/linear_new_conversation.j2similarity index 100%rename from openhands/integrations/templates/resolver/linear/linear_new_conversation.j2rename to openhands/app_server/integrations/templates/resolver/linear/linear_new_conversation.j2diff --git a/openhands/integrations/templates/resolver/slack/user_message_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/slack/user_message_conversation_instructions.j2similarity index 100%rename from openhands/integrations/templates/resolver/slack/user_message_conversation_instructions.j2rename to openhands/app_server/integrations/templates/resolver/slack/user_message_conversation_instructions.j2diff --git a/openhands/integrations/templates/resolver/summary_prompt.j2 b/openhands/app_server/integrations/templates/resolver/summary_prompt.j2similarity index 100%rename from openhands/integrations/templates/resolver/summary_prompt.j2rename to openhands/app_server/integrations/templates/resolver/summary_prompt.j2diff --git a/openhands/integrations/templates/suggested_task/failing_checks_prompt.j2 b/openhands/app_server/integrations/templates/suggested_task/failing_checks_prompt.j2similarity index 100%rename from openhands/integrations/templates/suggested_task/failing_checks_prompt.j2rename to openhands/app_server/integrations/templates/suggested_task/failing_checks_prompt.j2diff --git a/openhands/integrations/templates/suggested_task/merge_conflict_prompt.j2 b/openhands/app_server/integrations/templates/suggested_task/merge_conflict_prompt.j2similarity index 100%rename from openhands/integrations/templates/suggested_task/merge_conflict_prompt.j2rename to openhands/app_server/integrations/templates/suggested_task/merge_conflict_prompt.j2diff --git a/openhands/integrations/templates/suggested_task/open_issue_prompt.j2 b/openhands/app_server/integrations/templates/suggested_task/open_issue_prompt.j2similarity index 100%rename from openhands/integrations/templates/suggested_task/open_issue_prompt.j2rename to openhands/app_server/integrations/templates/suggested_task/open_issue_prompt.j2diff --git a/openhands/integrations/templates/suggested_task/unresolved_comments_prompt.j2 b/openhands/app_server/integrations/templates/suggested_task/unresolved_comments_prompt.j2similarity index 100%rename from openhands/integrations/templates/suggested_task/unresolved_comments_prompt.j2rename to openhands/app_server/integrations/templates/suggested_task/unresolved_comments_prompt.j2diff --git a/openhands/integrations/utils.py b/openhands/app_server/integrations/utils.pysimilarity index 83%rename from openhands/integrations/utils.pyrename to openhands/app_server/integrations/utils.pyindex d7446597c1..e954e767a0 100644--- a/openhands/integrations/utils.py+++ b/openhands/app_server/integrations/utils.py@@ -1,17 +1,19 @@from pydantic import SecretStr-from openhands.core.logger import openhands_logger as logger-from openhands.integrations.azure_devops.azure_devops_service import (+from openhands.app_server.integrations.azure_devops.azure_devops_service import (AzureDevOpsServiceImpl as AzureDevOpsService,)-from openhands.integrations.bitbucket.bitbucket_service import BitBucketService-from openhands.integrations.bitbucket_data_center.bitbucket_dc_service import (+from openhands.app_server.integrations.bitbucket.bitbucket_service import (+ BitBucketService,+)+from openhands.app_server.integrations.bitbucket_data_center.bitbucket_dc_service import (BitbucketDCService,)-from openhands.integrations.forgejo.forgejo_service import ForgejoService-from openhands.integrations.github.github_service import GitHubService-from openhands.integrations.gitlab.gitlab_service import GitLabService-from openhands.integrations.provider import ProviderType+from openhands.app_server.integrations.forgejo.forgejo_service import ForgejoService+from openhands.app_server.integrations.github.github_service import GitHubService+from openhands.app_server.integrations.gitlab.gitlab_service import GitLabService+from openhands.app_server.integrations.provider import ProviderType+from openhands.core.logger import openhands_logger as loggerasync def validate_provider_token(diff --git a/openhands/app_server/mcp/mcp_router.py b/openhands/app_server/mcp/mcp_router.pyindex c8b1d3384f..f932248477 100644--- a/openhands/app_server/mcp/mcp_router.py+++ b/openhands/app_server/mcp/mcp_router.py@@ -12,23 +12,25 @@ from openhands.app_server.config import (get_app_conversation_info_service,get_global_config,)+from openhands.app_server.integrations.azure_devops.azure_devops_service import (+ AzureDevOpsServiceImpl,+)+from openhands.app_server.integrations.bitbucket.bitbucket_service import (+ BitBucketServiceImpl,+)+from openhands.app_server.integrations.bitbucket_data_center.bitbucket_dc_service import (+ BitbucketDCServiceImpl,+)+from openhands.app_server.integrations.github.github_service import GithubServiceImpl+from openhands.app_server.integrations.gitlab.gitlab_service import GitLabServiceImpl+from openhands.app_server.integrations.provider import ProviderToken+from openhands.app_server.integrations.service_types import GitService, ProviderTypefrom openhands.app_server.services.injector import InjectorStatefrom openhands.app_server.user.specifiy_user_context import (USER_CONTEXT_ATTR,SpecifyUserContext,)from openhands.core.logger import openhands_logger as logger-from openhands.integrations.azure_devops.azure_devops_service import (- AzureDevOpsServiceImpl,-)-from openhands.integrations.bitbucket.bitbucket_service import BitBucketServiceImpl-from openhands.integrations.bitbucket_data_center.bitbucket_dc_service import (- BitbucketDCServiceImpl,-)-from openhands.integrations.github.github_service import GithubServiceImpl-from openhands.integrations.gitlab.gitlab_service import GitLabServiceImpl-from openhands.integrations.provider import ProviderToken-from openhands.integrations.service_types import GitService, ProviderTypefrom openhands.server.types import AppModefrom openhands.server.user_auth import (get_access_token,diff --git a/openhands/app_server/secrets/secrets_models.py b/openhands/app_server/secrets/secrets_models.pyindex 44e42960b3..54e8e5e64d 100644--- a/openhands/app_server/secrets/secrets_models.py+++ b/openhands/app_server/secrets/secrets_models.py@@ -23,13 +23,13 @@ from pydantic import ()from pydantic.json import pydantic_encoder-from openhands.integrations.provider import (+from openhands.app_server.integrations.provider import (CUSTOM_SECRETS_TYPE,PROVIDER_TOKEN_TYPE,CustomSecret,ProviderToken,)-from openhands.integrations.service_types import ProviderType+from openhands.app_server.integrations.service_types import ProviderTypeclass Secrets(BaseModel):diff --git a/openhands/app_server/secrets/secrets_router.py b/openhands/app_server/secrets/secrets_router.pyindex 88475bce95..b66b2ddb12 100644--- a/openhands/app_server/secrets/secrets_router.py+++ b/openhands/app_server/secrets/secrets_router.py@@ -8,6 +8,12 @@ from typing import Annotatedfrom fastapi import APIRouter, Depends, HTTPException, Query, statusfrom openhands.app_server.errors import AuthError+from openhands.app_server.integrations.provider import (+ PROVIDER_TOKEN_TYPE,+ CustomSecret,+ ProviderType,+)+from openhands.app_server.integrations.utils import validate_provider_tokenfrom openhands.app_server.secrets.secrets_models import (CustomSecretCreate,CustomSecretPage,@@ -18,12 +24,6 @@ from openhands.app_server.secrets.secrets_store import SecretsStorefrom openhands.app_server.settings.settings_models import POSTProviderModelfrom openhands.app_server.utils.dependencies import get_dependenciesfrom openhands.app_server.utils.models import EditResponse-from openhands.integrations.provider import (- PROVIDER_TOKEN_TYPE,- CustomSecret,- ProviderType,-)-from openhands.integrations.utils import validate_provider_tokenfrom openhands.server.user_auth import (get_provider_tokens,get_secrets,diff --git a/openhands/app_server/settings/settings_models.py b/openhands/app_server/settings/settings_models.pyindex d1bcef0419..c1492a0e62 100644--- a/openhands/app_server/settings/settings_models.py+++ b/openhands/app_server/settings/settings_models.py@@ -24,12 +24,12 @@ from pydantic import (model_validator,)+from openhands.app_server.integrations.provider import ProviderToken+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.settings.llm_profiles import LLMProfilesfrom openhands.core.config.llm_config import LLMConfigfrom openhands.core.config.mcp_config import MCPConfigfrom openhands.core.config.utils import load_openhands_config-from openhands.integrations.provider import ProviderToken-from openhands.integrations.service_types import ProviderTypefrom openhands.sdk.settings import ConversationSettingsfrom openhands.utils.jsonpatch_compat import deep_mergefrom openhands.utils.sdk_settings_compat import (diff --git a/openhands/app_server/settings/settings_router.py b/openhands/app_server/settings/settings_router.pyindex fc8be60880..077e04a22c 100644--- a/openhands/app_server/settings/settings_router.py+++ b/openhands/app_server/settings/settings_router.py@@ -12,6 +12,10 @@ from fastapi import APIRouter, Body, Depends, HTTPException, Path, statusfrom fastapi.responses import JSONResponsefrom pydantic import BaseModel, Field+from openhands.app_server.integrations.provider import (+ PROVIDER_TOKEN_TYPE,+ ProviderType,+)from openhands.app_server.secrets.secrets_models import Secretsfrom openhands.app_server.secrets.secrets_store import SecretsStorefrom openhands.app_server.settings.llm_profiles import (@@ -27,10 +31,6 @@ from openhands.app_server.settings.settings_models import (from openhands.app_server.settings.settings_store import SettingsStorefrom openhands.app_server.utils.dependencies import get_dependenciesfrom openhands.core.logger import openhands_logger as logger-from openhands.integrations.provider import (- PROVIDER_TOKEN_TYPE,- ProviderType,-)from openhands.sdk.llm import LLMfrom openhands.sdk.settings import ConversationSettingsfrom openhands.server.shared import configdiff --git a/openhands/app_server/user/auth_user_context.py b/openhands/app_server/user/auth_user_context.pyindex d1b5d1167a..b5176d3eba 100644--- a/openhands/app_server/user/auth_user_context.py+++ b/openhands/app_server/user/auth_user_context.py@@ -5,16 +5,16 @@ from fastapi import Requestfrom pydantic import PrivateAttr, SecretStrfrom openhands.app_server.errors import AuthError-from openhands.app_server.services.injector import InjectorState-from openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTR-from openhands.app_server.user.user_context import UserContext, UserContextInjector-from openhands.app_server.user.user_models import UserInfo-from openhands.integrations.provider import (+from openhands.app_server.integrations.provider import (PROVIDER_TOKEN_TYPE,ProviderHandler,ProviderType,)-from openhands.integrations.service_types import UserGitInfo+from openhands.app_server.integrations.service_types import UserGitInfo+from openhands.app_server.services.injector import InjectorState+from openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTR+from openhands.app_server.user.user_context import UserContext, UserContextInjector+from openhands.app_server.user.user_models import UserInfofrom openhands.sdk.secret import SecretSource, StaticSecretfrom openhands.server.user_auth.user_auth import UserAuth, get_user_authdiff --git a/openhands/app_server/user/specifiy_user_context.py b/openhands/app_server/user/specifiy_user_context.pyindex 69d35e019d..e275f99adc 100644--- a/openhands/app_server/user/specifiy_user_context.py+++ b/openhands/app_server/user/specifiy_user_context.py@@ -3,10 +3,10 @@ from dataclasses import dataclassfrom fastapi import Requestfrom openhands.app_server.errors import OpenHandsError+from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType+from openhands.app_server.integrations.service_types import UserGitInfofrom openhands.app_server.user.user_context import UserContextfrom openhands.app_server.user.user_models import UserInfo-from openhands.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType-from openhands.integrations.service_types import UserGitInfofrom openhands.sdk.secret import SecretSourcediff --git a/openhands/app_server/user/user_context.py b/openhands/app_server/user/user_context.pyindex 303c195ef6..82c4e4cb71 100644--- a/openhands/app_server/user/user_context.py+++ b/openhands/app_server/user/user_context.py@@ -1,11 +1,11 @@from abc import ABC, abstractmethod+from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType+from openhands.app_server.integrations.service_types import UserGitInfofrom openhands.app_server.services.injector import Injectorfrom openhands.app_server.user.user_models import (UserInfo,)-from openhands.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType-from openhands.integrations.service_types import UserGitInfofrom openhands.sdk.secret import SecretSourcefrom openhands.sdk.utils.models import DiscriminatedUnionMixindiff --git a/openhands/app_server/user/user_models.py b/openhands/app_server/user/user_models.pyindex 88fbfb8a89..0f9bfc8245 100644--- a/openhands/app_server/user/user_models.py+++ b/openhands/app_server/user/user_models.py@@ -1,5 +1,5 @@+from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPEfrom openhands.app_server.settings.settings_models import Settings-from openhands.integrations.provider import PROVIDER_TOKEN_TYPEclass UserInfo(Settings):diff --git a/openhands/app_server/user/user_router.py b/openhands/app_server/user/user_router.pyindex 461bb3d27d..2e8fc4331b 100644--- a/openhands/app_server/user/user_router.py+++ b/openhands/app_server/user/user_router.py@@ -4,11 +4,11 @@ from fastapi import APIRouter, Header, HTTPException, Query, statusfrom fastapi.responses import JSONResponsefrom openhands.app_server.config import depends_user_context+from openhands.app_server.integrations.service_types import UserGitInfofrom openhands.app_server.sandbox.session_auth import validate_session_key_ownershipfrom openhands.app_server.user.user_context import UserContextfrom openhands.app_server.user.user_models import UserInfofrom openhands.app_server.utils.dependencies import get_dependencies-from openhands.integrations.service_types import UserGitInfo# We use the get_dependencies method here to signal to the OpenAPI docs that this endpoint# is protected. The actual protection is provided by SetAuthCookieMiddlewarediff --git a/openhands/app_server/web_client/default_web_client_config_injector.py b/openhands/app_server/web_client/default_web_client_config_injector.pyindex 5dce66b0b1..6d74678b05 100644--- a/openhands/app_server/web_client/default_web_client_config_injector.py+++ b/openhands/app_server/web_client/default_web_client_config_injector.py@@ -3,6 +3,8 @@ from datetime import datetimefrom pydantic import Field+from openhands.app_server.integrations.provider import ProviderHandler+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.web_client.web_client_config_injector import (WebClientConfigInjector,)@@ -10,8 +12,6 @@ from openhands.app_server.web_client.web_client_models import (WebClientConfig,WebClientFeatureFlags,)-from openhands.integrations.provider import ProviderHandler-from openhands.integrations.service_types import ProviderTypedef _get_recaptcha_site_key() -> str | None:diff --git a/openhands/app_server/web_client/web_client_models.py b/openhands/app_server/web_client/web_client_models.pyindex 8ebfc4c367..9aefdaa1c2 100644--- a/openhands/app_server/web_client/web_client_models.py+++ b/openhands/app_server/web_client/web_client_models.py@@ -3,11 +3,11 @@ from datetime import datetimefrom pydantic import BaseModel, Field, model_validatorfrom openhands.agent_server.env_parser import DiscriminatedUnionMixin+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.web_client.web_client_deployment_mode import (DeploymentMode,get_deployment_mode,)-from openhands.integrations.service_types import ProviderTypefrom openhands.server.types import AppModediff --git a/openhands/core/setup.py b/openhands/core/setup.pyindex fa633acab5..feee0db240 100644--- a/openhands/core/setup.py+++ b/openhands/core/setup.py@@ -11,14 +11,14 @@ import uuidfrom pydantic import SecretStr+from openhands.app_server.integrations.provider import (+ ProviderToken,+ ProviderType,+)from openhands.app_server.secrets.secrets_models import Secretsfrom openhands.core.config import (OpenHandsConfig,)-from openhands.integrations.provider import (- ProviderToken,- ProviderType,-)def get_provider_tokens():diff --git a/openhands/server/app.py b/openhands/server/app.pyindex a572314980..af791b66c5 100644--- a/openhands/server/app.py+++ b/openhands/server/app.py@@ -22,9 +22,9 @@ from fastapi.responses import JSONResponsefrom openhands.app_server import v1_routerfrom openhands.app_server.config import get_app_lifespan_service+from openhands.app_server.integrations.service_types import AuthenticationErrorfrom openhands.app_server.mcp.mcp_router import mcp_serverfrom openhands.app_server.status.status_router import router as health_router-from openhands.integrations.service_types import AuthenticationErrorfrom openhands.version import get_versionmcp_app = mcp_server.http_app(path='/mcp', stateless_http=True)diff --git a/openhands/server/services/conversation_service.py b/openhands/server/services/conversation_service.pyindex 341b973520..1f84b1ecad 100644--- a/openhands/server/services/conversation_service.py+++ b/openhands/server/services/conversation_service.py@@ -8,11 +8,11 @@# This module belongs to the old V0 web server. The V1 application server lives under openhands/app_server/.from types import MappingProxyType-from openhands.integrations.provider import (+from openhands.app_server.integrations.provider import (PROVIDER_TOKEN_TYPE,ProviderToken,)-from openhands.integrations.service_types import ProviderType+from openhands.app_server.integrations.service_types import ProviderTypedef create_provider_tokens_object(diff --git a/openhands/server/user_auth/__init__.py b/openhands/server/user_auth/__init__.pyindex 2aac3e3b6d..c1bec46963 100644--- a/openhands/server/user_auth/__init__.py+++ b/openhands/server/user_auth/__init__.py@@ -2,11 +2,11 @@ from fastapi import Depends, Requestfrom fastapi.security import APIKeyHeaderfrom pydantic import SecretStr+from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPEfrom openhands.app_server.secrets.secrets_models import Secretsfrom openhands.app_server.secrets.secrets_store import SecretsStorefrom openhands.app_server.settings.settings_models import Settingsfrom openhands.app_server.settings.settings_store import SettingsStore-from openhands.integrations.provider import PROVIDER_TOKEN_TYPEfrom openhands.server.user_auth.user_auth import AuthType, get_user_authdiff --git a/openhands/server/user_auth/default_user_auth.py b/openhands/server/user_auth/default_user_auth.pyindex 318c57e93e..cc612b543a 100644--- a/openhands/server/user_auth/default_user_auth.py+++ b/openhands/server/user_auth/default_user_auth.py@@ -11,11 +11,11 @@ from dataclasses import dataclassfrom fastapi import Requestfrom pydantic import SecretStr+from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPEfrom openhands.app_server.secrets.secrets_models import Secretsfrom openhands.app_server.secrets.secrets_store import SecretsStorefrom openhands.app_server.settings.settings_models import Settingsfrom openhands.app_server.settings.settings_store import SettingsStore-from openhands.integrations.provider import PROVIDER_TOKEN_TYPEfrom openhands.server import sharedfrom openhands.server.user_auth.user_auth import UserAuthdiff --git a/openhands/server/user_auth/user_auth.py b/openhands/server/user_auth/user_auth.pyindex 08d3219e63..8c8a94e6d5 100644--- a/openhands/server/user_auth/user_auth.py+++ b/openhands/server/user_auth/user_auth.py@@ -14,12 +14,15 @@ from enum import Enumfrom fastapi import Requestfrom pydantic import SecretStr+from openhands.app_server.integrations.provider import (+ PROVIDER_TOKEN_TYPE,+ ProviderHandler,+)+from openhands.app_server.integrations.service_types import UserGitInfofrom openhands.app_server.secrets.secrets_models import Secretsfrom openhands.app_server.secrets.secrets_store import SecretsStorefrom openhands.app_server.settings.settings_models import Settingsfrom openhands.app_server.settings.settings_store import SettingsStore-from openhands.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderHandler-from openhands.integrations.service_types import UserGitInfofrom openhands.server.shared import server_configfrom openhands.utils.import_utils import get_impldiff --git a/tests/unit/app_server/test_default_web_client_config_injector.py b/tests/unit/app_server/test_default_web_client_config_injector.pyindex fd037f8fd6..06779ac24a 100644--- a/tests/unit/app_server/test_default_web_client_config_injector.py+++ b/tests/unit/app_server/test_default_web_client_config_injector.py@@ -325,10 +325,10 @@ class TestGetProvidersConfigured:def test_includes_github_when_client_id_set(self):"""When GITHUB_APP_CLIENT_ID is set, include GitHub in providers."""+ from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.web_client.default_web_client_config_injector import (_get_providers_configured,)- from openhands.integrations.service_types import ProviderTypewith patch.dict(os.environ, {'GITHUB_APP_CLIENT_ID': 'some-client-id'}):result = _get_providers_configured()@@ -336,10 +336,10 @@ class TestGetProvidersConfigured:def test_includes_gitlab_when_client_id_set(self):"""When GITLAB_APP_CLIENT_ID is set, include GitLab in providers."""+ from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.web_client.default_web_client_config_injector import (_get_providers_configured,)- from openhands.integrations.service_types import ProviderTypewith patch.dict(os.environ, {'GITLAB_APP_CLIENT_ID': 'some-client-id'}):result = _get_providers_configured()@@ -347,10 +347,10 @@ class TestGetProvidersConfigured:def test_includes_bitbucket_when_client_id_set(self):"""When BITBUCKET_APP_CLIENT_ID is set, include Bitbucket in providers."""+ from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.web_client.default_web_client_config_injector import (_get_providers_configured,)- from openhands.integrations.service_types import ProviderTypewith patch.dict(os.environ, {'BITBUCKET_APP_CLIENT_ID': 'some-client-id'}):result = _get_providers_configured()@@ -358,10 +358,10 @@ class TestGetProvidersConfigured:def test_includes_enterprise_sso_when_enabled(self):"""When ENABLE_ENTERPRISE_SSO is set, include Enterprise SSO in providers."""+ from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.web_client.default_web_client_config_injector import (_get_providers_configured,)- from openhands.integrations.service_types import ProviderTypewith patch.dict(os.environ, {'ENABLE_ENTERPRISE_SSO': 'true'}):result = _get_providers_configured()@@ -369,10 +369,10 @@ class TestGetProvidersConfigured:def test_excludes_provider_when_env_var_empty(self):"""When env var is empty string, do not include provider."""+ from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.web_client.default_web_client_config_injector import (_get_providers_configured,)- from openhands.integrations.service_types import ProviderTypewith patch.dict(os.environ, {'GITHUB_APP_CLIENT_ID': ''}):result = _get_providers_configured()@@ -380,10 +380,10 @@ class TestGetProvidersConfigured:def test_excludes_provider_when_env_var_only_whitespace(self):"""When env var is only whitespace, do not include provider."""+ from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.web_client.default_web_client_config_injector import (_get_providers_configured,)- from openhands.integrations.service_types import ProviderTypewith patch.dict(os.environ, {'GITHUB_APP_CLIENT_ID': ' '}):result = _get_providers_configured()@@ -391,10 +391,10 @@ class TestGetProvidersConfigured:def test_includes_multiple_providers(self):"""Multiple providers can be configured simultaneously."""+ from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.web_client.default_web_client_config_injector import (_get_providers_configured,)- from openhands.integrations.service_types import ProviderTypewith patch.dict(os.environ,diff --git a/tests/unit/app_server/test_git_router.py b/tests/unit/app_server/test_git_router.pyindex cf46e4e23b..1a4da33752 100644--- a/tests/unit/app_server/test_git_router.py+++ b/tests/unit/app_server/test_git_router.py@@ -18,17 +18,17 @@ from openhands.app_server.git.git_router import (search_suggested_tasks,search_user_installations,)-from openhands.app_server.user.user_context import UserContext-from openhands.app_server.utils.dependencies import check_session_api_key-from openhands.app_server.utils.paging_utils import encode_page_id, paginate_results-from openhands.integrations.provider import ProviderToken-from openhands.integrations.service_types import (+from openhands.app_server.integrations.provider import ProviderToken+from openhands.app_server.integrations.service_types import (Branch,ProviderType,Repository,SuggestedTask,TaskType,)+from openhands.app_server.user.user_context import UserContext+from openhands.app_server.utils.dependencies import check_session_api_key+from openhands.app_server.utils.paging_utils import encode_page_id, paginate_resultsclass TestPagination: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 086f6ab62f..b16d353bd1 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,8 @@ 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.integrations.provider import ProviderToken, ProviderType+from openhands.app_server.integrations.service_types import SuggestedTask, TaskTypefrom openhands.app_server.sandbox.sandbox_models import (AGENT_SERVER,ExposedUrl,@@ -39,8 +41,6 @@ from openhands.app_server.settings.settings_models import (Settings,)from openhands.app_server.user.user_context import UserContext-from openhands.integrations.provider import ProviderToken, ProviderType-from openhands.integrations.service_types import SuggestedTask, TaskTypefrom openhands.sdk import Agent, Eventfrom openhands.sdk.context.agent_context import AgentContext as _AgentContextfrom openhands.sdk.llm import LLMdiff --git a/tests/unit/app_server/test_profiles_api.py b/tests/unit/app_server/test_profiles_api.pyindex 66e28609b2..8b2e266009 100644--- a/tests/unit/app_server/test_profiles_api.py+++ b/tests/unit/app_server/test_profiles_api.py@@ -16,6 +16,8 @@ from fastapi.testclient import TestClientfrom pydantic import SecretStrfrom openhands.app_server.file_store import get_file_store+from openhands.app_server.integrations.provider import ProviderToken, ProviderType+from openhands.app_server.integrations.service_types import UserGitInfofrom openhands.app_server.secrets.secrets_models import Secretsfrom openhands.app_server.secrets.secrets_store import SecretsStorefrom openhands.app_server.settings.file_settings_store import FileSettingsStore@@ -23,8 +25,6 @@ from openhands.app_server.settings.llm_profiles import MAX_PROFILES_PER_USERfrom openhands.app_server.settings.settings_models import Settingsfrom openhands.app_server.settings.settings_router import _user_profile_locksfrom openhands.app_server.settings.settings_store import SettingsStore-from openhands.integrations.provider import ProviderToken, ProviderType-from openhands.integrations.service_types import UserGitInfofrom openhands.sdk.llm import LLMfrom openhands.sdk.settings import AgentSettingsfrom openhands.server.app import appdiff --git a/tests/unit/app_server/test_sandbox_secrets_router.py b/tests/unit/app_server/test_sandbox_secrets_router.pyindex 7326584d36..1c08dc65a1 100644--- a/tests/unit/app_server/test_sandbox_secrets_router.py+++ b/tests/unit/app_server/test_sandbox_secrets_router.py@@ -16,6 +16,8 @@ from fastapi import FastAPI, HTTPExceptionfrom fastapi.testclient import TestClientfrom pydantic import SecretStr+from openhands.app_server.integrations.provider import ProviderHandler, ProviderToken+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.sandbox.sandbox_models import (SandboxInfo,SandboxStatus,@@ -32,8 +34,6 @@ from openhands.app_server.sandbox.session_auth import (from openhands.app_server.user.auth_user_context import AuthUserContextfrom openhands.app_server.user.user_models import UserInfofrom openhands.app_server.user.user_router import get_current_user-from openhands.integrations.provider import ProviderHandler, ProviderToken-from openhands.integrations.service_types import ProviderTypefrom openhands.sdk.llm import LLMfrom openhands.sdk.secret import StaticSecretfrom openhands.sdk.settings import AgentSettingsdiff --git a/tests/unit/app_server/test_secrets_api.py b/tests/unit/app_server/test_secrets_api.pyindex 894f7c8ded..aa97479a36 100644--- a/tests/unit/app_server/test_secrets_api.py+++ b/tests/unit/app_server/test_secrets_api.py@@ -10,16 +10,16 @@ from fastapi.testclient import TestClientfrom pydantic import SecretStrfrom openhands.app_server.file_store import get_file_store+from openhands.app_server.integrations.provider import (+ CustomSecret,+ ProviderToken,+ ProviderType,+)from openhands.app_server.secrets.file_secrets_store import FileSecretsStorefrom openhands.app_server.secrets.secrets_models import Secretsfrom openhands.app_server.secrets.secrets_router import (router as secrets_router,)-from openhands.integrations.provider import (- CustomSecret,- ProviderToken,- ProviderType,-)@pytest.fixture@@ -506,7 +506,7 @@ async def test_add_git_providers_invalid_token_with_host(# Mock validate_provider_token to return None (invalid token)with patch(- 'openhands.integrations.utils.validate_provider_token',+ 'openhands.app_server.integrations.utils.validate_provider_token',AsyncMock(return_value=None),):# Try to add an invalid GitHub provider with a hostdiff --git a/tests/unit/app_server/test_settings_api.py b/tests/unit/app_server/test_settings_api.pyindex 03c4d31f7e..7e37a4fbcd 100644--- a/tests/unit/app_server/test_settings_api.py+++ b/tests/unit/app_server/test_settings_api.py@@ -7,13 +7,13 @@ from fastapi.testclient import TestClientfrom pydantic import SecretStrfrom openhands.app_server.file_store.memory import InMemoryFileStore+from openhands.app_server.integrations.provider import ProviderToken, ProviderType+from openhands.app_server.integrations.service_types import UserGitInfofrom openhands.app_server.secrets.secrets_models import Secretsfrom openhands.app_server.secrets.secrets_store import SecretsStorefrom openhands.app_server.settings.file_settings_store import FileSettingsStorefrom openhands.app_server.settings.settings_models import Settingsfrom openhands.app_server.settings.settings_store import SettingsStore-from openhands.integrations.provider import ProviderToken, ProviderType-from openhands.integrations.service_types import UserGitInfofrom openhands.sdk.llm import LLMfrom openhands.sdk.settings import (AgentSettings,diff --git a/tests/unit/app_server/test_skill_loader.py b/tests/unit/app_server/test_skill_loader.pyindex a4673c5280..421011f2fc 100644--- a/tests/unit/app_server/test_skill_loader.py+++ b/tests/unit/app_server/test_skill_loader.py@@ -24,14 +24,14 @@ from openhands.app_server.app_conversation.skill_loader import (build_sandbox_config,load_skills_from_agent_server,)+from openhands.app_server.integrations.provider import ProviderType+from openhands.app_server.integrations.service_types import AuthenticationErrorfrom openhands.app_server.sandbox.sandbox_models import (ExposedUrl,SandboxInfo,SandboxStatus,)from openhands.app_server.user.user_context import UserContext-from openhands.integrations.provider import ProviderType-from openhands.integrations.service_types import AuthenticationErrorfrom openhands.sdk.skills import KeywordTrigger, Skill, TaskTrigger# ===== Test Fixtures =====diff --git a/tests/unit/app_server/test_sql_app_conversation_info_service.py b/tests/unit/app_server/test_sql_app_conversation_info_service.pyindex 4a24e8d5c3..4f68c9bc24 100644--- a/tests/unit/app_server/test_sql_app_conversation_info_service.py+++ b/tests/unit/app_server/test_sql_app_conversation_info_service.py@@ -21,9 +21,9 @@ from openhands.app_server.app_conversation.app_conversation_models import (from openhands.app_server.app_conversation.sql_app_conversation_info_service import (SQLAppConversationInfoService,)+from openhands.app_server.integrations.service_types import ProviderTypefrom openhands.app_server.user.specifiy_user_context import SpecifyUserContextfrom openhands.app_server.utils.sql_utils import Base-from openhands.integrations.service_types import ProviderTypefrom openhands.sdk.llm import MetricsSnapshot, TokenUsage# Note: org_id column exists but foreign key constraint is not enforced in testsdiff --git a/tests/unit/app_server/test_user_git_info.py b/tests/unit/app_server/test_user_git_info.pyindex 89db610944..e6f35a7f60 100644--- a/tests/unit/app_server/test_user_git_info.py+++ b/tests/unit/app_server/test_user_git_info.py@@ -20,7 +20,7 @@ class TestGetCurrentUserGitInfo:async def test_returns_user_git_info_when_authenticated(self, mock_user_context):"""Authenticated user with git info returns the git info."""- from openhands.integrations.service_types import UserGitInfo+ from openhands.app_server.integrations.service_types import UserGitInfoexpected_git_info = UserGitInfo(id='user-123',@@ -47,7 +47,7 @@ class TestGetCurrentUserGitInfo:async def test_returns_user_git_info_with_minimal_fields(self, mock_user_context):"""User git info with only required fields returns successfully."""- from openhands.integrations.service_types import UserGitInfo+ from openhands.app_server.integrations.service_types import UserGitInfominimal_git_info = UserGitInfo(id='user-456',@@ -86,7 +86,7 @@ class TestGetCurrentUserGitInfo:self, mock_user_context):"""Ensure None values in optional fields don't trigger 401."""- from openhands.integrations.service_types import UserGitInfo+ from openhands.app_server.integrations.service_types import UserGitInfogit_info = UserGitInfo(id='user-789',@@ -123,7 +123,7 @@ class TestUserGitInfoModel:def test_user_git_info_full_fields(self):"""Test UserGitInfo with all fields populated."""- from openhands.integrations.service_types import UserGitInfo+ from openhands.app_server.integrations.service_types import UserGitInfogit_info = UserGitInfo(id='full-user',@@ -143,7 +143,7 @@ class TestUserGitInfoModel:def test_user_git_info_model_dump_json(self):"""Test UserGitInfo serializes correctly to JSON."""- from openhands.integrations.service_types import UserGitInfo+ from openhands.app_server.integrations.service_types import UserGitInfogit_info = UserGitInfo(id='json-user',@@ -164,7 +164,7 @@ class TestUserGitInfoModel:def test_user_git_info_model_dump(self):"""Test UserGitInfo model_dump works correctly."""- from openhands.integrations.service_types import UserGitInfo+ from openhands.app_server.integrations.service_types import UserGitInfogit_info = UserGitInfo(id='dump-user',diff --git a/tests/unit/app_server/test_webhook_router_parent_conversation.py b/tests/unit/app_server/test_webhook_router_parent_conversation.pyindex bd897cfb57..39d4b412f9 100644--- a/tests/unit/app_server/test_webhook_router_parent_conversation.py+++ b/tests/unit/app_server/test_webhook_router_parent_conversation.py@@ -22,10 +22,10 @@ from openhands.app_server.app_conversation.sql_app_conversation_info_service impSQLAppConversationInfoService,)from openhands.app_server.event_callback.webhook_router import on_conversation_update+from openhands.app_server.integrations.provider import ProviderTypefrom openhands.app_server.sandbox.sandbox_models import SandboxInfo, SandboxStatusfrom openhands.app_server.user.specifiy_user_context import SpecifyUserContextfrom openhands.app_server.utils.sql_utils import Base-from openhands.integrations.provider import ProviderTypefrom openhands.sdk.conversation import ConversationExecutionStatusdiff --git a/tests/unit/integrations/bitbucket/test_bitbucket.py b/tests/unit/integrations/bitbucket/test_bitbucket.pyindex 65c8b2d72e..5f89e7c47e 100644--- a/tests/unit/integrations/bitbucket/test_bitbucket.py+++ b/tests/unit/integrations/bitbucket/test_bitbucket.py@@ -5,13 +5,17 @@ from unittest.mock import AsyncMock, patchimport pytestfrom pydantic import SecretStr+from openhands.app_server.integrations.bitbucket.bitbucket_service import (+ BitBucketService,+)+from openhands.app_server.integrations.provider import ProviderToken, ProviderType+from openhands.app_server.integrations.service_types import OwnerType, Repository+from openhands.app_server.integrations.service_types import (+ ProviderType as ServiceProviderType,+)+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.integrations.bitbucket.bitbucket_service import BitBucketService-from openhands.integrations.provider import ProviderToken, ProviderType-from openhands.integrations.service_types import OwnerType, Repository-from openhands.integrations.service_types import ProviderType as ServiceProviderType-from openhands.integrations.utils import validate_provider_tokenfrom openhands.server.types import AppMode@@ -24,10 +28,14 @@ async def test_validate_provider_token_with_bitbucket_token():"""# Mock the service classes to avoid actual API callswith (- patch('openhands.integrations.utils.GitHubService') as mock_github_service,- patch('openhands.integrations.utils.GitLabService') as mock_gitlab_service,patch(- 'openhands.integrations.utils.BitBucketService'+ 'openhands.app_server.integrations.utils.GitHubService'+ ) as mock_github_service,+ patch(+ 'openhands.app_server.integrations.utils.GitLabService'+ ) as mock_gitlab_service,+ patch(+ 'openhands.app_server.integrations.utils.BitBucketService') as mock_bitbucket_service,):# Set up the mocks@@ -198,10 +206,14 @@ async def test_validate_provider_token_with_empty_tokens():"""Test that validate_provider_token handles empty tokens correctly."""# Create a mock for each servicewith (- patch('openhands.integrations.utils.GitHubService') as mock_github_service,- patch('openhands.integrations.utils.GitLabService') as mock_gitlab_service,patch(- 'openhands.integrations.utils.BitBucketService'+ 'openhands.app_server.integrations.utils.GitHubService'+ ) as mock_github_service,+ patch(+ 'openhands.app_server.integrations.utils.GitLabService'+ ) as mock_gitlab_service,+ patch(+ 'openhands.app_server.integrations.utils.BitBucketService') as mock_bitbucket_service,):# Configure mocks to raise exceptions for invalid tokens@@ -378,7 +390,9 @@ async def test_bitbucket_get_repositories_mixed_owner_types():@pytest.mark.asyncioasync def test_resolve_primary_email_selects_primary_confirmed():"""_resolve_primary_email returns the email marked primary and confirmed."""- from openhands.integrations.bitbucket.service.base import BitBucketMixinBase+ from openhands.app_server.integrations.bitbucket.service.base import (+ BitBucketMixinBase,+ )emails = [{'email': '[email protected]', 'is_primary': False, 'is_confirmed': True},@@ -396,7 +410,9 @@ async def test_resolve_primary_email_selects_primary_confirmed():@pytest.mark.asyncioasync def test_resolve_primary_email_returns_none_when_no_primary():"""_resolve_primary_email returns None when no email is marked primary."""- from openhands.integrations.bitbucket.service.base import BitBucketMixinBase+ from openhands.app_server.integrations.bitbucket.service.base import (+ BitBucketMixinBase,+ )emails = [{'email': '[email protected]', 'is_primary': False, 'is_confirmed': True},@@ -409,7 +425,9 @@ async def test_resolve_primary_email_returns_none_when_no_primary():@pytest.mark.asyncioasync def test_resolve_primary_email_returns_none_when_primary_not_confirmed():"""_resolve_primary_email returns None when primary email is not confirmed."""- from openhands.integrations.bitbucket.service.base import BitBucketMixinBase+ from openhands.app_server.integrations.bitbucket.service.base import (+ BitBucketMixinBase,+ )emails = [{'email': '[email protected]', 'is_primary': True, 'is_confirmed': False},@@ -422,7 +440,9 @@ async def test_resolve_primary_email_returns_none_when_primary_not_confirmed():@pytest.mark.asyncioasync def test_resolve_primary_email_returns_none_for_empty_list():"""_resolve_primary_email returns None for an empty list."""- from openhands.integrations.bitbucket.service.base import BitBucketMixinBase+ from openhands.app_server.integrations.bitbucket.service.base import (+ BitBucketMixinBase,+ )result = BitBucketMixinBase._resolve_primary_email([])assert result is Nonediff --git a/tests/unit/integrations/bitbucket/test_bitbucket_branches.py b/tests/unit/integrations/bitbucket/test_bitbucket_branches.pyindex 61574aa324..cbd295611e 100644--- a/tests/unit/integrations/bitbucket/test_bitbucket_branches.py+++ b/tests/unit/integrations/bitbucket/test_bitbucket_branches.py@@ -3,8 +3,13 @@ from unittest.mock import patchimport pytestfrom pydantic import SecretStr-from openhands.integrations.bitbucket.bitbucket_service import BitBucketService-from openhands.integrations.service_types import Branch, PaginatedBranchesResponse+from openhands.app_server.integrations.bitbucket.bitbucket_service import (+ BitBucketService,+)+from openhands.app_server.integrations.service_types import (+ Branch,+ PaginatedBranchesResponse,+)@pytest.mark.asynciodiff --git a/tests/unit/integrations/bitbucket/test_bitbucket_repos.py b/tests/unit/integrations/bitbucket/test_bitbucket_repos.pyindex 46cbfdd1b6..77ab4ec853 100644--- a/tests/unit/integrations/bitbucket/test_bitbucket_repos.py+++ b/tests/unit/integrations/bitbucket/test_bitbucket_repos.py@@ -5,9 +5,13 @@ from unittest.mock import patchimport pytestfrom pydantic import SecretStr-from openhands.integrations.bitbucket.bitbucket_service import BitBucketService-from openhands.integrations.service_types import OwnerType, Repository-from openhands.integrations.service_types import ProviderType as ServiceProviderType+from openhands.app_server.integrations.bitbucket.bitbucket_service import (+ BitBucketService,+)+from openhands.app_server.integrations.service_types import OwnerType, Repository+from openhands.app_server.integrations.service_types import (+ ProviderType as ServiceProviderType,+)from openhands.server.types import AppModediff --git a/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc.py b/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc.pyindex 8df2783cf9..43fded489f 100644--- a/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc.py+++ b/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc.py@@ -6,10 +6,10 @@ from unittest.mock import patchimport pytestfrom pydantic import SecretStr-from openhands.integrations.bitbucket_data_center.bitbucket_dc_service import (+from openhands.app_server.integrations.bitbucket_data_center.bitbucket_dc_service import (BitbucketDCService,)-from openhands.integrations.service_types import AuthenticationError, User+from openhands.app_server.integrations.service_types import AuthenticationError, Userfrom openhands.server.types import AppMode# ββ init / BASE_URL βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ@@ -143,7 +143,7 @@ async def test_get_user_raises_when_not_found():def test_resolve_primary_email_selects_primary_confirmed():- from openhands.integrations.bitbucket_data_center.service.base import (+ from openhands.app_server.integrations.bitbucket_data_center.service.base import (BitbucketDCMixinBase,)@@ -161,7 +161,7 @@ def test_resolve_primary_email_selects_primary_confirmed():def test_resolve_primary_email_returns_none_when_no_primary():- from openhands.integrations.bitbucket_data_center.service.base import (+ from openhands.app_server.integrations.bitbucket_data_center.service.base import (BitbucketDCMixinBase,)@@ -174,7 +174,7 @@ def test_resolve_primary_email_returns_none_when_no_primary():def test_resolve_primary_email_returns_none_when_primary_not_confirmed():- from openhands.integrations.bitbucket_data_center.service.base import (+ from openhands.app_server.integrations.bitbucket_data_center.service.base import (BitbucketDCMixinBase,)@@ -187,7 +187,7 @@ def test_resolve_primary_email_returns_none_when_primary_not_confirmed():def test_resolve_primary_email_returns_none_for_empty_list():- from openhands.integrations.bitbucket_data_center.service.base import (+ from openhands.app_server.integrations.bitbucket_data_center.service.base import (BitbucketDCMixinBase,)diff --git a/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_branches.py b/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_branches.pyindex 2e829110a9..860b79d969 100644--- a/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_branches.py+++ b/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_branches.py@@ -5,10 +5,13 @@ from unittest.mock import patchimport pytestfrom pydantic import SecretStr-from openhands.integrations.bitbucket_data_center.bitbucket_dc_service import (+from openhands.app_server.integrations.bitbucket_data_center.bitbucket_dc_service import (BitbucketDCService,)-from openhands.integrations.service_types import Branch, PaginatedBranchesResponse+from openhands.app_server.integrations.service_types import (+ Branch,+ PaginatedBranchesResponse,+)def make_service():diff --git a/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_prs.py b/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_prs.pyindex ad217821d6..6a9e3cde06 100644--- a/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_prs.py+++ b/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_prs.py@@ -5,7 +5,7 @@ from unittest.mock import AsyncMock, patchimport pytestfrom pydantic import SecretStr-from openhands.integrations.bitbucket_data_center.bitbucket_dc_service import (+from openhands.app_server.integrations.bitbucket_data_center.bitbucket_dc_service import (BitbucketDCService,)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 1196fad5aa..03b608f7de 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,7 +5,7 @@ from unittest.mock import AsyncMock, patchimport pytestfrom pydantic import SecretStr-from openhands.integrations.bitbucket_data_center.bitbucket_dc_service import (+from openhands.app_server.integrations.bitbucket_data_center.bitbucket_dc_service import (BitbucketDCService,)from openhands.server.types import AppModediff --git a/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_resolver.py b/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_resolver.pyindex fbc7078976..1e467f2b90 100644--- a/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_resolver.py+++ b/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_resolver.py@@ -5,10 +5,10 @@ from unittest.mock import patchimport pytestfrom pydantic import SecretStr-from openhands.integrations.bitbucket_data_center.bitbucket_dc_service import (+from openhands.app_server.integrations.bitbucket_data_center.bitbucket_dc_service import (BitbucketDCService,)-from openhands.integrations.service_types import Comment+from openhands.app_server.integrations.service_types import Comment@pytest.fixture@@ -160,10 +160,10 @@ def test_process_raw_comments_missing_timestamps(svc):def test_mro_includes_resolver_mixin_and_base_git_service():- from openhands.integrations.bitbucket_data_center.service.resolver import (+ from openhands.app_server.integrations.bitbucket_data_center.service.resolver import (BitbucketDCResolverMixin,)- from openhands.integrations.service_types import BaseGitService+ from openhands.app_server.integrations.service_types import BaseGitServicemro_names = [cls.__name__ for cls in BitbucketDCService.__mro__]assert 'BitbucketDCResolverMixin' in mro_namesdiff --git a/tests/unit/integrations/github/test_github_branches.py b/tests/unit/integrations/github/test_github_branches.pyindex 7aa010016f..e1d03738e6 100644--- a/tests/unit/integrations/github/test_github_branches.py+++ b/tests/unit/integrations/github/test_github_branches.py@@ -3,8 +3,11 @@ from unittest.mock import AsyncMock, patchimport pytestfrom pydantic import SecretStr-from openhands.integrations.github.github_service import GitHubService-from openhands.integrations.service_types import Branch, PaginatedBranchesResponse+from openhands.app_server.integrations.github.github_service import GitHubService+from openhands.app_server.integrations.service_types import (+ Branch,+ PaginatedBranchesResponse,+)@pytest.mark.asynciodiff --git a/tests/unit/integrations/github/test_github_service.py b/tests/unit/integrations/github/test_github_service.pyindex 79134d8e53..a18e4ace57 100644--- a/tests/unit/integrations/github/test_github_service.py+++ b/tests/unit/integrations/github/test_github_service.py@@ -4,8 +4,8 @@ import httpximport pytestfrom pydantic import SecretStr-from openhands.integrations.github.github_service import GitHubService-from openhands.integrations.service_types import (+from openhands.app_server.integrations.github.github_service import GitHubService+from openhands.app_server.integrations.service_types import (AuthenticationError,OwnerType,ProviderType,@@ -408,7 +408,7 @@ async def test_github_service_graphql_url_enterprise_server():@pytest.mark.asyncioasync def test_resolve_primary_email_selects_primary_verified():"""_resolve_primary_email returns the email marked primary and verified."""- from openhands.integrations.github.service.base import GitHubMixinBase+ from openhands.app_server.integrations.github.service.base import GitHubMixinBaseemails = [{'email': '[email protected]', 'primary': False, 'verified': True},@@ -422,7 +422,7 @@ async def test_resolve_primary_email_selects_primary_verified():@pytest.mark.asyncioasync def test_resolve_primary_email_returns_none_when_no_primary():"""_resolve_primary_email returns None when no email is marked primary."""- from openhands.integrations.github.service.base import GitHubMixinBase+ from openhands.app_server.integrations.github.service.base import GitHubMixinBaseemails = [{'email': '[email protected]', 'primary': False, 'verified': True},@@ -435,7 +435,7 @@ async def test_resolve_primary_email_returns_none_when_no_primary():@pytest.mark.asyncioasync def test_resolve_primary_email_returns_none_when_primary_not_verified():"""_resolve_primary_email returns None when primary email is not verified."""- from openhands.integrations.github.service.base import GitHubMixinBase+ from openhands.app_server.integrations.github.service.base import GitHubMixinBaseemails = [{'email': '[email protected]', 'primary': True, 'verified': False},@@ -448,7 +448,7 @@ async def test_resolve_primary_email_returns_none_when_primary_not_verified():@pytest.mark.asyncioasync def test_resolve_primary_email_returns_none_for_empty_list():"""_resolve_primary_email returns None for an empty list."""- from openhands.integrations.github.service.base import GitHubMixinBase+ from openhands.app_server.integrations.github.service.base import GitHubMixinBaseresult = GitHubMixinBase._resolve_primary_email([])assert result is Nonediff --git a/tests/unit/integrations/github/test_suggested_tasks.py b/tests/unit/integrations/github/test_suggested_tasks.pyindex e786b03fa5..08d1db5756 100644--- a/tests/unit/integrations/github/test_suggested_tasks.py+++ b/tests/unit/integrations/github/test_suggested_tasks.py@@ -2,8 +2,8 @@ from unittest.mock import AsyncMockimport pytest-from openhands.integrations.github.github_service import GitHubService-from openhands.integrations.service_types import TaskType, User+from openhands.app_server.integrations.github.github_service import GitHubService+from openhands.app_server.integrations.service_types import TaskType, User@pytest.mark.asynciodiff --git a/tests/unit/integrations/gitlab/test_gitlab.py b/tests/unit/integrations/gitlab/test_gitlab.pyindex 363f7415bb..b0c63ca7ba 100644--- a/tests/unit/integrations/gitlab/test_gitlab.py+++ b/tests/unit/integrations/gitlab/test_gitlab.py@@ -6,11 +6,17 @@ from unittest.mock import patchimport pytestfrom pydantic import SecretStr-from openhands.integrations import provider as provider_module-from openhands.integrations.gitlab import constants as gitlab_constants_module-from openhands.integrations.gitlab.constants import GITLAB_HOST-from openhands.integrations.gitlab.gitlab_service import GitLabService-from openhands.integrations.service_types import OwnerType, ProviderType, Repository+from openhands.app_server.integrations import provider as provider_module+from openhands.app_server.integrations.gitlab import (+ constants as gitlab_constants_module,+)+from openhands.app_server.integrations.gitlab.constants import GITLAB_HOST+from openhands.app_server.integrations.gitlab.gitlab_service import GitLabService+from openhands.app_server.integrations.service_types import (+ OwnerType,+ ProviderType,+ Repository,+)from openhands.server.types import AppModediff --git a/tests/unit/integrations/gitlab/test_gitlab_branches.py b/tests/unit/integrations/gitlab/test_gitlab_branches.pyindex c23f86d53a..258afbf1aa 100644--- a/tests/unit/integrations/gitlab/test_gitlab_branches.py+++ b/tests/unit/integrations/gitlab/test_gitlab_branches.py@@ -3,8 +3,11 @@ from unittest.mock import patchimport pytestfrom pydantic import SecretStr-from openhands.integrations.gitlab.gitlab_service import GitLabService-from openhands.integrations.service_types import Branch, PaginatedBranchesResponse+from openhands.app_server.integrations.gitlab.gitlab_service import GitLabService+from openhands.app_server.integrations.service_types import (+ Branch,+ PaginatedBranchesResponse,+)@pytest.mark.asynciodiff --git a/tests/unit/integrations/protocols/test_http_client.py b/tests/unit/integrations/protocols/test_http_client.pyindex c6ce529c9d..e08153fc46 100644--- a/tests/unit/integrations/protocols/test_http_client.py+++ b/tests/unit/integrations/protocols/test_http_client.py@@ -7,8 +7,8 @@ import httpximport pytestfrom pydantic import SecretStr-from openhands.integrations.protocols.http_client import HTTPClient-from openhands.integrations.service_types import (+from openhands.app_server.integrations.protocols.http_client import HTTPClient+from openhands.app_server.integrations.service_types import (AuthenticationError,ProviderTimeoutError,RateLimitError,@@ -223,7 +223,7 @@ class TestHTTPClient:def test_runtime_checkable(self):"""Test that HTTPClient is runtime checkable."""- from openhands.integrations.protocols.http_client import HTTPClient+ from openhands.app_server.integrations.protocols.http_client import HTTPClient# Test that our testable client implements the protocolassert isinstance(self.client, HTTPClient)diff --git a/tests/unit/integrations/test_provider_immutability.py b/tests/unit/integrations/test_provider_immutability.pyindex 0f82fc2c3e..131ce3f404 100644--- a/tests/unit/integrations/test_provider_immutability.py+++ b/tests/unit/integrations/test_provider_immutability.py@@ -4,13 +4,13 @@ from unittest.mock import AsyncMock, patchimport pytestfrom pydantic import SecretStr, ValidationError-from openhands.app_server.secrets.secrets_models import Secrets-from openhands.app_server.settings.settings_models import Settings-from openhands.integrations.provider import (+from openhands.app_server.integrations.provider import (ProviderHandler,ProviderToken,ProviderType,)+from openhands.app_server.secrets.secrets_models import Secrets+from openhands.app_server.settings.settings_models import Settingsdef test_provider_token_immutability():diff --git a/tests/unit/server/routes/test_mcp_routes.py b/tests/unit/server/routes/test_mcp_routes.pyindex 7aebc7ca27..96cb93cd70 100644--- a/tests/unit/server/routes/test_mcp_routes.py+++ b/tests/unit/server/routes/test_mcp_routes.py@@ -3,8 +3,8 @@ from unittest.mock import AsyncMock, patchimport pytest+from openhands.app_server.integrations.service_types import GitServicefrom openhands.app_server.mcp.mcp_router import get_conversation_link-from openhands.integrations.service_types import GitServicefrom openhands.server.types import AppModediff --git a/tests/unit/server/routes/test_skills_api.py b/tests/unit/server/routes/test_skills_api.pyindex b599fc8e91..cf6aeec2fb 100644--- a/tests/unit/server/routes/test_skills_api.py+++ b/tests/unit/server/routes/test_skills_api.py@@ -8,12 +8,12 @@ from fastapi.testclient import TestClientfrom pydantic import SecretStrfrom openhands.app_server.file_store.memory import InMemoryFileStore+from openhands.app_server.integrations.provider import ProviderToken, ProviderType+from openhands.app_server.integrations.service_types import UserGitInfofrom openhands.app_server.secrets.secrets_models import Secretsfrom openhands.app_server.secrets.secrets_store import SecretsStorefrom openhands.app_server.settings.file_settings_store import FileSettingsStorefrom openhands.app_server.settings.settings_store import SettingsStore-from openhands.integrations.provider import ProviderToken, ProviderType-from openhands.integrations.service_types import UserGitInfofrom openhands.server.app import appfrom openhands.server.user_auth.user_auth import UserAuthdiff --git a/tests/unit/server/test_openapi_schema_generation.py b/tests/unit/server/test_openapi_schema_generation.pyindex 8edc499ca8..99f3720a1e 100644--- a/tests/unit/server/test_openapi_schema_generation.py+++ b/tests/unit/server/test_openapi_schema_generation.py@@ -7,12 +7,12 @@ from fastapi.testclient import TestClientfrom pydantic import SecretStrfrom openhands.app_server.file_store.memory import InMemoryFileStore+from openhands.app_server.integrations.provider import ProviderToken, ProviderType+from openhands.app_server.integrations.service_types import UserGitInfofrom openhands.app_server.secrets.secrets_models import Secretsfrom openhands.app_server.secrets.secrets_store import SecretsStorefrom openhands.app_server.settings.file_settings_store import FileSettingsStorefrom openhands.app_server.settings.settings_store import SettingsStore-from openhands.integrations.provider import ProviderToken, ProviderType-from openhands.integrations.service_types import UserGitInfofrom openhands.server.app import appfrom openhands.server.user_auth.user_auth import UserAuthdiff --git a/tests/unit/storage/data_models/test_secret_store.py b/tests/unit/storage/data_models/test_secret_store.pyindex e64a0657c1..49b74c0791 100644--- a/tests/unit/storage/data_models/test_secret_store.py+++ b/tests/unit/storage/data_models/test_secret_store.py@@ -5,12 +5,12 @@ from typing import Anyfrom pydantic import SecretStr-from openhands.app_server.secrets.secrets_models import Secrets-from openhands.integrations.provider import (+from openhands.app_server.integrations.provider import (CustomSecret,ProviderToken,ProviderType,)+from openhands.app_server.secrets.secrets_models import Secretsclass TestSecrets:diff --git a/tests/unit/test_azure_devops.py b/tests/unit/test_azure_devops.pyindex 32d275c91f..1fbe6c694d 100644--- a/tests/unit/test_azure_devops.py+++ b/tests/unit/test_azure_devops.py@@ -2,10 +2,10 @@ from unittest.mock import AsyncMock, MagicMock, patchimport pytest-from openhands.integrations.azure_devops.azure_devops_service import (+from openhands.app_server.integrations.azure_devops.azure_devops_service import (AzureDevOpsServiceImpl as AzureDevOpsService,)-from openhands.integrations.service_types import ProviderType+from openhands.app_server.integrations.service_types import ProviderType@pytest.mark.asynciodiff --git a/tests/unit/test_forgejo_service.py b/tests/unit/test_forgejo_service.pyindex d14e9fd755..e3fc69941c 100644--- a/tests/unit/test_forgejo_service.py+++ b/tests/unit/test_forgejo_service.py@@ -4,8 +4,8 @@ import httpximport pytestfrom pydantic import SecretStr-from openhands.integrations.forgejo.forgejo_service import ForgejoService-from openhands.integrations.service_types import (+from openhands.app_server.integrations.forgejo.forgejo_service import ForgejoService+from openhands.app_server.integrations.service_types import (ProviderType,Repository,RequestMethod,