Repository navigation
fix(spend): read budget windows from the auth cache under the auth objects key family - #53287
Merged
Merged
Conversation
…jects key family Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
PR overviewNo security issues were found in this pull request. Reviews
|
3 of 6 tasks
Contributor
Author
Contributor
[Low impact] This change appears safe to merge.
|
mateo-berri
deleted the
litellm_declare_rust_spend_counter_key_family
branch
November 21, 2026 03:02
4 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Handwritten 1-3 sentence description
Every pull request's required unit check has been failing since the Rust spend counter step landed, because one cache read in it was not labelled the way the repo's rule asks. This labels that read so the check passes again and the read shows up under its proper name in traces
Details
Link to Devin session: https://app.devin.ai/sessions/3242d590986444e499b3a5b6958207b4
Open in Devin Desktop: https://app.devin.ai/desktop/session/3242d590986444e499b3a5b6958207b4?variant=devin
Requested by: @mateo-berri
TLDR
Problem this solves:
unit passedis red on main and on every PRHow it solves it:
auth_objectskey familyUser Flow
Before: a contributor's pull request cannot merge, because a required check fails on code they did not touch
mainat https://github.com/BerriAI/litellm/pullsrootunit job fails ontest_every_redis_producer_declares_a_key_family, naminglitellm/proxy/spend_tracking/rust_spend_counters.pyunit passedcheck turns red, so the merge button stays blockedAfter: the same pull request gets a green unit check once it has this change
mainat https://github.com/BerriAI/litellm/pullsrootunit job passestest_every_redis_producer_declares_a_key_familyunit passedcheck no longer fails on that testPre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or moreDelays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
E2E exception at 13743cf. The change is one decorator,
@with_service_target(AUTH_OBJECTS_TARGET), on the host callback that reads budget windows from the auth cache, the same labelbudget_reservation.pyalready puts on its auth cache reads. No request, response or stored value changes, so focused tests are the proof and no live proxy run was madeMain fails the check at 0ab513b, the merge base
It passes at 13743cf, together with the new test and the rest of both files
With the decorator taken out again, both tests go red, so the new test catches the label going missing
make checkpasses every gate on this diff except the dashboard API type sync. That one is stale on main from #53214, which addedreject_unregistered_guardrailswithout regeneratingschema.d.ts, and this PR leaves it aloneType
🐛 Bug Fix
✅ Test
Caveats (if any)
Low
lint passedstays red until fix(lint): clear the code-quality failures on main #53237 landsschema.d.tsis stale from feat(guardrails): reject requests that name an unregistered guardrail when reject_unregistered_guardrails is on #53214, not fixed hereFinal Attestation