Skip to content

πŸ™Œ OpenHands: AI-Driven Development

refactor: move openhands.integrations to openhands.app_server.integrations (#14195)

Tim O'Farrell5b500d640a86
diff --git a/AGENTS.md b/AGENTS.md
index 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.py
index 24e7f7ea32..391815855e 100644
--- a/enterprise/integrations/bitbucket/bitbucket_service.py
+++ b/enterprise/integrations/bitbucket/bitbucket_service.py
@@ -1,9 +1,11 @@
from pydantic import SecretStr
from server.auth.token_manager import TokenManager
+from openhands.app_server.integrations.bitbucket.bitbucket_service import (
+ BitBucketService,
+)
+from openhands.app_server.integrations.service_types import ProviderType
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.bitbucket.bitbucket_service import BitBucketService
-from openhands.integrations.service_types import ProviderType
class SaaSBitBucketService(BitBucketService):
diff --git a/enterprise/integrations/bitbucket_data_center/bitbucket_dc_service.py b/enterprise/integrations/bitbucket_data_center/bitbucket_dc_service.py
index 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 SecretStr
from 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 logger
class SaaSBitbucketDCService(BitbucketDCService):
diff --git a/enterprise/integrations/github/data_collector.py b/enterprise/integrations/github/data_collector.py
index 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 OpenhandsPRStore
from openhands.app_server.conversation_paths import get_conversation_dir
from 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 ProviderType
from openhands.core.config import load_openhands_config
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.github.github_service import GithubServiceImpl
-from openhands.integrations.service_types import ProviderType
config = 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.py
index 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 ExpiredError
from server.auth.constants import GITHUB_APP_CLIENT_ID, GITHUB_APP_PRIVATE_KEY
from server.auth.token_manager import TokenManager
+from openhands.app_server.integrations.provider import ProviderToken, ProviderType
+from openhands.app_server.integrations.service_types import AuthenticationError
from openhands.app_server.secrets.secrets_models import Secrets
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.provider import ProviderToken, ProviderType
-from openhands.integrations.service_types import AuthenticationError
from openhands.server.types import (
LLMAuthenticationError,
MissingSettingsError,
diff --git a/enterprise/integrations/github/github_service.py b/enterprise/integrations/github/github_service.py
index 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_db
from pydantic import SecretStr
from 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, Repository
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.github.github_service import GitHubService
-from openhands.integrations.service_types import ProviderType, Repository
from openhands.server.types import AppMode
diff --git a/enterprise/integrations/github/github_view.py b/enterprise/integrations/github/github_view.py
index 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 Comment
from openhands.app_server.services.injector import InjectorState
from openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTR
from 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 Comment
from openhands.sdk import TextContent
from openhands.server.user_auth.user_auth import UserAuth
from openhands.utils.async_utils import call_sync_from_async
diff --git a/enterprise/integrations/gitlab/gitlab_manager.py b/enterprise/integrations/gitlab/gitlab_manager.py
index 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, FileSystemLoader
from pydantic import SecretStr
from server.auth.token_manager import TokenManager
+from openhands.app_server.integrations.gitlab.gitlab_service import GitLabServiceImpl
+from openhands.app_server.integrations.provider import ProviderToken, ProviderType
from openhands.app_server.secrets.secrets_models import Secrets
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.gitlab.gitlab_service import GitLabServiceImpl
-from openhands.integrations.provider import ProviderToken, ProviderType
from openhands.server.types import (
LLMAuthenticationError,
MissingSettingsError,
diff --git a/enterprise/integrations/gitlab/gitlab_service.py b/enterprise/integrations/gitlab/gitlab_service.py
index 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 TokenManager
from storage.gitlab_webhook import GitlabWebhook, WebhookStatus
from 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 logger
from openhands.server.types import AppMode
diff --git a/enterprise/integrations/gitlab/gitlab_view.py b/enterprise/integrations/gitlab/gitlab_view.py
index 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 Comment
from openhands.app_server.services.injector import InjectorState
from openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTR
from 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 Comment
from openhands.sdk import TextContent
from openhands.server.user_auth.user_auth import UserAuth
diff --git a/enterprise/integrations/jira/jira_view.py b/enterprise/integrations/jira/jira_view.py
index 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, ProviderType
from openhands.app_server.services.injector import InjectorState
from openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTR
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.provider import ProviderHandler, ProviderType
from openhands.sdk import TextContent
from openhands.server.user_auth.user_auth import UserAuth
from openhands.utils.http_session import httpx_verify_option
diff --git a/enterprise/integrations/jira_dc/jira_dc_manager.py b/enterprise/integrations/jira_dc/jira_dc_manager.py
index 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 JiraDcIntegrationStore
from storage.jira_dc_user import JiraDcUser
from storage.jira_dc_workspace import JiraDcWorkspace
+from openhands.app_server.integrations.provider import ProviderHandler
+from openhands.app_server.integrations.service_types import Repository
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.provider import ProviderHandler
-from openhands.integrations.service_types import Repository
from openhands.server.shared import server_config
from openhands.server.types import (
LLMAuthenticationError,
diff --git a/enterprise/integrations/jira_dc/jira_dc_view.py b/enterprise/integrations/jira_dc/jira_dc_view.py
index 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, ProviderType
from openhands.app_server.services.injector import InjectorState
from openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTR
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.provider import ProviderHandler, ProviderType
from openhands.sdk import TextContent
from openhands.server.user_auth.user_auth import UserAuth
diff --git a/enterprise/integrations/resolver_context.py b/enterprise/integrations/resolver_context.py
index 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, UserGitInfo
from openhands.app_server.user.user_context import UserContext
from openhands.app_server.user.user_models import UserInfo
-from openhands.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderHandler
-from openhands.integrations.service_types import ProviderType, UserGitInfo
from openhands.sdk.secret import SecretSource, StaticSecret
from openhands.server.user_auth.user_auth import UserAuth
diff --git a/enterprise/integrations/slack/slack_manager.py b/enterprise/integrations/slack/slack_manager.py
index d691706b78..58b8903234 100644
--- a/enterprise/integrations/slack/slack_manager.py
+++ b/enterprise/integrations/slack/slack_manager.py
@@ -30,13 +30,13 @@ from sqlalchemy import select
from storage.database import a_session_maker
from 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 logger
from openhands.server.shared import config, server_config, sio
from openhands.server.types import (
LLMAuthenticationError,
diff --git a/enterprise/integrations/slack/slack_view.py b/enterprise/integrations/slack/slack_view.py
index 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 ProviderHandler
from openhands.app_server.sandbox.sandbox_models import SandboxStatus
from openhands.app_server.services.injector import InjectorState
from openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTR
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.provider import ProviderHandler
from openhands.sdk import TextContent
from openhands.server.user_auth.user_auth import UserAuth
from openhands.utils.async_utils import GENERAL_TIMEOUT
diff --git a/enterprise/integrations/store_repo_utils.py b/enterprise/integrations/store_repo_utils.py
index 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 StoredRepository
from storage.user_repo_map import UserRepositoryMap
from storage.user_repo_map_store import UserRepositoryMapStore
+from openhands.app_server.integrations.service_types import Repository
from openhands.core.config.openhands_config import OpenHandsConfig
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.service_types import Repository
async def store_repositories_in_db(repos: list[Repository], user_id: str) -> None:
diff --git a/enterprise/integrations/types.py b/enterprise/integrations/types.py
index 4de80c8a0d..80a1242495 100644
--- a/enterprise/integrations/types.py
+++ b/enterprise/integrations/types.py
@@ -9,7 +9,7 @@ from pydantic import BaseModel
if TYPE_CHECKING:
from integrations.models import Message
- from openhands.integrations.provider import PROVIDER_TOKEN_TYPE
+ from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPE
from openhands.server.user_auth.user_auth import UserAuth
diff --git a/enterprise/integrations/utils.py b/enterprise/integrations/utils.py
index 0bf8ef5880..8f047ef31d 100644
--- a/enterprise/integrations/utils.py
+++ b/enterprise/integrations/utils.py
@@ -6,7 +6,7 @@ import re
from jinja2 import Environment, FileSystemLoader
from 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.py
index 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_HOST
GITHUB_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.py
index 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 SaaSGitHubService
from pydantic import SecretStr
from server.auth.auth_utils import user_verifier
+from openhands.app_server.integrations.github.github_types import GitHubUser
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.github.github_types import GitHubUser
def is_user_allowed(user_login: str):
diff --git a/enterprise/server/auth/gitlab_sync.py b/enterprise/server/auth/gitlab_sync.py
index c1615f9dbf..966a2b377d 100644
--- a/enterprise/server/auth/gitlab_sync.py
+++ b/enterprise/server/auth/gitlab_sync.py
@@ -3,8 +3,8 @@ import asyncio
from pydantic import SecretStr
from sqlalchemy import select
+from openhands.app_server.integrations.service_types import ProviderType
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.service_types import ProviderType
from 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 SaaSGitLabService
diff --git a/enterprise/server/auth/saas_user_auth.py b/enterprise/server/auth/saas_user_auth.py
index 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 UserAuthorizationStore
from storage.user_store import UserStore
from 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 SettingsStore
from openhands.server.user_auth.user_auth import AuthType, UserAuth
token_manager = TokenManager()
diff --git a/enterprise/server/auth/token_manager.py b/enterprise/server/auth/token_manager.py
index 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 GithubAppInstallation
from storage.offline_token_store import OfflineTokenStore
from 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 ProviderType
from openhands.server.types import SessionExpiredError
from openhands.utils.http_session import httpx_verify_option
diff --git a/enterprise/server/config.py b/enterprise/server/config.py
index 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 ProviderType
from openhands.core.config.utils import load_openhands_config
-from openhands.integrations.service_types import ProviderType
from openhands.server.config.server_config import ServerConfig
from openhands.server.types import AppMode
diff --git a/enterprise/server/models/user_models.py b/enterprise/server/models/user_models.py
index 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 ProviderType
from openhands.app_server.user.user_models import UserInfo
-from openhands.integrations.service_types import ProviderType
class SaasUserInfo(UserInfo):
diff --git a/enterprise/server/routes/auth.py b/enterprise/server/routes/auth.py
index 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_maker
from storage.user import User
from storage.user_store import UserStore
+from openhands.app_server.integrations.provider import ProviderHandler
+from openhands.app_server.integrations.service_types import ProviderType, TokenResponse
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.provider import ProviderHandler
-from openhands.integrations.service_types import ProviderType, TokenResponse
from openhands.server.services.conversation_service import create_provider_tokens_object
from openhands.server.shared import config
from openhands.server.user_auth import get_access_token
diff --git a/enterprise/server/routes/integration/github.py b/enterprise/server/routes/integration/github.py
index 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 TokenManager
from server.services.automation_event_service import AutomationEventService
+from openhands.app_server.integrations.provider import ProviderType
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.provider import ProviderType
# Environment variable to disable GitHub webhooks
GITHUB_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.py
index 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 TokenManager
from storage.gitlab_webhook import GitlabWebhook
from storage.gitlab_webhook_store import GitlabWebhookStore
+from openhands.app_server.integrations.gitlab.gitlab_service import GitLabServiceImpl
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.gitlab.gitlab_service import GitLabServiceImpl
from openhands.server.shared import sio
from openhands.server.user_auth import get_user_id
diff --git a/enterprise/server/routes/integration/slack.py b/enterprise/server/routes/integration/slack.py
index 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 SlackTeamStore
from storage.slack_user import SlackUser
from 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, sio
signature_verifier = SignatureVerifier(signing_secret=SLACK_SIGNING_SECRET)
diff --git a/enterprise/server/routes/users_v1.py b/enterprise/server/routes/users_v1.py
index 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 ProviderType
from openhands.app_server.sandbox.session_auth import validate_session_key_ownership
from openhands.app_server.user.auth_user_context import AuthUserContext
from openhands.app_server.user.user_context import UserContext
from 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.py
index 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 ProviderType
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.provider import ProviderType
from openhands.server.shared import sio
# Cache TTL constants
diff --git a/enterprise/server/sharing/shared_conversation_models.py b/enterprise/server/sharing/shared_conversation_models.py
index 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 issues
diff --git a/enterprise/server/sharing/sql_shared_conversation_info_service.py b/enterprise/server/sharing/sql_shared_conversation_info_service.py
index 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_now
from openhands.app_server.app_conversation.sql_app_conversation_info_service import (
StoredConversationMetadata,
)
+from openhands.app_server.integrations.provider import ProviderType
from openhands.app_server.services.injector import InjectorState
-from openhands.integrations.provider import ProviderType
from openhands.sdk.llm import MetricsSnapshot, TokenUsage
logger = logging.getLogger(__name__)
diff --git a/enterprise/storage/auth_token_store.py b/enterprise/storage/auth_token_store.py
index 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 OperationalError
from storage.auth_tokens import AuthTokens
from storage.database import a_session_maker
+from openhands.app_server.integrations.service_types import ProviderType
from 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. The
diff --git a/enterprise/storage/openhands_pr_store.py b/enterprise/storage/openhands_pr_store.py
index 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, select
from storage.database import a_session_maker
from storage.openhands_pr import OpenhandsPR
+from openhands.app_server.integrations.service_types import ProviderType
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.service_types import ProviderType
class OpenhandsPRStore:
diff --git a/enterprise/storage/proactive_conversation_store.py b/enterprise/storage/proactive_conversation_store.py
index 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, update
from storage.database import a_session_maker
from storage.proactive_convos import ProactiveConversation
+from openhands.app_server.integrations.service_types import ProviderType
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.service_types import ProviderType
@dataclass
diff --git a/enterprise/sync/install_gitlab_webhooks.py b/enterprise/sync/install_gitlab_webhooks.py
index 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_maker
from storage.gitlab_webhook import GitlabWebhook, WebhookStatus
from storage.gitlab_webhook_store import GitlabWebhookStore
+from openhands.app_server.integrations.gitlab.gitlab_service import GitLabServiceImpl
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.gitlab.gitlab_service import GitLabServiceImpl
if TYPE_CHECKING:
from integrations.gitlab.gitlab_service import SaaSGitLabService
diff --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.py
index 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 True
diff --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.py
index 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.py
index 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 JiraConversation
from storage.jira_user import JiraUser
from storage.jira_workspace import JiraWorkspace
-from openhands.integrations.service_types import ProviderType, Repository
+from openhands.app_server.integrations.service_types import ProviderType, Repository
from openhands.server.user_auth.user_auth import UserAuth
diff --git a/enterprise/tests/unit/integrations/jira_dc/conftest.py b/enterprise/tests/unit/integrations/jira_dc/conftest.py
index 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 JiraDcConversation
from storage.jira_dc_user import JiraDcUser
from storage.jira_dc_workspace import JiraDcWorkspace
-from openhands.integrations.service_types import ProviderType, Repository
+from openhands.app_server.integrations.service_types import ProviderType, Repository
from openhands.server.user_auth.user_auth import UserAuth
diff --git a/enterprise/tests/unit/integrations/jira_dc/test_jira_dc_manager.py b/enterprise/tests/unit/integrations/jira_dc/test_jira_dc_manager.py
index 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, Repository
from 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.py
index 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 pytest
from pydantic import SecretStr
from 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 testing
from 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 ProviderHandler
assert isinstance(handler, ProviderHandler)
assert handler.provider_tokens == provider_tokens
diff --git a/enterprise/tests/unit/server/services/test_automation_event_service.py b/enterprise/tests/unit/server/services/test_automation_event_service.py
index 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, patch
import pytest
-from openhands.integrations.service_types import ProviderType
+from openhands.app_server.integrations.service_types import ProviderType
# Default patches for constants
CONSTANT_PATCHES = {
diff --git a/enterprise/tests/unit/storage/test_auth_token_store.py b/enterprise/tests/unit/storage/test_auth_token_store.py
index 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 AuthTokens
from storage.base import Base
-from openhands.integrations.service_types import ProviderType
+from openhands.app_server.integrations.service_types import ProviderType
@pytest.fixture
diff --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.py
index 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 ProviderType
from openhands.app_server.user.specifiy_user_context import SpecifyUserContext
-from openhands.integrations.service_types import ProviderType
# Test UUIDs
USER1_ID = UUID('a1111111-1111-1111-1111-111111111111')
diff --git a/enterprise/tests/unit/test_auth_routes.py b/enterprise/tests/unit/test_auth_routes.py
index 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 ProviderType
def 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.py
index 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 SecretStr
from storage.saas_secrets_store import SaasSecretsStore
from storage.stored_custom_secrets import StoredCustomSecrets
+from openhands.app_server.integrations.provider import CustomSecret
from openhands.app_server.secrets.secrets_models import Secrets
from openhands.core.config.openhands_config import OpenHandsConfig
-from openhands.integrations.provider import CustomSecret
@pytest.fixture
diff --git a/enterprise/tests/unit/test_saas_user_auth.py b/enterprise/tests/unit/test_saas_user_auth.py
index 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 ApiKeyValidationResult
from storage.user_authorization import UserAuthorizationType
+from openhands.app_server.integrations.provider import ProviderToken, ProviderType
from openhands.app_server.secrets.secrets_models import Secrets
-from openhands.integrations.provider import ProviderToken, ProviderType
@pytest.fixture
diff --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.py
index 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 ProviderType
from openhands.app_server.user.specifiy_user_context import SpecifyUserContext
from openhands.app_server.utils.sql_utils import Base
-from openhands.integrations.provider import ProviderType
from openhands.sdk.llm import MetricsSnapshot, TokenUsage
diff --git a/enterprise/tests/unit/test_slack_integration.py b/enterprise/tests/unit/test_slack_integration.py
index 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 SlackNewConversationView
from 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.py
index 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, patch
import pytest
from 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.fixture
diff --git a/enterprise/tests/unit/test_user_git_organizations.py b/enterprise/tests/unit/test_user_git_organizations.py
index 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 pytest
from fastapi import HTTPException, status
from pydantic import SecretStr
+from openhands.app_server.integrations.provider import ProviderToken
+from openhands.app_server.integrations.service_types import ProviderType
from openhands.app_server.user.user_context import UserContext
-from openhands.integrations.provider import ProviderToken
-from openhands.integrations.service_types import ProviderType
def _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_value
setattr(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.py
index 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_now
from openhands.app_server.event_callback.event_callback_models import (
EventCallbackProcessor,
)
+from openhands.app_server.integrations.service_types import ProviderType, SuggestedTask
from openhands.app_server.sandbox.sandbox_models import SandboxStatus
# Import from new location and re-export for backward compatibility
from openhands.app_server.settings.settings_models import SandboxGroupingStrategy
-from openhands.integrations.service_types import ProviderType, SuggestedTask
from openhands.sdk.conversation import ConversationExecutionStatus
from openhands.sdk.llm import MetricsSnapshot
from openhands.sdk.plugin import PluginSource
diff --git a/openhands/app_server/app_conversation/live_status_app_conversation_service.py b/openhands/app_server/app_conversation/live_status_app_conversation_service.py
index 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 SuggestedTask
from 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 SuggestedTask
from openhands.sdk import Agent, AgentContext, LocalWorkspace
from openhands.sdk.agent.acp_agent import ACPAgent
from openhands.sdk.hooks import HookConfig
diff --git a/openhands/app_server/app_conversation/skill_loader.py b/openhands/app_server/app_conversation/skill_loader.py
index 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 logging
import httpx
from pydantic import BaseModel
+from openhands.app_server.integrations.provider import ProviderType
+from openhands.app_server.integrations.service_types import AuthenticationError
from openhands.app_server.sandbox.sandbox_models import SandboxInfo
from openhands.app_server.user.user_context import UserContext
-from openhands.integrations.provider import ProviderType
-from openhands.integrations.service_types import AuthenticationError
from 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.py
index 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 ProviderType
from openhands.app_server.services.injector import InjectorState
from openhands.app_server.user.user_context import UserContext
from openhands.app_server.utils.sql_utils import (
Base,
create_json_type_decorator,
)
-from openhands.integrations.provider import ProviderType
from openhands.sdk import ConversationStats
from openhands.sdk.event import ConversationStateUpdateEvent
from openhands.sdk.llm import MetricsSnapshot, TokenUsage
diff --git a/openhands/app_server/event_callback/webhook_router.py b/openhands/app_server/event_callback/webhook_router.py
index 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 EventCallb
from openhands.app_server.event_callback.set_title_callback_processor import (
SetTitleCallbackProcessor,
)
+from openhands.app_server.integrations.provider import ProviderType
from openhands.app_server.sandbox.sandbox_models import SandboxInfo
from openhands.app_server.services.injector import InjectorState
from 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 ProviderType
from openhands.sdk import ConversationExecutionStatus, Event
from openhands.sdk.event import ConversationStateUpdateEvent
from openhands.server.types import AppMode
diff --git a/openhands/app_server/git/git_models.py b/openhands/app_server/git/git_models.py
index 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 StrEnum
from 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.py
index 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 UserContext
from openhands.app_server.utils.dependencies import get_dependencies
from 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 SetAuthCookieMiddleware
diff --git a/openhands/integrations/azure_devops/azure_devops_service.py b/openhands/app_server/integrations/azure_devops/azure_devops_service.py
similarity index 92%
rename from openhands/integrations/azure_devops/azure_devops_service.py
rename to openhands/app_server/integrations/azure_devops/azure_devops_service.py
index 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 Any
import httpx
from 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 imports
diff --git a/openhands/integrations/azure_devops/service/__init__.py b/openhands/app_server/integrations/azure_devops/service/__init__.py
similarity index 100%
rename from openhands/integrations/azure_devops/service/__init__.py
rename to openhands/app_server/integrations/azure_devops/service/__init__.py
diff --git a/openhands/integrations/azure_devops/service/base.py b/openhands/app_server/integrations/azure_devops/service/base.py
similarity index 93%
rename from openhands/integrations/azure_devops/service/base.py
rename to openhands/app_server/integrations/azure_devops/service/base.py
index 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 quote
from 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.py
similarity index 97%
rename from openhands/integrations/azure_devops/service/branches.py
rename to openhands/app_server/integrations/azure_devops/service/branches.py
index 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.py
similarity index 97%
rename from openhands/integrations/azure_devops/service/features.py
rename to openhands/app_server/integrations/azure_devops/service/features.py
index 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.py
similarity index 98%
rename from openhands/integrations/azure_devops/service/prs.py
rename to openhands/app_server/integrations/azure_devops/service/prs.py
index 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, RequestMethod
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.azure_devops.service.base import AzureDevOpsMixinBase
-from openhands.integrations.service_types import Comment, RequestMethod
class AzureDevOpsPRsMixin(AzureDevOpsMixinBase):
diff --git a/openhands/integrations/azure_devops/service/repos.py b/openhands/app_server/integrations/azure_devops/service/repos.py
similarity index 97%
rename from openhands/integrations/azure_devops/service/repos.py
rename to openhands/app_server/integrations/azure_devops/service/repos.py
index 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, Repository
from openhands.server.types import AppMode
diff --git a/openhands/integrations/azure_devops/service/resolver.py b/openhands/app_server/integrations/azure_devops/service/resolver.py
similarity index 97%
rename from openhands/integrations/azure_devops/service/resolver.py
rename to openhands/app_server/integrations/azure_devops/service/resolver.py
index 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 Comment
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.azure_devops.service.base import AzureDevOpsMixinBase
-from openhands.integrations.service_types import Comment
class AzureDevOpsResolverMixin(AzureDevOpsMixinBase):
diff --git a/openhands/integrations/azure_devops/service/work_items.py b/openhands/app_server/integrations/azure_devops/service/work_items.py
similarity index 96%
rename from openhands/integrations/azure_devops/service/work_items.py
rename to openhands/app_server/integrations/azure_devops/service/work_items.py
index 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, RequestMethod
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.azure_devops.service.base import AzureDevOpsMixinBase
-from openhands.integrations.service_types import Comment, RequestMethod
class AzureDevOpsWorkItemsMixin(AzureDevOpsMixinBase):
diff --git a/openhands/integrations/bitbucket/bitbucket_service.py b/openhands/app_server/integrations/bitbucket/bitbucket_service.py
similarity index 92%
rename from openhands/integrations/bitbucket/bitbucket_service.py
rename to openhands/app_server/integrations/bitbucket/bitbucket_service.py
index f36beb270a..49b132ee4e 100644
--- a/openhands/integrations/bitbucket/bitbucket_service.py
+++ b/openhands/app_server/integrations/bitbucket/bitbucket_service.py
@@ -2,12 +2,12 @@ import os
from 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 imports
diff --git a/openhands/integrations/bitbucket/service/__init__.py b/openhands/app_server/integrations/bitbucket/service/__init__.py
similarity index 100%
rename from openhands/integrations/bitbucket/service/__init__.py
rename to openhands/app_server/integrations/bitbucket/service/__init__.py
diff --git a/openhands/integrations/bitbucket/service/base.py b/openhands/app_server/integrations/bitbucket/service/base.py
similarity index 98%
rename from openhands/integrations/bitbucket/service/base.py
rename to openhands/app_server/integrations/bitbucket/service/base.py
index 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 Any
import httpx
from 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 logger
from openhands.utils.http_session import httpx_verify_option
diff --git a/openhands/integrations/bitbucket/service/branches.py b/openhands/app_server/integrations/bitbucket/service/branches.py
similarity index 95%
rename from openhands/integrations/bitbucket/service/branches.py
rename to openhands/app_server/integrations/bitbucket/service/branches.py
index 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.py
similarity index 95%
rename from openhands/integrations/bitbucket/service/prs.py
rename to openhands/app_server/integrations/bitbucket/service/prs.py
index 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 RequestMethod
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.bitbucket.service.base import BitBucketMixinBase
-from openhands.integrations.service_types import RequestMethod
class BitBucketPRsMixin(BitBucketMixinBase):
diff --git a/openhands/integrations/bitbucket/service/repos.py b/openhands/app_server/integrations/bitbucket/service/repos.py
similarity index 98%
rename from openhands/integrations/bitbucket/service/repos.py
rename to openhands/app_server/integrations/bitbucket/service/repos.py
index 5b29742b8d..0c0bba9667 100644
--- a/openhands/integrations/bitbucket/service/repos.py
+++ b/openhands/app_server/integrations/bitbucket/service/repos.py
@@ -2,8 +2,8 @@ import re
from typing import Any
from 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, SuggestedTask
from openhands.server.types import AppMode
diff --git a/openhands/integrations/bitbucket_data_center/bitbucket_dc_service.py b/openhands/app_server/integrations/bitbucket_data_center/bitbucket_dc_service.py
similarity index 93%
rename from openhands/integrations/bitbucket_data_center/bitbucket_dc_service.py
rename to openhands/app_server/integrations/bitbucket_data_center/bitbucket_dc_service.py
index 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 os
from 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 imports
diff --git a/openhands/integrations/bitbucket_data_center/service/__init__.py b/openhands/app_server/integrations/bitbucket_data_center/service/__init__.py
similarity index 100%
rename from openhands/integrations/bitbucket_data_center/service/__init__.py
rename to openhands/app_server/integrations/bitbucket_data_center/service/__init__.py
diff --git a/openhands/integrations/bitbucket_data_center/service/base.py b/openhands/app_server/integrations/bitbucket_data_center/service/base.py
similarity index 98%
rename from openhands/integrations/bitbucket_data_center/service/base.py
rename to openhands/app_server/integrations/bitbucket_data_center/service/base.py
index 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 Any
import httpx
from 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 logger
from openhands.utils.http_session import httpx_verify_option
diff --git a/openhands/integrations/bitbucket_data_center/service/branches.py b/openhands/app_server/integrations/bitbucket_data_center/service/branches.py
similarity index 96%
rename from openhands/integrations/bitbucket_data_center/service/branches.py
rename to openhands/app_server/integrations/bitbucket_data_center/service/branches.py
index 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.py
similarity index 96%
rename from openhands/integrations/bitbucket_data_center/service/prs.py
rename to openhands/app_server/integrations/bitbucket_data_center/service/prs.py
index 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 logger
class BitbucketDCPRsMixin(BitbucketDCMixinBase):
diff --git a/openhands/integrations/bitbucket_data_center/service/repos.py b/openhands/app_server/integrations/bitbucket_data_center/service/repos.py
similarity index 97%
rename from openhands/integrations/bitbucket_data_center/service/repos.py
rename to openhands/app_server/integrations/bitbucket_data_center/service/repos.py
index 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 Any
from 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, SuggestedTask
from openhands.server.types import AppMode
diff --git a/openhands/integrations/bitbucket_data_center/service/resolver.py b/openhands/app_server/integrations/bitbucket_data_center/service/resolver.py
similarity index 96%
rename from openhands/integrations/bitbucket_data_center/service/resolver.py
rename to openhands/app_server/integrations/bitbucket_data_center/service/resolver.py
index 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 Comment
class BitbucketDCResolverMixin(BitbucketDCMixinBase):
diff --git a/openhands/integrations/forgejo/__init__.py b/openhands/app_server/integrations/forgejo/__init__.py
similarity index 100%
rename from openhands/integrations/forgejo/__init__.py
rename to openhands/app_server/integrations/forgejo/__init__.py
diff --git a/openhands/integrations/forgejo/forgejo_service.py b/openhands/app_server/integrations/forgejo/forgejo_service.py
similarity index 86%
rename from openhands/integrations/forgejo/forgejo_service.py
rename to openhands/app_server/integrations/forgejo/forgejo_service.py
index d34e27ac2c..6f32d8e04d 100644
--- a/openhands/integrations/forgejo/forgejo_service.py
+++ b/openhands/app_server/integrations/forgejo/forgejo_service.py
@@ -4,7 +4,7 @@ import os
from 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 GitService
from 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__.py
similarity index 100%
rename from openhands/integrations/forgejo/service/__init__.py
rename to openhands/app_server/integrations/forgejo/service/__init__.py
diff --git a/openhands/integrations/forgejo/service/base.py b/openhands/app_server/integrations/forgejo/service/base.py
similarity index 98%
rename from openhands/integrations/forgejo/service/base.py
rename to openhands/app_server/integrations/forgejo/service/base.py
index 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 urlparse
import httpx
from 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 logger
from openhands.utils.http_session import httpx_verify_option
diff --git a/openhands/integrations/forgejo/service/branches.py b/openhands/app_server/integrations/forgejo/service/branches.py
similarity index 92%
rename from openhands/integrations/forgejo/service/branches.py
rename to openhands/app_server/integrations/forgejo/service/branches.py
index 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.py
similarity index 66%
rename from openhands/integrations/forgejo/service/features.py
rename to openhands/app_server/integrations/forgejo/service/features.py
index 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 SuggestedTask
class ForgejoFeaturesMixin(ForgejoMixinBase):
diff --git a/openhands/integrations/forgejo/service/prs.py b/openhands/app_server/integrations/forgejo/service/prs.py
similarity index 93%
rename from openhands/integrations/forgejo/service/prs.py
rename to openhands/app_server/integrations/forgejo/service/prs.py
index 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 annotations
from 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, UnknownException
class ForgejoPRsMixin(ForgejoMixinBase):
diff --git a/openhands/integrations/forgejo/service/repos.py b/openhands/app_server/integrations/forgejo/service/repos.py
similarity index 95%
rename from openhands/integrations/forgejo/service/repos.py
rename to openhands/app_server/integrations/forgejo/service/repos.py
index 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 Repository
from openhands.server.types import AppMode
diff --git a/openhands/integrations/forgejo/service/resolver.py b/openhands/app_server/integrations/forgejo/service/resolver.py
similarity index 95%
rename from openhands/integrations/forgejo/service/resolver.py
rename to openhands/app_server/integrations/forgejo/service/resolver.py
index 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 annotations
from 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 Comment
class ForgejoResolverMixin(ForgejoMixinBase):
diff --git a/openhands/integrations/github/github_service.py b/openhands/app_server/integrations/github/github_service.py
similarity index 93%
rename from openhands/integrations/github/github_service.py
rename to openhands/app_server/integrations/github/github_service.py
index c56940a0af..4c453efe91 100644
--- a/openhands/integrations/github/github_service.py
+++ b/openhands/app_server/integrations/github/github_service.py
@@ -2,14 +2,14 @@ import os
from 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 imports
diff --git a/openhands/integrations/github/queries.py b/openhands/app_server/integrations/github/queries.py
similarity index 100%
rename from openhands/integrations/github/queries.py
rename to openhands/app_server/integrations/github/queries.py
diff --git a/openhands/integrations/github/service/__init__.py b/openhands/app_server/integrations/github/service/__init__.py
similarity index 86%
rename from openhands/integrations/github/service/__init__.py
rename to openhands/app_server/integrations/github/service/__init__.py
index 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__.py
from .base import GitHubMixinBase
from .branches_prs import GitHubBranchesMixin
diff --git a/openhands/integrations/github/service/base.py b/openhands/app_server/integrations/github/service/base.py
similarity index 97%
rename from openhands/integrations/github/service/base.py
rename to openhands/app_server/integrations/github/service/base.py
index 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, cast
import httpx
from 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 logger
from openhands.utils.http_session import httpx_verify_option
diff --git a/openhands/integrations/github/service/branches_prs.py b/openhands/app_server/integrations/github/service/branches_prs.py
similarity index 95%
rename from openhands/integrations/github/service/branches_prs.py
rename to openhands/app_server/integrations/github/service/branches_prs.py
index 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 logger
class GitHubBranchesMixin(GitHubMixinBase):
diff --git a/openhands/integrations/github/service/features.py b/openhands/app_server/integrations/github/service/features.py
similarity index 94%
rename from openhands/integrations/github/service/features.py
rename to openhands/app_server/integrations/github/service/features.py
index 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 logger
class GitHubFeaturesMixin(GitHubMixinBase):
diff --git a/openhands/integrations/github/service/prs.py b/openhands/app_server/integrations/github/service/prs.py
similarity index 96%
rename from openhands/integrations/github/service/prs.py
rename to openhands/app_server/integrations/github/service/prs.py
index 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 RequestMethod
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.github.service.base import GitHubMixinBase
-from openhands.integrations.service_types import RequestMethod
class GitHubPRsMixin(GitHubMixinBase):
diff --git a/openhands/integrations/github/service/repos.py b/openhands/app_server/integrations/github/service/repos.py
similarity index 98%
rename from openhands/integrations/github/service/repos.py
rename to openhands/app_server/integrations/github/service/repos.py
index 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, Repository
from openhands.server.types import AppMode
diff --git a/openhands/integrations/github/service/resolver.py b/openhands/app_server/integrations/github/service/resolver.py
similarity index 97%
rename from openhands/integrations/github/service/resolver.py
rename to openhands/app_server/integrations/github/service/resolver.py
index 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 datetime
from 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 logger
class GitHubResolverMixin(GitHubMixinBase):
diff --git a/openhands/integrations/gitlab/constants.py b/openhands/app_server/integrations/gitlab/constants.py
similarity index 100%
rename from openhands/integrations/gitlab/constants.py
rename to openhands/app_server/integrations/gitlab/constants.py
diff --git a/openhands/integrations/gitlab/gitlab_service.py b/openhands/app_server/integrations/gitlab/gitlab_service.py
similarity index 92%
rename from openhands/integrations/gitlab/gitlab_service.py
rename to openhands/app_server/integrations/gitlab/gitlab_service.py
index 144737e280..1a34518f87 100644
--- a/openhands/integrations/gitlab/gitlab_service.py
+++ b/openhands/app_server/integrations/gitlab/gitlab_service.py
@@ -2,15 +2,15 @@ import os
from 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 imports
diff --git a/openhands/integrations/gitlab/service/__init__.py b/openhands/app_server/integrations/gitlab/service/__init__.py
similarity index 86%
rename from openhands/integrations/gitlab/service/__init__.py
rename to openhands/app_server/integrations/gitlab/service/__init__.py
index 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__.py
from .base import GitLabMixinBase
from .branches import GitLabBranchesMixin
diff --git a/openhands/integrations/gitlab/service/base.py b/openhands/app_server/integrations/gitlab/service/base.py
similarity index 97%
rename from openhands/integrations/gitlab/service/base.py
rename to openhands/app_server/integrations/gitlab/service/base.py
index 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 Any
import httpx
from 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.py
similarity index 95%
rename from openhands/integrations/gitlab/service/branches.py
rename to openhands/app_server/integrations/gitlab/service/branches.py
index 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.py
similarity index 97%
rename from openhands/integrations/gitlab/service/features.py
rename to openhands/app_server/integrations/gitlab/service/features.py
index 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.py
similarity index 96%
rename from openhands/integrations/gitlab/service/prs.py
rename to openhands/app_server/integrations/gitlab/service/prs.py
index 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 RequestMethod
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.gitlab.service.base import GitLabMixinBase
-from openhands.integrations.service_types import RequestMethod
class GitLabPRsMixin(GitLabMixinBase):
diff --git a/openhands/integrations/gitlab/service/repos.py b/openhands/app_server/integrations/gitlab/service/repos.py
similarity index 97%
rename from openhands/integrations/gitlab/service/repos.py
rename to openhands/app_server/integrations/gitlab/service/repos.py
index 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, Repository
from openhands.server.types import AppMode
diff --git a/openhands/integrations/gitlab/service/resolver.py b/openhands/app_server/integrations/gitlab/service/resolver.py
similarity index 97%
rename from openhands/integrations/gitlab/service/resolver.py
rename to openhands/app_server/integrations/gitlab/service/resolver.py
index 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 Comment
class GitLabResolverMixin(GitLabMixinBase):
diff --git a/openhands/integrations/protocols/http_client.py b/openhands/app_server/integrations/protocols/http_client.py
similarity index 98%
rename from openhands/integrations/protocols/http_client.py
rename to openhands/app_server/integrations/protocols/http_client.py
index 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 Any
from httpx import AsyncClient, HTTPError, HTTPStatusError, TimeoutException
from 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 logger
class HTTPClient(ABC):
diff --git a/openhands/integrations/provider.py b/openhands/app_server/integrations/provider.py
similarity index 97%
rename from openhands/integrations/provider.py
rename to openhands/app_server/integrations/provider.py
index 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 logger
from openhands.server.types import AppMode
from openhands.utils.http_session import httpx_verify_option
diff --git a/openhands/integrations/service_types.py b/openhands/app_server/integrations/service_types.py
similarity index 98%
rename from openhands/integrations/service_types.py
rename to openhands/app_server/integrations/service_types.py
index 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.repo
env = Environment(
- loader=FileSystemLoader('openhands/integrations/templates/suggested_task')
+ loader=FileSystemLoader(
+ 'openhands/app_server/integrations/templates/suggested_task'
+ )
)
template = None
diff --git a/openhands/integrations/templates/resolver/azure_devops/issue_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/azure_devops/issue_conversation_instructions.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/azure_devops/issue_conversation_instructions.j2
rename to openhands/app_server/integrations/templates/resolver/azure_devops/issue_conversation_instructions.j2
diff --git a/openhands/integrations/templates/resolver/azure_devops/issue_prompt.j2 b/openhands/app_server/integrations/templates/resolver/azure_devops/issue_prompt.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/azure_devops/issue_prompt.j2
rename to openhands/app_server/integrations/templates/resolver/azure_devops/issue_prompt.j2
diff --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.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/azure_devops/pr_update_conversation_instructions.j2
rename to openhands/app_server/integrations/templates/resolver/azure_devops/pr_update_conversation_instructions.j2
diff --git a/openhands/integrations/templates/resolver/azure_devops/pr_update_prompt.j2 b/openhands/app_server/integrations/templates/resolver/azure_devops/pr_update_prompt.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/azure_devops/pr_update_prompt.j2
rename to openhands/app_server/integrations/templates/resolver/azure_devops/pr_update_prompt.j2
diff --git a/openhands/integrations/templates/resolver/bitbucket/issue_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/bitbucket/issue_conversation_instructions.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/bitbucket/issue_conversation_instructions.j2
rename to openhands/app_server/integrations/templates/resolver/bitbucket/issue_conversation_instructions.j2
diff --git a/openhands/integrations/templates/resolver/bitbucket/issue_prompt.j2 b/openhands/app_server/integrations/templates/resolver/bitbucket/issue_prompt.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/bitbucket/issue_prompt.j2
rename to openhands/app_server/integrations/templates/resolver/bitbucket/issue_prompt.j2
diff --git a/openhands/integrations/templates/resolver/bitbucket/pr_update_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/bitbucket/pr_update_conversation_instructions.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/bitbucket/pr_update_conversation_instructions.j2
rename to openhands/app_server/integrations/templates/resolver/bitbucket/pr_update_conversation_instructions.j2
diff --git a/openhands/integrations/templates/resolver/bitbucket/pr_update_prompt.j2 b/openhands/app_server/integrations/templates/resolver/bitbucket/pr_update_prompt.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/bitbucket/pr_update_prompt.j2
rename to openhands/app_server/integrations/templates/resolver/bitbucket/pr_update_prompt.j2
diff --git a/openhands/integrations/templates/resolver/github/issue_comment_initial_message.j2 b/openhands/app_server/integrations/templates/resolver/github/issue_comment_initial_message.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/github/issue_comment_initial_message.j2
rename to openhands/app_server/integrations/templates/resolver/github/issue_comment_initial_message.j2
diff --git a/openhands/integrations/templates/resolver/github/issue_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/github/issue_conversation_instructions.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/github/issue_conversation_instructions.j2
rename to openhands/app_server/integrations/templates/resolver/github/issue_conversation_instructions.j2
diff --git a/openhands/integrations/templates/resolver/github/issue_prompt.j2 b/openhands/app_server/integrations/templates/resolver/github/issue_prompt.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/github/issue_prompt.j2
rename to openhands/app_server/integrations/templates/resolver/github/issue_prompt.j2
diff --git a/openhands/integrations/templates/resolver/github/pr_update_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/github/pr_update_conversation_instructions.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/github/pr_update_conversation_instructions.j2
rename to openhands/app_server/integrations/templates/resolver/github/pr_update_conversation_instructions.j2
diff --git a/openhands/integrations/templates/resolver/github/pr_update_initial_message.j2 b/openhands/app_server/integrations/templates/resolver/github/pr_update_initial_message.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/github/pr_update_initial_message.j2
rename to openhands/app_server/integrations/templates/resolver/github/pr_update_initial_message.j2
diff --git a/openhands/integrations/templates/resolver/github/pr_update_prompt.j2 b/openhands/app_server/integrations/templates/resolver/github/pr_update_prompt.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/github/pr_update_prompt.j2
rename to openhands/app_server/integrations/templates/resolver/github/pr_update_prompt.j2
diff --git a/openhands/integrations/templates/resolver/gitlab/issue_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/gitlab/issue_conversation_instructions.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/gitlab/issue_conversation_instructions.j2
rename to openhands/app_server/integrations/templates/resolver/gitlab/issue_conversation_instructions.j2
diff --git a/openhands/integrations/templates/resolver/gitlab/issue_prompt.j2 b/openhands/app_server/integrations/templates/resolver/gitlab/issue_prompt.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/gitlab/issue_prompt.j2
rename to openhands/app_server/integrations/templates/resolver/gitlab/issue_prompt.j2
diff --git a/openhands/integrations/templates/resolver/gitlab/mr_update_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/gitlab/mr_update_conversation_instructions.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/gitlab/mr_update_conversation_instructions.j2
rename to openhands/app_server/integrations/templates/resolver/gitlab/mr_update_conversation_instructions.j2
diff --git a/openhands/integrations/templates/resolver/gitlab/mr_update_prompt.j2 b/openhands/app_server/integrations/templates/resolver/gitlab/mr_update_prompt.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/gitlab/mr_update_prompt.j2
rename to openhands/app_server/integrations/templates/resolver/gitlab/mr_update_prompt.j2
diff --git a/openhands/integrations/templates/resolver/jira/jira_existing_conversation.j2 b/openhands/app_server/integrations/templates/resolver/jira/jira_existing_conversation.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/jira/jira_existing_conversation.j2
rename to openhands/app_server/integrations/templates/resolver/jira/jira_existing_conversation.j2
diff --git a/openhands/integrations/templates/resolver/jira/jira_instructions.j2 b/openhands/app_server/integrations/templates/resolver/jira/jira_instructions.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/jira/jira_instructions.j2
rename to openhands/app_server/integrations/templates/resolver/jira/jira_instructions.j2
diff --git a/openhands/integrations/templates/resolver/jira/jira_new_conversation.j2 b/openhands/app_server/integrations/templates/resolver/jira/jira_new_conversation.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/jira/jira_new_conversation.j2
rename to openhands/app_server/integrations/templates/resolver/jira/jira_new_conversation.j2
diff --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.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/jira_dc/jira_dc_existing_conversation.j2
rename to openhands/app_server/integrations/templates/resolver/jira_dc/jira_dc_existing_conversation.j2
diff --git a/openhands/integrations/templates/resolver/jira_dc/jira_dc_instructions.j2 b/openhands/app_server/integrations/templates/resolver/jira_dc/jira_dc_instructions.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/jira_dc/jira_dc_instructions.j2
rename to openhands/app_server/integrations/templates/resolver/jira_dc/jira_dc_instructions.j2
diff --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.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/jira_dc/jira_dc_new_conversation.j2
rename to openhands/app_server/integrations/templates/resolver/jira_dc/jira_dc_new_conversation.j2
diff --git a/openhands/integrations/templates/resolver/linear/linear_existing_conversation.j2 b/openhands/app_server/integrations/templates/resolver/linear/linear_existing_conversation.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/linear/linear_existing_conversation.j2
rename to openhands/app_server/integrations/templates/resolver/linear/linear_existing_conversation.j2
diff --git a/openhands/integrations/templates/resolver/linear/linear_instructions.j2 b/openhands/app_server/integrations/templates/resolver/linear/linear_instructions.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/linear/linear_instructions.j2
rename to openhands/app_server/integrations/templates/resolver/linear/linear_instructions.j2
diff --git a/openhands/integrations/templates/resolver/linear/linear_new_conversation.j2 b/openhands/app_server/integrations/templates/resolver/linear/linear_new_conversation.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/linear/linear_new_conversation.j2
rename to openhands/app_server/integrations/templates/resolver/linear/linear_new_conversation.j2
diff --git a/openhands/integrations/templates/resolver/slack/user_message_conversation_instructions.j2 b/openhands/app_server/integrations/templates/resolver/slack/user_message_conversation_instructions.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/slack/user_message_conversation_instructions.j2
rename to openhands/app_server/integrations/templates/resolver/slack/user_message_conversation_instructions.j2
diff --git a/openhands/integrations/templates/resolver/summary_prompt.j2 b/openhands/app_server/integrations/templates/resolver/summary_prompt.j2
similarity index 100%
rename from openhands/integrations/templates/resolver/summary_prompt.j2
rename to openhands/app_server/integrations/templates/resolver/summary_prompt.j2
diff --git a/openhands/integrations/templates/suggested_task/failing_checks_prompt.j2 b/openhands/app_server/integrations/templates/suggested_task/failing_checks_prompt.j2
similarity index 100%
rename from openhands/integrations/templates/suggested_task/failing_checks_prompt.j2
rename to openhands/app_server/integrations/templates/suggested_task/failing_checks_prompt.j2
diff --git a/openhands/integrations/templates/suggested_task/merge_conflict_prompt.j2 b/openhands/app_server/integrations/templates/suggested_task/merge_conflict_prompt.j2
similarity index 100%
rename from openhands/integrations/templates/suggested_task/merge_conflict_prompt.j2
rename to openhands/app_server/integrations/templates/suggested_task/merge_conflict_prompt.j2
diff --git a/openhands/integrations/templates/suggested_task/open_issue_prompt.j2 b/openhands/app_server/integrations/templates/suggested_task/open_issue_prompt.j2
similarity index 100%
rename from openhands/integrations/templates/suggested_task/open_issue_prompt.j2
rename to openhands/app_server/integrations/templates/suggested_task/open_issue_prompt.j2
diff --git a/openhands/integrations/templates/suggested_task/unresolved_comments_prompt.j2 b/openhands/app_server/integrations/templates/suggested_task/unresolved_comments_prompt.j2
similarity index 100%
rename from openhands/integrations/templates/suggested_task/unresolved_comments_prompt.j2
rename to openhands/app_server/integrations/templates/suggested_task/unresolved_comments_prompt.j2
diff --git a/openhands/integrations/utils.py b/openhands/app_server/integrations/utils.py
similarity index 83%
rename from openhands/integrations/utils.py
rename to openhands/app_server/integrations/utils.py
index 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 logger
async def validate_provider_token(
diff --git a/openhands/app_server/mcp/mcp_router.py b/openhands/app_server/mcp/mcp_router.py
index 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, ProviderType
from openhands.app_server.services.injector import InjectorState
from 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, ProviderType
from openhands.server.types import AppMode
from 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.py
index 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 ProviderType
class Secrets(BaseModel):
diff --git a/openhands/app_server/secrets/secrets_router.py b/openhands/app_server/secrets/secrets_router.py
index 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 Annotated
from fastapi import APIRouter, Depends, HTTPException, Query, status
from 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_token
from openhands.app_server.secrets.secrets_models import (
CustomSecretCreate,
CustomSecretPage,
@@ -18,12 +24,6 @@ from openhands.app_server.secrets.secrets_store import SecretsStore
from openhands.app_server.settings.settings_models import POSTProviderModel
from openhands.app_server.utils.dependencies import get_dependencies
from openhands.app_server.utils.models import EditResponse
-from openhands.integrations.provider import (
- PROVIDER_TOKEN_TYPE,
- CustomSecret,
- ProviderType,
-)
-from openhands.integrations.utils import validate_provider_token
from 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.py
index 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 ProviderType
from openhands.app_server.settings.llm_profiles import LLMProfiles
from openhands.core.config.llm_config import LLMConfig
from openhands.core.config.mcp_config import MCPConfig
from openhands.core.config.utils import load_openhands_config
-from openhands.integrations.provider import ProviderToken
-from openhands.integrations.service_types import ProviderType
from openhands.sdk.settings import ConversationSettings
from openhands.utils.jsonpatch_compat import deep_merge
from openhands.utils.sdk_settings_compat import (
diff --git a/openhands/app_server/settings/settings_router.py b/openhands/app_server/settings/settings_router.py
index 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, status
from fastapi.responses import JSONResponse
from pydantic import BaseModel, Field
+from openhands.app_server.integrations.provider import (
+ PROVIDER_TOKEN_TYPE,
+ ProviderType,
+)
from openhands.app_server.secrets.secrets_models import Secrets
from openhands.app_server.secrets.secrets_store import SecretsStore
from 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 SettingsStore
from openhands.app_server.utils.dependencies import get_dependencies
from openhands.core.logger import openhands_logger as logger
-from openhands.integrations.provider import (
- PROVIDER_TOKEN_TYPE,
- ProviderType,
-)
from openhands.sdk.llm import LLM
from openhands.sdk.settings import ConversationSettings
from openhands.server.shared import config
diff --git a/openhands/app_server/user/auth_user_context.py b/openhands/app_server/user/auth_user_context.py
index 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 Request
from pydantic import PrivateAttr, SecretStr
from 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 UserInfo
from openhands.sdk.secret import SecretSource, StaticSecret
from openhands.server.user_auth.user_auth import UserAuth, get_user_auth
diff --git a/openhands/app_server/user/specifiy_user_context.py b/openhands/app_server/user/specifiy_user_context.py
index 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 dataclass
from fastapi import Request
from 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 UserGitInfo
from openhands.app_server.user.user_context import UserContext
from openhands.app_server.user.user_models import UserInfo
-from openhands.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType
-from openhands.integrations.service_types import UserGitInfo
from openhands.sdk.secret import SecretSource
diff --git a/openhands/app_server/user/user_context.py b/openhands/app_server/user/user_context.py
index 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 UserGitInfo
from openhands.app_server.services.injector import Injector
from openhands.app_server.user.user_models import (
UserInfo,
)
-from openhands.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType
-from openhands.integrations.service_types import UserGitInfo
from openhands.sdk.secret import SecretSource
from openhands.sdk.utils.models import DiscriminatedUnionMixin
diff --git a/openhands/app_server/user/user_models.py b/openhands/app_server/user/user_models.py
index 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_TYPE
from openhands.app_server.settings.settings_models import Settings
-from openhands.integrations.provider import PROVIDER_TOKEN_TYPE
class UserInfo(Settings):
diff --git a/openhands/app_server/user/user_router.py b/openhands/app_server/user/user_router.py
index 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, status
from fastapi.responses import JSONResponse
from openhands.app_server.config import depends_user_context
+from openhands.app_server.integrations.service_types import UserGitInfo
from openhands.app_server.sandbox.session_auth import validate_session_key_ownership
from openhands.app_server.user.user_context import UserContext
from openhands.app_server.user.user_models import UserInfo
from 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 SetAuthCookieMiddleware
diff --git a/openhands/app_server/web_client/default_web_client_config_injector.py b/openhands/app_server/web_client/default_web_client_config_injector.py
index 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 datetime
from pydantic import Field
+from openhands.app_server.integrations.provider import ProviderHandler
+from openhands.app_server.integrations.service_types import ProviderType
from 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 ProviderType
def _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.py
index 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 datetime
from pydantic import BaseModel, Field, model_validator
from openhands.agent_server.env_parser import DiscriminatedUnionMixin
+from openhands.app_server.integrations.service_types import ProviderType
from openhands.app_server.web_client.web_client_deployment_mode import (
DeploymentMode,
get_deployment_mode,
)
-from openhands.integrations.service_types import ProviderType
from openhands.server.types import AppMode
diff --git a/openhands/core/setup.py b/openhands/core/setup.py
index fa633acab5..feee0db240 100644
--- a/openhands/core/setup.py
+++ b/openhands/core/setup.py
@@ -11,14 +11,14 @@ import uuid
from pydantic import SecretStr
+from openhands.app_server.integrations.provider import (
+ ProviderToken,
+ ProviderType,
+)
from openhands.app_server.secrets.secrets_models import Secrets
from 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.py
index a572314980..af791b66c5 100644
--- a/openhands/server/app.py
+++ b/openhands/server/app.py
@@ -22,9 +22,9 @@ from fastapi.responses import JSONResponse
from openhands.app_server import v1_router
from openhands.app_server.config import get_app_lifespan_service
+from openhands.app_server.integrations.service_types import AuthenticationError
from openhands.app_server.mcp.mcp_router import mcp_server
from openhands.app_server.status.status_router import router as health_router
-from openhands.integrations.service_types import AuthenticationError
from openhands.version import get_version
mcp_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.py
index 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 ProviderType
def create_provider_tokens_object(
diff --git a/openhands/server/user_auth/__init__.py b/openhands/server/user_auth/__init__.py
index 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, Request
from fastapi.security import APIKeyHeader
from pydantic import SecretStr
+from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPE
from openhands.app_server.secrets.secrets_models import Secrets
from openhands.app_server.secrets.secrets_store import SecretsStore
from openhands.app_server.settings.settings_models import Settings
from openhands.app_server.settings.settings_store import SettingsStore
-from openhands.integrations.provider import PROVIDER_TOKEN_TYPE
from openhands.server.user_auth.user_auth import AuthType, get_user_auth
diff --git a/openhands/server/user_auth/default_user_auth.py b/openhands/server/user_auth/default_user_auth.py
index 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 dataclass
from fastapi import Request
from pydantic import SecretStr
+from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPE
from openhands.app_server.secrets.secrets_models import Secrets
from openhands.app_server.secrets.secrets_store import SecretsStore
from openhands.app_server.settings.settings_models import Settings
from openhands.app_server.settings.settings_store import SettingsStore
-from openhands.integrations.provider import PROVIDER_TOKEN_TYPE
from openhands.server import shared
from openhands.server.user_auth.user_auth import UserAuth
diff --git a/openhands/server/user_auth/user_auth.py b/openhands/server/user_auth/user_auth.py
index 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 Enum
from fastapi import Request
from pydantic import SecretStr
+from openhands.app_server.integrations.provider import (
+ PROVIDER_TOKEN_TYPE,
+ ProviderHandler,
+)
+from openhands.app_server.integrations.service_types import UserGitInfo
from openhands.app_server.secrets.secrets_models import Secrets
from openhands.app_server.secrets.secrets_store import SecretsStore
from openhands.app_server.settings.settings_models import Settings
from openhands.app_server.settings.settings_store import SettingsStore
-from openhands.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderHandler
-from openhands.integrations.service_types import UserGitInfo
from openhands.server.shared import server_config
from openhands.utils.import_utils import get_impl
diff --git a/tests/unit/app_server/test_default_web_client_config_injector.py b/tests/unit/app_server/test_default_web_client_config_injector.py
index 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 ProviderType
from openhands.app_server.web_client.default_web_client_config_injector import (
_get_providers_configured,
)
- from openhands.integrations.service_types import ProviderType
with 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 ProviderType
from openhands.app_server.web_client.default_web_client_config_injector import (
_get_providers_configured,
)
- from openhands.integrations.service_types import ProviderType
with 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 ProviderType
from openhands.app_server.web_client.default_web_client_config_injector import (
_get_providers_configured,
)
- from openhands.integrations.service_types import ProviderType
with 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 ProviderType
from openhands.app_server.web_client.default_web_client_config_injector import (
_get_providers_configured,
)
- from openhands.integrations.service_types import ProviderType
with 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 ProviderType
from openhands.app_server.web_client.default_web_client_config_injector import (
_get_providers_configured,
)
- from openhands.integrations.service_types import ProviderType
with 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 ProviderType
from openhands.app_server.web_client.default_web_client_config_injector import (
_get_providers_configured,
)
- from openhands.integrations.service_types import ProviderType
with 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 ProviderType
from openhands.app_server.web_client.default_web_client_config_injector import (
_get_providers_configured,
)
- from openhands.integrations.service_types import ProviderType
with patch.dict(
os.environ,
diff --git a/tests/unit/app_server/test_git_router.py b/tests/unit/app_server/test_git_router.py
index 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_results
class 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.py
index 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, TaskType
from 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, TaskType
from openhands.sdk import Agent, Event
from openhands.sdk.context.agent_context import AgentContext as _AgentContext
from openhands.sdk.llm import LLM
diff --git a/tests/unit/app_server/test_profiles_api.py b/tests/unit/app_server/test_profiles_api.py
index 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 TestClient
from pydantic import SecretStr
from 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 UserGitInfo
from openhands.app_server.secrets.secrets_models import Secrets
from openhands.app_server.secrets.secrets_store import SecretsStore
from openhands.app_server.settings.file_settings_store import FileSettingsStore
@@ -23,8 +25,6 @@ from openhands.app_server.settings.llm_profiles import MAX_PROFILES_PER_USER
from openhands.app_server.settings.settings_models import Settings
from openhands.app_server.settings.settings_router import _user_profile_locks
from openhands.app_server.settings.settings_store import SettingsStore
-from openhands.integrations.provider import ProviderToken, ProviderType
-from openhands.integrations.service_types import UserGitInfo
from openhands.sdk.llm import LLM
from openhands.sdk.settings import AgentSettings
from openhands.server.app import app
diff --git a/tests/unit/app_server/test_sandbox_secrets_router.py b/tests/unit/app_server/test_sandbox_secrets_router.py
index 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, HTTPException
from fastapi.testclient import TestClient
from pydantic import SecretStr
+from openhands.app_server.integrations.provider import ProviderHandler, ProviderToken
+from openhands.app_server.integrations.service_types import ProviderType
from 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 AuthUserContext
from openhands.app_server.user.user_models import UserInfo
from openhands.app_server.user.user_router import get_current_user
-from openhands.integrations.provider import ProviderHandler, ProviderToken
-from openhands.integrations.service_types import ProviderType
from openhands.sdk.llm import LLM
from openhands.sdk.secret import StaticSecret
from openhands.sdk.settings import AgentSettings
diff --git a/tests/unit/app_server/test_secrets_api.py b/tests/unit/app_server/test_secrets_api.py
index 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 TestClient
from pydantic import SecretStr
from 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 FileSecretsStore
from openhands.app_server.secrets.secrets_models import Secrets
from 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 host
diff --git a/tests/unit/app_server/test_settings_api.py b/tests/unit/app_server/test_settings_api.py
index 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 TestClient
from pydantic import SecretStr
from 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 UserGitInfo
from openhands.app_server.secrets.secrets_models import Secrets
from openhands.app_server.secrets.secrets_store import SecretsStore
from openhands.app_server.settings.file_settings_store import FileSettingsStore
from openhands.app_server.settings.settings_models import Settings
from openhands.app_server.settings.settings_store import SettingsStore
-from openhands.integrations.provider import ProviderToken, ProviderType
-from openhands.integrations.service_types import UserGitInfo
from openhands.sdk.llm import LLM
from openhands.sdk.settings import (
AgentSettings,
diff --git a/tests/unit/app_server/test_skill_loader.py b/tests/unit/app_server/test_skill_loader.py
index 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 AuthenticationError
from 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 AuthenticationError
from 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.py
index 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 ProviderType
from openhands.app_server.user.specifiy_user_context import SpecifyUserContext
from openhands.app_server.utils.sql_utils import Base
-from openhands.integrations.service_types import ProviderType
from openhands.sdk.llm import MetricsSnapshot, TokenUsage
# Note: org_id column exists but foreign key constraint is not enforced in tests
diff --git a/tests/unit/app_server/test_user_git_info.py b/tests/unit/app_server/test_user_git_info.py
index 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 UserGitInfo
expected_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 UserGitInfo
minimal_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 UserGitInfo
git_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 UserGitInfo
git_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 UserGitInfo
git_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 UserGitInfo
git_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.py
index 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 imp
SQLAppConversationInfoService,
)
from openhands.app_server.event_callback.webhook_router import on_conversation_update
+from openhands.app_server.integrations.provider import ProviderType
from openhands.app_server.sandbox.sandbox_models import SandboxInfo, SandboxStatus
from openhands.app_server.user.specifiy_user_context import SpecifyUserContext
from openhands.app_server.utils.sql_utils import Base
-from openhands.integrations.provider import ProviderType
from openhands.sdk.conversation import ConversationExecutionStatus
diff --git a/tests/unit/integrations/bitbucket/test_bitbucket.py b/tests/unit/integrations/bitbucket/test_bitbucket.py
index 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, patch
import pytest
from 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_token
from openhands.app_server.secrets.secrets_router import check_provider_tokens
from 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_token
from 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 calls
with (
- 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 service
with (
- 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.asyncio
async 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.asyncio
async 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.asyncio
async 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.asyncio
async 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 None
diff --git a/tests/unit/integrations/bitbucket/test_bitbucket_branches.py b/tests/unit/integrations/bitbucket/test_bitbucket_branches.py
index 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 patch
import pytest
from 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.asyncio
diff --git a/tests/unit/integrations/bitbucket/test_bitbucket_repos.py b/tests/unit/integrations/bitbucket/test_bitbucket_repos.py
index 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 patch
import pytest
from 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 AppMode
diff --git a/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc.py b/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc.py
index 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 patch
import pytest
from 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, User
from 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.py
index 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 patch
import pytest
from 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.py
index 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, patch
import pytest
from 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.py
index 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, patch
import pytest
from 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 AppMode
diff --git a/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_resolver.py b/tests/unit/integrations/bitbucket_data_center/test_bitbucket_dc_resolver.py
index 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 patch
import pytest
from 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 BaseGitService
mro_names = [cls.__name__ for cls in BitbucketDCService.__mro__]
assert 'BitbucketDCResolverMixin' in mro_names
diff --git a/tests/unit/integrations/github/test_github_branches.py b/tests/unit/integrations/github/test_github_branches.py
index 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, patch
import pytest
from 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.asyncio
diff --git a/tests/unit/integrations/github/test_github_service.py b/tests/unit/integrations/github/test_github_service.py
index 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 httpx
import pytest
from 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.asyncio
async 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 GitHubMixinBase
emails = [
{'email': '[email protected]', 'primary': False, 'verified': True},
@@ -422,7 +422,7 @@ async def test_resolve_primary_email_selects_primary_verified():
@pytest.mark.asyncio
async 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 GitHubMixinBase
emails = [
{'email': '[email protected]', 'primary': False, 'verified': True},
@@ -435,7 +435,7 @@ async def test_resolve_primary_email_returns_none_when_no_primary():
@pytest.mark.asyncio
async 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 GitHubMixinBase
emails = [
{'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.asyncio
async 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 GitHubMixinBase
result = GitHubMixinBase._resolve_primary_email([])
assert result is None
diff --git a/tests/unit/integrations/github/test_suggested_tasks.py b/tests/unit/integrations/github/test_suggested_tasks.py
index 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 AsyncMock
import 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.asyncio
diff --git a/tests/unit/integrations/gitlab/test_gitlab.py b/tests/unit/integrations/gitlab/test_gitlab.py
index 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 patch
import pytest
from 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 AppMode
diff --git a/tests/unit/integrations/gitlab/test_gitlab_branches.py b/tests/unit/integrations/gitlab/test_gitlab_branches.py
index 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 patch
import pytest
from 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.asyncio
diff --git a/tests/unit/integrations/protocols/test_http_client.py b/tests/unit/integrations/protocols/test_http_client.py
index 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 httpx
import pytest
from 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 protocol
assert isinstance(self.client, HTTPClient)
diff --git a/tests/unit/integrations/test_provider_immutability.py b/tests/unit/integrations/test_provider_immutability.py
index 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, patch
import pytest
from 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 Settings
def test_provider_token_immutability():
diff --git a/tests/unit/server/routes/test_mcp_routes.py b/tests/unit/server/routes/test_mcp_routes.py
index 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, patch
import pytest
+from openhands.app_server.integrations.service_types import GitService
from openhands.app_server.mcp.mcp_router import get_conversation_link
-from openhands.integrations.service_types import GitService
from openhands.server.types import AppMode
diff --git a/tests/unit/server/routes/test_skills_api.py b/tests/unit/server/routes/test_skills_api.py
index 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 TestClient
from pydantic import SecretStr
from 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 UserGitInfo
from openhands.app_server.secrets.secrets_models import Secrets
from openhands.app_server.secrets.secrets_store import SecretsStore
from openhands.app_server.settings.file_settings_store import FileSettingsStore
from openhands.app_server.settings.settings_store import SettingsStore
-from openhands.integrations.provider import ProviderToken, ProviderType
-from openhands.integrations.service_types import UserGitInfo
from openhands.server.app import app
from openhands.server.user_auth.user_auth import UserAuth
diff --git a/tests/unit/server/test_openapi_schema_generation.py b/tests/unit/server/test_openapi_schema_generation.py
index 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 TestClient
from pydantic import SecretStr
from 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 UserGitInfo
from openhands.app_server.secrets.secrets_models import Secrets
from openhands.app_server.secrets.secrets_store import SecretsStore
from openhands.app_server.settings.file_settings_store import FileSettingsStore
from openhands.app_server.settings.settings_store import SettingsStore
-from openhands.integrations.provider import ProviderToken, ProviderType
-from openhands.integrations.service_types import UserGitInfo
from openhands.server.app import app
from openhands.server.user_auth.user_auth import UserAuth
diff --git a/tests/unit/storage/data_models/test_secret_store.py b/tests/unit/storage/data_models/test_secret_store.py
index 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 Any
from 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 Secrets
class TestSecrets:
diff --git a/tests/unit/test_azure_devops.py b/tests/unit/test_azure_devops.py
index 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, patch
import 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.asyncio
diff --git a/tests/unit/test_forgejo_service.py b/tests/unit/test_forgejo_service.py
index d14e9fd755..e3fc69941c 100644
--- a/tests/unit/test_forgejo_service.py
+++ b/tests/unit/test_forgejo_service.py
@@ -4,8 +4,8 @@ import httpx
import pytest
from 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,