litellm/tests/unit/enterprise/enterprise_callbacks
tin-berri d89ea4f7ce
fix(alerts): route budget refusals through shared policies (#56113)
* fix(alerts): route budget refusals through shared policies

* style(rust): format budget refusal error

* test(proxy): use real budget alert payloads

* test(alerts): consolidate refusal routing regressions

* fix(alerts): email the owner once when a configured 100% alert fires

A refused key or team member with a 100% entry in max_budget_alert_emails
got the generic budget-crossed email and the dedicated 100% email. The
dedicated producer already includes the owner, so the generic email now
stands down when that producer exists and owns the 100% threshold. Chat
and webhook delivery are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* fix(alerts): keep malformed alert config out of key admission and email each project user

A key whose max_budget_alert_emails metadata is not a threshold map made
the percentage notifier raise AttributeError inside the key budget check.
The key producer now validates its config with the same helper the team
and team-member producers use.

The project soft-budget email marker was keyed by project only, so the
first calling user's email suppressed every other user's. It is now keyed
by project and recipient.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-03 19:29:32 -08:00
..
send_emails fix(alerts): route budget refusals through shared policies (#56113) 2026-12-03 19:29:32 -08:00
__init__.py test: add __init__.py to migrated tests/unit packages 2026-09-20 11:53:49 +00:00
test_callback_controls.py fix(logging): stop dumping the request body at every layer under --detailed_debug (#48973) 2026-10-29 02:30:33 +00:00
test_llm_guard.py fix(guardrails): keep streamed chat chunks as JSON when Azure text moderation or LLM Guard passes them (#55695) 2026-12-02 15:10:49 -08:00
test_pagerduty_alerting.py fix(completion)!: answer 400 for a chat message without a role (#51124) 2026-11-11 20:59:19 +00:00
test_prometheus_logging_callbacks.py fix(prometheus): emit every declared label on litellm_deployment_cooled_down (#54488) 2026-11-25 11:39:52 -08:00
test_secret_detection.py fix(decisions): accept OpenAI input_json content parts on /v1/decisions (#52805) 2026-11-20 13:33:36 -08:00