Unit Tests: Proxy DB Operations / proxy-db (auth-checks, tests/proxy_unit_tests/test_auth_checks.py tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (remaining, tests/proxy_unit_tests --ignore=tests/proxy_unit_tests/test_key_generate_prisma.py --ignore=tests/proxy_unit_tests/test_auth_checks.py --ignore=tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Has been cancelled
Remove unresolved merge conflict markers (<<<<<<<, =======, >>>>>>>) that caused
'Invalid statement at line 8534' when running poetry install. The conflict was
in the [metadata] content-hash between branches.
Rename tests/test_litellm/llms/azure_ai/test_cost_calculator.py to
test_azure_ai_cost_calculator.py. Two test files shared the same module name
(test_cost_calculator) in different paths, causing pytest 'import file mismatch'
when collecting. Unique basenames resolve the collision.
Make asyncio.gather resilient to partial failures. If key, team, or
user lookup raises, log at debug level and allow the others to
complete. Prevents one failing lookup from blocking the rest.
Replace sequential await of key, team, and user budget metric lookups
with asyncio.gather() so they run in parallel. Reduces latency from
T_key + T_team + T_user to max(T_key, T_team, T_user) when lookups
hit DB or cache.
Create fresh mock objects within the test instead of reusing mocks
from setUp that have side_effect configured. The setUp's side_effect
on mock_langfuse_client.trace can interfere with return_value settings
when tests try to reset and reconfigure mocks.
Using dedicated mock objects for this test avoids state pollution
from setUp's side_effect configuration and makes the test more
deterministic in parallel execution environments.
Set cached tokenizer config directly and mock both sync and async
tokenizer functions to avoid race conditions when running with
parallel test execution (-n 16).
The issue was that parallel tests could populate the
litellm.known_tokenizer_config cache between clearing it and
when the code checked it. This caused the sync code path to be
used instead of the async path, bypassing the mocked async functions.
Fix:
1. Set cache directly instead of clearing it
2. Also mock sync versions _get_tokenizer_config and _get_chat_template_file
This ensures the test is deterministic regardless of test execution order.
Add Claude Opus 4.6 entries for Anthropic, Bedrock Converse, and Vertex AI.
Align pricing and capability metadata with Anthropic docs, including
long-context rates, above-200k prompt-caching rates, prefill removal,
and tool-use system prompt token counts.
Register the Bedrock Converse model ID in constants and add targeted
tests to validate model map values and converse registration.
The daily spend tables store dates in UTC, but the UI sends dates in the
user's local timezone. This causes a mismatch where records from the
user's evening (stored as the next UTC day) don't appear when filtering
by "today".
Changes:
- Add `_adjust_dates_for_timezone()` helper to expand date range based
on timezone offset
- Add `timezone` query parameter to `/user/daily/activity` and
`/user/daily/activity/aggregated` endpoints
- Frontend sends `timezone` using `Date.getTimezoneOffset()`
For users west of UTC (e.g., PST), end_date is extended by 1 day.
For users east of UTC (e.g., IST), start_date is extended by 1 day earlier.
This ensures all records within the user's local date range are captured.
The cast(Any, message) pattern was used to suppress typed-dict mutation
warnings, but the parameter has no type annotation so it's unnecessary.
Direct assignment works and eliminates the F401 unused-import lint error.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>