Log all terminal states (error, stuck) in V1 callback processors#13549
Merged
Log all terminal states (error, stuck) in V1 callback processors#13549
Conversation
Previously, V1 callback processors (GitHub, Slack, GitLab) only logged when conversations reached the 'finished' state. This made it impossible to track conversation failure rates since 'error' and 'stuck' terminal states were never logged. This change moves the logging to happen for ALL execution_status events, while still only requesting summaries when the status is 'finished'. After this change, Datadog will receive logs like: - [GitHub V1] Callback agent state was ConversationStateUpdate(key=execution_status, value=error) - [GitHub V1] Callback agent state was ConversationStateUpdate(key=execution_status, value=stuck) This enables accurate conversation failure rate monitoring in the engineering KPIs dashboard. Co-authored-by: openhands <openhands@all-hands.dev>
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||
all-hands-bot
approved these changes
Mar 23, 2026
Collaborator
all-hands-bot
left a comment
There was a problem hiding this comment.
🟢 Good taste - Simple, pragmatic solution.
Key Insight: The refactored code is actually MORE readable than the original. Replacing if not (event.key == 'execution_status' and event.value == 'finished') with two sequential checks eliminates the complex negative condition. The logging now correctly captures all terminal states (error, stuck, finished) for proper failure rate tracking.
Verdict: ✅ Worth merging. This solves a real production monitoring gap without adding complexity.
4 tasks
raymyers
approved these changes
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes conversation failure rate tracking by ensuring all terminal states are logged in V1 callback processors.
Problem
Previously, the V1 callback processors (GitHub, Slack, GitLab) only logged when conversations reached the
finishedstate:This meant
errorandstuckterminal states were never logged, making it impossible to track conversation failure rates from Datadog logs.Solution
Move the logging to happen for ALL
execution_statusevents, while still only requesting summaries when the status isfinished:Impact
After this change, Datadog will receive logs for all terminal states:
[GitHub V1] Callback agent state was ConversationStateUpdate(key=execution_status, value=finished)[GitHub V1] Callback agent state was ConversationStateUpdate(key=execution_status, value=error)[GitHub V1] Callback agent state was ConversationStateUpdate(key=execution_status, value=stuck)This enables accurate conversation failure rate monitoring using the formula:
Files Changed
enterprise/integrations/github/github_v1_callback_processor.pyenterprise/integrations/slack/slack_v1_callback_processor.pyenterprise/integrations/gitlab/gitlab_v1_callback_processor.pyTesting
The change is minimal and preserves existing behavior:
execution_statusevents are logged (new behavior)finished(unchanged behavior)execution_statusevents are still ignored (unchanged behavior)To run this PR locally, use the following command:
GUI with Docker: