π OpenHands: AI-Driven Development
Log all terminal states (error, stuck) in V1 callback processors (#13549)
Ash Clarke19da63aae622
diff --git a/enterprise/integrations/github/github_v1_callback_processor.py b/enterprise/integrations/github/github_v1_callback_processor.pyindex 42e68027ca..979895f2e8 100644--- a/enterprise/integrations/github/github_v1_callback_processor.py+++ b/enterprise/integrations/github/github_v1_callback_processor.py@@ -43,15 +43,20 @@ class GithubV1CallbackProcessor(EventCallbackProcessor):event: Event,) -> EventCallbackResult | None:"""Process events for GitHub V1 integration."""- # Only handle ConversationStateUpdateEvent+ # Only handle ConversationStateUpdateEvent for execution_statusif not isinstance(event, ConversationStateUpdateEvent):return None- # Only act when execution has finished- if not (event.key == 'execution_status' and event.value == 'finished'):+ if event.key != 'execution_status':return None+ # Log ALL terminal states for monitoring (finished, error, stuck)_logger.info('[GitHub V1] Callback agent state was %s', event)++ # Only request summary when execution has finished successfully+ if event.value != 'finished':+ return None+_logger.info('[GitHub V1] Should request summary: %s', self.should_request_summary)diff --git a/enterprise/integrations/gitlab/gitlab_v1_callback_processor.py b/enterprise/integrations/gitlab/gitlab_v1_callback_processor.pyindex 2fe4d6fc72..62610b62f3 100644--- a/enterprise/integrations/gitlab/gitlab_v1_callback_processor.py+++ b/enterprise/integrations/gitlab/gitlab_v1_callback_processor.py@@ -41,15 +41,20 @@ class GitlabV1CallbackProcessor(EventCallbackProcessor):event: Event,) -> EventCallbackResult | None:"""Process events for GitLab V1 integration."""- # Only handle ConversationStateUpdateEvent+ # Only handle ConversationStateUpdateEvent for execution_statusif not isinstance(event, ConversationStateUpdateEvent):return None- # Only act when execution has finished- if not (event.key == 'execution_status' and event.value == 'finished'):+ if event.key != 'execution_status':return None+ # Log ALL terminal states for monitoring (finished, error, stuck)_logger.info('[GitLab V1] Callback agent state was %s', event)++ # Only request summary when execution has finished successfully+ if event.value != 'finished':+ return None+_logger.info('[GitLab V1] Should request summary: %s', self.should_request_summary)diff --git a/enterprise/integrations/slack/slack_v1_callback_processor.py b/enterprise/integrations/slack/slack_v1_callback_processor.pyindex 25b94b7872..3a3685a3b6 100644--- a/enterprise/integrations/slack/slack_v1_callback_processor.py+++ b/enterprise/integrations/slack/slack_v1_callback_processor.py@@ -40,16 +40,20 @@ class SlackV1CallbackProcessor(EventCallbackProcessor):event: Event,) -> EventCallbackResult | None:"""Process events for Slack V1 integration."""- # Only handle ConversationStateUpdateEvent+ # Only handle ConversationStateUpdateEvent for execution_statusif not isinstance(event, ConversationStateUpdateEvent):return None- # Only act when execution has finished- if not (event.key == 'execution_status' and event.value == 'finished'):+ if event.key != 'execution_status':return None+ # Log ALL terminal states for monitoring (finished, error, stuck)_logger.info('[Slack V1] Callback agent state was %s', event)+ # Only request summary when execution has finished successfully+ if event.value != 'finished':+ return None+try:summary = await self._request_summary(conversation_id)await self._post_summary_to_slack(summary)