fix: skip rate limit evaluation for inactive templates#763
fix: skip rate limit evaluation for inactive templates#763amreetkhuntia wants to merge 1 commit into
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe PR refines the outbound rate-limit/deferral logic in ChangesTemplate active-state gating for rate-limit deferral
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Only run outbound rate limit check when the template is active. Inactive templates still proceed through the full call flow.
6d22dc7 to
4c70429
Compare
There was a problem hiding this comment.
Pull request overview
Adjusts Breeze Buddy’s backlog lead processing so outbound rate-limit checks are only evaluated for active templates, avoiding rate-limit blocking/alerting for inactive templates while keeping the rest of the call flow unchanged.
Changes:
- Gate
check_outbound_rate_limit_and_alert()behindtemplate.is_activefor telephony leads. - Preserve existing behavior for leads that continue through the full call placement flow.
| if locked_lead.execution_mode == ExecutionMode.TELEPHONY and ( | ||
| template is None or template.is_active | ||
| ): |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/ai/voice/agents/breeze_buddy/managers/calls.py (1)
579-581: ⚡ Quick winConsider adding observability logging when rate-limit check is skipped for inactive templates.
When an inactive template causes the rate-limit check to be bypassed, there's no log entry explaining this decision. This could make debugging and monitoring more difficult, especially when investigating why certain calls were not rate-limited.
📊 Proposed logging enhancement
+ if locked_lead.execution_mode == ExecutionMode.TELEPHONY and template and not template.is_active: + logger.info( + f"Skipping rate limit check for lead {locked_lead.id} - template {locked_lead.template} is inactive" + ) if locked_lead.execution_mode == ExecutionMode.TELEPHONY and ( template is None or template.is_active ):🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/ai/voice/agents/breeze_buddy/managers/calls.py` around lines 579 - 581, The rate-limit check is currently gated by the condition using locked_lead.execution_mode and template.is_active, but when a template exists and is inactive the check is silently bypassed; add an observability log right where the condition is evaluated (around the if using locked_lead, template, and ExecutionMode.TELEPHONY) to emit a clear message when template is present but inactive and therefore the rate-limit check is skipped, including identifiers like locked_lead.id and template.id (and execution mode) to aid debugging and monitoring.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@app/ai/voice/agents/breeze_buddy/managers/calls.py`:
- Around line 579-581: The rate-limit check is currently gated by the condition
using locked_lead.execution_mode and template.is_active, but when a template
exists and is inactive the check is silently bypassed; add an observability log
right where the condition is evaluated (around the if using locked_lead,
template, and ExecutionMode.TELEPHONY) to emit a clear message when template is
present but inactive and therefore the rate-limit check is skipped, including
identifiers like locked_lead.id and template.id (and execution mode) to aid
debugging and monitoring.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b64b08a3-b8c8-43ca-b3b2-15cbb9e42f07
📒 Files selected for processing (1)
app/ai/voice/agents/breeze_buddy/managers/calls.py
Only run outbound rate limit check when the template is active. Inactive templates still proceed through the full call flow.
Summary by CodeRabbit
Release Notes