Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Preload callback processor class to prevent Pydantic Deserialization Error (#12776)

Tim O'Farrell89475095d9e9
diff --git a/enterprise/saas_server.py b/enterprise/saas_server.py
index 1734536d53..e8c1935cb5 100644
--- a/enterprise/saas_server.py
+++ b/enterprise/saas_server.py
@@ -78,8 +78,15 @@ base_app.include_router(shared_event_router)
# Add GitHub integration router only if GITHUB_APP_CLIENT_ID is set
if GITHUB_APP_CLIENT_ID:
+ # Make sure that the callback processor is loaded here so we don't get an error when deserializing
+ from integrations.github.github_v1_callback_processor import ( # noqa: E402
+ GithubV1CallbackProcessor,
+ )
from server.routes.integration.github import github_integration_router # noqa: E402
+ # Bludgeon mypy into not deleting my import
+ logger.debug(f'Loaded {GithubV1CallbackProcessor.__name__}')
+
base_app.include_router(
github_integration_router
) # Add additional route for integration webhook events