From 4c70429ae79b80fe4e4796f5afa527abe80873be Mon Sep 17 00:00:00 2001 From: AmreetKhuntia Date: Fri, 15 May 2026 17:13:22 +0530 Subject: [PATCH] fix: skip rate limit evaluation for inactive templates Only run outbound rate limit check when the template is active. Inactive templates still proceed through the full call flow. --- app/ai/voice/agents/breeze_buddy/managers/calls.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/ai/voice/agents/breeze_buddy/managers/calls.py b/app/ai/voice/agents/breeze_buddy/managers/calls.py index a2de22a6b..f0000b054 100644 --- a/app/ai/voice/agents/breeze_buddy/managers/calls.py +++ b/app/ai/voice/agents/breeze_buddy/managers/calls.py @@ -576,7 +576,9 @@ async def process_backlog_leads(): await _release_number(number_to_use.id, number_to_use.provider) await release_lock_on_lead_by_id(locked_lead.id) continue - if locked_lead.execution_mode == ExecutionMode.TELEPHONY: + if locked_lead.execution_mode == ExecutionMode.TELEPHONY and ( + template is None or template.is_active + ): rate_limit_allowed, defer_seconds = ( await check_outbound_rate_limit_and_alert( customer_phone=customer_mobile,