Commit graph

32371 commits

Author SHA1 Message Date
Julio Quinteros Pro
97f4cfc14a test: Fix additional broken tests
1. test_bedrock_converse_budget_tokens_preserved:
   - Fixed mocking at the correct level (litellm.acompletion instead of client.post)
   - The previous mock didn't work because the code runs through run_in_executor
     and the passed client parameter was not being used

2. test_error_class_returns_volcengine_error:
   - Changed isinstance check to class name comparison
   - This avoids issues when module reloading (in conftest.py) causes class
     identity mismatches during parallel test execution
2026-02-15 13:08:41 -03:00
Julio Quinteros Pro
8d15996b5a test: Fix flaky tests with proper mocking and skip conditions
1. test_acompletion_with_mcp_streaming_metadata_in_correct_chunks:
   - Moved stream consumption inside patch context to avoid real API calls
   - The previous implementation had assertions outside the `with patch(...)`
     block, causing real OpenAI API calls when consuming the stream

2. TestCheckResponsesCost tests:
   - Added skip condition when litellm_enterprise module is not available
   - These tests import from litellm_enterprise.proxy.common_utils.check_responses_cost
     which is only available in the enterprise version
2026-02-15 13:08:30 -03:00
jquinter
a7b4c7536f
Merge pull request #21216 from BerriAI/fix/anthropic-bedrock-test-flakiness
fix(test): resolve merge conflict and fix bedrock thinking test flakiness
2026-02-15 12:45:15 -03:00
jquinter
bf9cf7ad45
Merge pull request #21214 from BerriAI/fix/langfuse-test-isolation
Fix: Langfuse test isolation to prevent flaky failures
2026-02-15 12:42:33 -03:00
jquinter
7c31bd6559
Merge pull request #21246 from BerriAI/fix/remove-unused-reasoning-import
fix: remove unused Reasoning import from transformation.py
2026-02-15 12:42:05 -03:00
Julio Quinteros Pro
4e5361c8c8 fix: remove unused Reasoning import from transformation.py
The Reasoning import was left unused after PR #21103 changed
reasoning=dict(Reasoning()) to reasoning=None. This caused
a Ruff F401 linting error.

Fixes linting error:
- F401: `litellm.types.llms.openai.Reasoning` imported but unused

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 12:37:41 -03:00
jquinter
e6dea2e49b Update litellm/integrations/opentelemetry.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-15 12:31:26 -03:00
Julio Quinteros Pro
54c24a8d08 fix(test): resolve merge conflict and fix bedrock thinking test flakiness
This commit addresses two issues:

1. **Merge conflict resolution**: Resolved merge conflict in litellm/integrations/opentelemetry.py
   that was preventing imports from working. The conflict was in the OpenTelemetry SDK
   LogRecord import section.

2. **Test flakiness fix**: Fixed intermittent failures in test_bedrock_converse_budget_tokens_preserved
   by properly configuring mock objects to avoid unawaited coroutine warnings.

The test was failing in CI with "Expected 'post' to have been called once. Called 0 times."
The root cause was improper mock setup where AsyncMock was creating async child methods
(raise_for_status, json) that returned unawaited coroutines, causing unreliable behavior
across different Python versions and test environments.

**Changes:**
- Set raise_for_status() and json() as explicit MagicMock instances on the response
- Use AsyncMock explicitly for the post() method via patch.object's 'new' parameter
- This ensures response methods are synchronous while the HTTP call remains async

**Testing:**
- Test now passes consistently across 5 consecutive runs
- RuntimeWarnings about unawaited coroutines eliminated (18 warnings → 16 warnings)
- Request JSON verification shows budget_tokens correctly preserved

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 12:31:26 -03:00
Julio Quinteros Pro
76e1b2c015 Remove redundant sys.modules cleanup in Langfuse test tearDown
The manual sys.modules restoration code was redundant because
patch.dict.stop() automatically handles the cleanup. This simplifies
the tearDown method and removes the now-unused _original_langfuse_module
instance variable.

Addresses review comment: https://github.com/BerriAI/litellm/pull/21214#pullrequestreview-3802348462

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 12:26:02 -03:00
Julio Quinteros Pro
9672a1f015 Fix Langfuse test isolation to prevent flaky failures
Fixes test_log_langfuse_v2_handles_null_usage_values flaky test failure
by properly cleaning up sys.modules['langfuse'] in tearDown.

Changes:
- Store original langfuse module in setUp before mocking
- Restore original or remove mock in tearDown to prevent state pollution
- Remove invalid print_verbose parameter from log_event_on_langfuse

Root Cause:
The tearDown method was not cleaning up sys.modules['langfuse'] after
each test, causing mock state to leak between tests. This caused
intermittent failures in CI, especially when tests run in parallel or
in different orders.

