refactor: move session initialization from WebSocket to REST API (#5493)

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
This commit is contained in:
Robert Brennan
2024-12-20 10:50:09 -05:00
committed by GitHub
parent 0dd919bacf
commit 73c38f1163
48 changed files with 628 additions and 1442 deletions

View File

@@ -12,8 +12,8 @@ class OpenhandsConfig(OpenhandsConfigInterface):
app_mode = AppMode.OSS
posthog_client_key = 'phc_3ESMmY9SgqEAGBB6sMGK5ayYHkeUuknH2vP6FmWH9RA'
github_client_id = os.environ.get('GITHUB_APP_CLIENT_ID', '')
attach_session_middleware_path = (
'openhands.server.middleware.AttachSessionMiddleware'
attach_conversation_middleware_path = (
'openhands.server.middleware.AttachConversationMiddleware'
)
settings_store_class: str = (
'openhands.storage.file_settings_store.FileSettingsStore'
@@ -39,22 +39,12 @@ class OpenhandsConfig(OpenhandsConfigInterface):
return config
async def github_auth(self, data: dict):
"""
Skip Github Auth for AppMode OSS
"""
pass
def load_openhands_config():
config_cls = os.environ.get('OPENHANDS_CONFIG_CLS', None)
logger.info(f'Using config class {config_cls}')
if config_cls:
openhands_config_cls = get_impl(OpenhandsConfig, config_cls)
else:
openhands_config_cls = OpenhandsConfig
openhands_config_cls = get_impl(OpenhandsConfig, config_cls)
openhands_config = openhands_config_cls()
openhands_config.verify_config()