litellm/tests/unit/enterprise
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
..
enterprise_callbacks fix(alerts): route budget refusals through shared policies (#56113) 2026-12-03 19:29:32 -08:00
integrations refactor(typing): clear about 1,100 basedpyright Any errors across 303 files (#49986) 2026-11-06 13:31:15 -08:00
proxy fix(proxy): copy a shared budget row when a project edits its budget limits (#56075) 2026-12-04 01:36:56 +00:00
__init__.py test: add __init__.py to migrated tests/unit packages 2026-09-20 11:53:49 +00:00
conftest.py ci(unit): cut unit check time with cheaper per-test resets and fewer non-unit tests (#51864) 2026-11-14 15:41:30 -08:00