Conversation
…odel_budget generate_key_fn calls validate_model_max_budget which raises "You must have an enterprise license to set model_max_budget" unless premium_user=True. The test was hitting this gate before it could exercise the actual per-model budget logic, causing all three variants to fail with an enterprise-check error instead of the expected budget exceeded / pass-through result. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile SummaryAdded Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| tests/proxy_unit_tests/test_key_generate_prisma.py | Added premium_user=True flag to fix enterprise license check in test |
Last reviewed commit: 1f63036
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.
Summary
test_aasync_call_with_key_over_model_budget(all 3 parametrized variants) was failing becausegenerate_key_fncallsvalidate_model_max_budget, which raises"You must have an enterprise license to set model_max_budget"whenpremium_useris notTrue[gpt-4o-mini-False]/[openai/gpt-4o-mini-False]: got an enterprise error instead of"exceeded budget for model=..."[gpt-4o-True]: caught the enterprise exception in theexceptblock, triggeringassert (should_pass is False)which failed becauseshould_pass=Truesetattr(litellm.proxy.proxy_server, "premium_user", True)alongside the other proxy-server setatrs at the top of the test, matching the pattern used in JWT tests (PR fix(tests): set premium_user=True in JWT tests that call user_api_key_auth #21641)Not related to PR #21107 (bedrock) or PR #21664 (pricing JSON).
Test plan
🤖 Generated with Claude Code