fix: count time-based captain resolves in overview reopen rate

This commit is contained in:
Shivam Mishra
2026-06-30 16:31:46 +05:30
parent ba474a4348
commit c1eceb8f98
@@ -182,8 +182,10 @@ class Captain::AssistantStatsBuilder
end
# Of the conversations Captain auto-resolved (inbox-based), the share reopened afterwards.
# Covers both the evaluated (inference) and time-based (bot) resolve paths so the
# denominator matches auto_resolution_rate.
def reopen_rate(range)
resolved_scope = account.reporting_events.where(name: 'conversation_captain_inference_resolved',
resolved_scope = account.reporting_events.where(name: RESOLVED_EVENT_NAMES,
inbox_id: assistant_inbox_ids, created_at: range)
resolved = resolved_scope.distinct.count(:conversation_id)
reopened = account.reporting_events