Commit Graph

3 Commits

Author SHA1 Message Date
yuneng-jiang a81a1968ed Fix test isolation: clear litellm.callbacks and model_fallbacks between tests
The isolate_litellm_state conftest fixture saved/restored litellm.callbacks
but never cleared it before each test, unlike the other callback lists. It
also didn't handle litellm.model_fallbacks. Leaked callbacks and fallback
config caused mocked tests to route through Router/fallback paths, hitting
real APIs with mock keys.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 16:43:15 -07:00
Ishaan Jaff 02670582c5 fix(tests): replace asyncio.sleep(1) with event-based wait in metadata callback tests (#21805) 2026-02-21 12:40:06 -08:00
Chiranjeevisantosh Madugundi dcff3260df fix: preserve metadata for custom callbacks on codex/responses path (… (#21243)
* fix: preserve metadata for custom callbacks on codex/responses path (#21204)

- Use metadata or litellm_metadata when calling update_environment_variables
  in responses/main.py so metadata is not overwritten by None on the
  bridge path (completion -> responses API).
- Add tests for metadata in custom callback for codex models and for
  litellm_metadata in aresponses().

Co-authored-by: Cursor <cursoragent@cursor.com>

* Update tests/test_litellm/responses/test_metadata_codex_callback.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-16 08:59:38 -08:00