litellm/tests/unit/proxy/utils/proxy_logging
ryan-crabbe-berri 829d50990d
fix(proxy): build configured logging callbacks at boot so a broken callback fails startup instead of the first request (#46378)
* fix(proxy): build configured logging callbacks at boot so a broken callback fails startup instead of the first request

Startup already built every configured callbacks, success_callback and
failure_callback entry, but through the per-request helper that swallows
every construction error. A callback whose SDK could not be imported (for
example langfuse outside the supported version range) stayed a string, so
the first request on each worker rebuilt it inside function_setup and
returned a 500.

Startup now builds them with a variant that re-raises ImportError naming
the callback, which fails boot. Other construction errors keep the old
non-blocking behavior, and callbacks added at runtime keep the lenient path.

* refactor(proxy): build the configured callback replacements in one pass

Collect the startup-built callbacks with a generator and a frozen mapping
instead of a mutable dict filled in a loop, and drop a docstring that
restated the function body

---------

Co-authored-by: yuneng-jiang <yuneng@berri.ai>
2026-10-14 16:51:55 +00:00
..
__init__.py
_harness_smoke_test.py
conftest.py
test_alerting.py
test_callback_capabilities_class.py
test_callback_capabilities_dataclass.py
test_during_call_hook.py
test_guardrail_pipeline.py feat(policy-engine): stream detect-only post_call pipeline steps live when buffering is off (#45516) 2026-10-09 15:46:51 -07:00
test_internal_usage_cache.py
test_lifecycle.py fix(proxy): build configured logging callbacks at boot so a broken callback fails startup instead of the first request (#46378) 2026-10-14 16:51:55 +00:00
test_mcp_bridging.py feat(mcp): hand listed-tool description and input schema to pre-call hooks per caller (#41162) 2026-10-04 00:53:58 -07:00
test_module_helpers.py
test_post_call_failure_hook.py fix(proxy): skip failure rows for expired Admin UI session keys on dashboard info routes (#45881) 2026-10-12 13:56:05 -07:00
test_post_call_success_hook.py
test_pre_call_hook.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_streaming_hooks.py