Impact:
This test has a long history of flakiness with multiple attempted fixes
(#20475, #17599, #17594, #17591, #17588). The missing sys.modules cleanup
was the underlying issue causing continued failures despite those patches.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 12:26:02 -03:00
jquinter
b2eade11a4
Merge pull request #21104 from BerriAI/chore/add-claude-to-gitignore
chore: add .claude directory to gitignore
2026-02-15 12:12:32 -03:00
jquinter
e642d5d9b0
Merge pull request #21103 from jquinter/fix/responses-reasoning-type-clean
fix: use None instead of Reasoning() for reasoning parameter
2026-02-15 12:11:34 -03:00
jquinter
5bd16a302b
Merge branch 'main' into fix/responses-reasoning-type-clean 2026-02-15 12:11:19 -03:00
yuneng-jiang
caf6db972f
Merge pull request #21237 from BerriAI/litellm_ui_access_groups
[Infra] UI - Unit Tests: Increase timeout on Long Running Tests
2026-02-14 18:16:43 -08:00
yuneng-jiang
ac648af78e add timeout to long running tests 2026-02-14 18:05:27 -08:00
yuneng-jiang
e92b7274c9
Merge pull request #21236 from BerriAI/litellm_ui_access_groups
[Docs] Access Group Docs
2026-02-14 18:01:11 -08:00
yuneng-jiang
227b3551a6 access groups docs 2026-02-14 18:00:22 -08:00
yuneng-jiang
58c430eaf8
Merge pull request #21235 from BerriAI/litellm_ui_access_groups
[Infra] Fixes + UI Build
2026-02-14 17:34:37 -08:00
yuneng-jiang
dd604dbf61 chore: update Next.js build artifacts (2026-02-15 01:33 UTC, node v22.16.0) 2026-02-14 17:33:10 -08:00
yuneng-jiang
1c1807df45 defensive checks for null 2026-02-14 17:30:58 -08:00
Shivam Rawat
47048d103f
Merge pull request #20684 from BerriAI/litellm_preserver_team_key_alias_after_key_regeneration_and_deletion
[Fix] Preserve key_alias and team_id metadata in /user/daily/activity/aggregated after key deletion or regeneration
2026-02-14 17:10:32 -08:00
Ishaan Jaffer
45235ce5d5 docs 2026-02-14 17:09:13 -08:00
Ishaan Jaffer
8a341ebd5d docs fix 2026-02-14 17:09:13 -08:00
yuneng-jiang
801fc22d6e
Merge pull request #21234 from BerriAI/litellm_ui_access_groups
[Feature] UI - Keys/Teams: Add Access Group Selector to Create and Edit Flow
2026-02-14 17:08:13 -08:00
yuneng-jiang
b3fd76a713 adding access groups on keys and teams 2026-02-14 17:01:29 -08:00
Shivam Rawat
db9b98caf3
Merge branch 'main' into litellm_preserver_team_key_alias_after_key_regeneration_and_deletion 2026-02-14 16:59:52 -08:00
Ishaan Jaffer
74a9900fe6 docs fix 2026-02-14 16:58:00 -08:00
Ishaan Jaffer
c93e0dcf9f docs 2026-02-14 16:56:38 -08:00
Ishaan Jaffer
ff502e8b91 DEFAULT_ACCESS_GROUP_CACHE_TTL 2026-02-14 16:48:57 -08:00
shivam
88a631d32a fixed ruff 2026-02-14 16:48:46 -08:00
Ishaan Jaffer
d24869c7ce docs fix 2026-02-14 16:47:01 -08:00
Ishaan Jaffer
9e7dde508f docs fix 2026-02-14 16:45:57 -08:00
Ishaan Jaff
eb432bf911
Litellm notes 181 12 (#21231)
* docs

* docs

* docs

* docs

* fix SCHEMA

* LiteLLM_PolicyTable

* litellm-proxy-extras = {version = "0.4.39",
2026-02-14 16:39:22 -08:00
shivam
6f49261651 fix failing test and lint 2026-02-14 16:36:01 -08:00
yuneng-jiang
27fe16be4b Merge remote-tracking branch 'origin/main' into litellm_ui_access_groups 2026-02-14 16:33:44 -08:00
yuneng-jiang
3e97c0d5d6 temp commit for merge 2026-02-14 16:33:35 -08:00
yuneng-jiang
55f169aa69
Merge pull request #21190 from BerriAI/litellm_access_groups_inte
[Feature] Access Group Checks
2026-02-14 16:28:09 -08:00
yuneng-jiang
da5fbfe17c
Merge pull request #21230 from BerriAI/litellm_e2e_tab_tests
[Fix] UI - E2E Tests: Injecting localStorage Values to Hide Usage Indicator
2026-02-14 16:00:04 -08:00
yuneng-jiang
ff646c154d fixing linting 2026-02-14 15:58:42 -08:00
Ishaan Jaffer
62d3cab965 test fixes 2026-02-14 15:54:20 -08:00
yuneng-jiang
0d6fcee23e injecting localstorage values to hide usageIndicator, prompts, and new badges 2026-02-14 15:49:27 -08:00
Ishaan Jaffer
0b1a9f6623 litellm_mapped_tests_proxy_part2 2026-02-14 15:37:18 -08:00
Ishaan Jaffer
9ce7871d8a test_queue_flush_limit 2026-02-14 15:34:45 -08:00
Ishaan Jaffer
0d697e6c3e litellm_mapped_tests_mcps 2026-02-14 15:20:25 -08:00
Ishaan Jaffer
d5824d871c access_group_ids 2026-02-14 14:43:03 -08:00
yuneng-jiang
ee088992f5
Merge pull request #21224 from BerriAI/litellm_ui_gh_build
[Infra] New Github Workflow For UI Build on Every PR
2026-02-14 13:56:32 -08:00
yuneng-jiang
6e70e59346 adding timeout 2026-02-14 13:53:21 -08:00
yuneng-jiang
2c02a71ef4 addressing comments and build fail 2026-02-14 13:52:26 -08:00
yuneng-jiang
bb9049de44 add new ui build github workflow 2026-02-14 13:46:21 -08:00
Ishaan Jaffer
703bf5add0 BUMP Enterprise PIP 2026-02-14 13:40:48 -08:00