litellm/tests/unit/proxy/management_helpers
tin-berri b608fa878f
feat(budgets): support custom additional spend windows (#52976)
* feat(budgets): support custom additional spend windows

* fix(budgets): preserve window identity with shared reset helpers

* fix(budgets): normalize request timestamps before window accounting

* fix(budgets): preserve preset periods and daily reset boundaries

* fix(budgets): compare reset boundaries as UTC instants

* refactor(budgets): reuse shared duration validation, reset carry and the reset job for customer windows

Customer budget_limits now keep the submitted duration and validate through
budget_duration_error like user windows. Reset carry on edits goes through one
carry_budget_limit_resets helper shared with group_budget_patch. Customer
budget rows join the reset job's window sources, which only advance reset_at
because their counters are keyed by window start, so the anchor arithmetic in
get_next_standardized_reset_time is removed. budget_duration_error now also
rejects durations whose window start overflows.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(budgets): type the window reset check and drop the unused overflow expression

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(budgets): preserve concurrent edits during window resets

* Revert "fix(budgets): preserve concurrent edits during window resets"

This reverts commit 13fb3c3cea.

* fix(budgets): keep reset locals final and freeze reset tests

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(ui): preserve custom caps during calendar budget edits

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(ui): show and sort custom customer budget caps

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(ui): centralize customer budget window policies

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(ui): avoid uncapped labels for custom organization caps

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(budgets): retain custom counter identity across edits

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(budgets): keep custom daily windows stable through fall back

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* Revert "fix(budgets): keep custom daily windows stable through fall back"

This reverts commit c9f6353494.

* fix(ui): remove custom budget windows edited by a form

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-20 00:54:52 -08:00
..
__init__.py ci: move tests/proxy_unit_tests to tests/unit/proxy and run the proxy-db shards from litellm-tests (#42903) 2026-09-24 22:59:11 +00:00
team_metadata_validator_impls.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_access_group_key_sync.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_access_group_model_sync.py refactor(router): move router callers onto the entry points and invert the proxy imports (#48847) 2026-10-29 17:26:33 +00:00
test_access_group_team_sync.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_apps.py feat(proxy): link app member budgets to shared templates (#52989) 2026-11-19 17:05:05 -08:00
test_audit_log_callbacks.py refactor(s3-log): move the rust-backed s3 logger from s3_v3 to s3_v2 (#51893) 2026-11-14 22:24:23 -08:00
test_audit_logs_proxy.py feat(db): insert audit logs through the rust repository (#52779) 2026-11-20 14:53:02 +09:00
test_auto_router_availability.py refactor(router): fence the router surface and document the router-core boundary (#48839) 2026-10-29 00:01:52 +00:00
test_auto_router_permissions.py fix(databricks): call the ai_decide AI Function route for decisions and the auto-router (#45722) 2026-10-10 23:58:16 -07:00
test_bulk_user_creation.py feat(proxy): app-scoped read access to Customer Management through object permissions (#52781) 2026-11-19 10:43:41 -08:00
test_bulk_user_deletion.py feat(auth): read virtual keys, jwt key mappings and model access groups through rust repositories (#52173) 2026-11-18 03:53:37 +00:00
test_customer_budget_usage.py fix(budgets): match window starts to stored millisecond precision (#51921) 2026-11-16 04:02:44 +08:00
test_customer_hierarchy.py feat(budgets): support custom additional spend windows (#52976) 2026-11-20 00:54:52 -08:00
test_management_helpers_utils.py fix(proxy): reset members given default team member models on the team's budget window (#51960) 2026-11-15 16:00:44 -08:00
test_object_permission_utils.py feat(proxy): app-scoped read access to Customer Management through object permissions (#52781) 2026-11-19 10:43:41 -08:00
test_resource_display_names.py feat(access-groups): name group vector stores and list them on team info (#51484) 2026-11-13 07:53:04 -08:00
test_team_list_sorting.py feat(ui): sort every teams table data column (#48109) 2026-10-23 16:21:36 -07:00
test_team_member_permission_checks.py fix(proxy): align ownership and scope handling (#50600) 2026-11-08 07:03:36 +00:00
test_team_metadata_validation.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_team_roster_sync.py feat(auth): read virtual keys, jwt key mappings and model access groups through rust repositories (#52173) 2026-11-18 03:53:37 +00:00
test_user_list_sorting.py feat(ui): sort every users table data column (#48105) 2026-10-23 16:12:51 -07:00