litellm/tests/test_litellm/proxy/utils/proxy_logging
Yassin Kortam c14329128b
fix(guardrails): match policy-pipeline block response to direct guardrail attachment (#31421)
When a guardrail blocked a request through a flow-builder policy pipeline, the
proxy discarded the guardrail's own exception and synthesized a generic
guardrail_pipeline_error response, so the same guardrail produced a different
HTTP response and trace span depending on whether it was attached directly or
via a policy. The pipeline now carries the guardrail's original exception and
re-raises it verbatim on block, enriching it with the blocking guardrail's name
and mode exactly as the direct path does, so the two attachment methods are
indistinguishable to clients and tracing. The generic pipeline error remains
only as a fallback for blocks with no underlying exception (e.g. a guardrail
that could not be found).

Resolves LIT-4041
2026-06-26 14:25:10 -07:00
..
__init__.py test(proxy/utils): pin ProxyLogging behavior (#29485) 2026-06-02 17:45:39 -07:00
_harness_smoke_test.py test(proxy/utils): pin ProxyLogging behavior (#29485) 2026-06-02 17:45:39 -07:00
conftest.py test(proxy/utils): pin ProxyLogging behavior (#29485) 2026-06-02 17:45:39 -07:00
test_alerting.py test(proxy/utils): pin ProxyLogging behavior (#29485) 2026-06-02 17:45:39 -07:00
test_callback_capabilities_class.py test(proxy/utils): pin ProxyLogging behavior (#29485) 2026-06-02 17:45:39 -07:00
test_callback_capabilities_dataclass.py test(proxy/utils): pin ProxyLogging behavior (#29485) 2026-06-02 17:45:39 -07:00
test_during_call_hook.py test(proxy/utils): pin ProxyLogging behavior (#29485) 2026-06-02 17:45:39 -07:00
test_guardrail_pipeline.py fix(guardrails): match policy-pipeline block response to direct guardrail attachment (#31421) 2026-06-26 14:25:10 -07:00
test_internal_usage_cache.py test(proxy/utils): pin ProxyLogging behavior (#29485) 2026-06-02 17:45:39 -07:00
test_lifecycle.py test(proxy/utils): pin ProxyLogging behavior (#29485) 2026-06-02 17:45:39 -07:00
test_mcp_bridging.py test(proxy/utils): pin ProxyLogging behavior (#29485) 2026-06-02 17:45:39 -07:00
test_module_helpers.py test(proxy/utils): pin ProxyLogging behavior (#29485) 2026-06-02 17:45:39 -07:00
test_post_call_failure_hook.py test(proxy/utils): pin ProxyLogging behavior (#29485) 2026-06-02 17:45:39 -07:00
test_post_call_success_hook.py test(proxy/utils): pin ProxyLogging behavior (#29485) 2026-06-02 17:45:39 -07:00
test_pre_call_hook.py test(proxy/utils): pin ProxyLogging behavior (#29485) 2026-06-02 17:45:39 -07:00
test_streaming_hooks.py test(proxy/utils): pin ProxyLogging behavior (#29485) 2026-06-02 17:45:39 -07:00