diff --git a/b/cntoai/model_usage_admin_report.dspy b/b/cntoai/model_usage_admin_report.dspy index 04e6861..bf0e068 100644 --- a/b/cntoai/model_usage_admin_report.dspy +++ b/b/cntoai/model_usage_admin_report.dspy @@ -307,7 +307,11 @@ def _aggregate_admin_summary(items, user_map, org_map): bucket['request_count'] += 1 usage_time = item.get('usage_time') if usage_time: - bucket['last_usage_time'] = usage_time + if ( + not bucket.get('last_usage_time') + or str(usage_time) > str(bucket['last_usage_time']) + ): + bucket['last_usage_time'] = usage_time if ( not bucket.get('first_usage_time') or str(usage_time) < str(bucket['first_usage_time'])