Fix duplicate class registration by using consistent import paths

The SQLSharedConversationInfoServiceInjector class was being registered twice
because the same module was being imported via two different paths:
- enterprise.server.sharing.sql_shared_conversation_info_service
- server.sharing.sql_shared_conversation_info_service

This happened because the enterprise pyproject.toml defines packages without
the 'enterprise.' prefix (e.g., 'server' not 'enterprise.server'), and the
PYTHONPATH includes both '.' and the poetry virtualenv.

Fixed by changing all imports to use the canonical 'server.sharing.xxx' path
that matches the package configuration.

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
openhands 2025-12-23 04:15:00 +00:00
parent 573be9c5e0
commit a63001e106
3 changed files with 4 additions and 6 deletions

View File

@ -23,7 +23,7 @@ from server.sharing.shared_event_service import (
SharedEventServiceInjector,
)
from enterprise.server.sharing.sql_shared_conversation_info_service import (
from server.sharing.sql_shared_conversation_info_service import (
SQLSharedConversationInfoService,
)
from openhands.agent_server.models import EventPage, EventSortOrder

View File

@ -13,8 +13,7 @@ from server.sharing.shared_conversation_models import (
SharedConversationPage,
SharedConversationSortOrder,
)
from enterprise.server.sharing.sql_shared_conversation_info_service import (
from server.sharing.sql_shared_conversation_info_service import (
SQLSharedConversationInfoServiceInjector,
)

View File

@ -5,11 +5,10 @@ from typing import Annotated
from uuid import UUID
from fastapi import APIRouter, Depends, Query
from server.sharing.shared_event_service import SharedEventService
from enterprise.server.sharing.filesystem_shared_event_service import (
from server.sharing.filesystem_shared_event_service import (
SharedEventServiceImplInjector,
)
from server.sharing.shared_event_service import SharedEventService
from openhands.agent_server.models import EventPage, EventSortOrder
from openhands.app_server.event_callback.event_callback_models import EventKind
from openhands.sdk import Event