litellm/tests/test_litellm/proxy/pass_through_endpoints
Yassin Kortam 63490655ad
fix(pass_through): log pre-call guardrail blocks at WARNING, not ERROR with a traceback (#31500)
A pre-call guardrail block on a pass-through endpoint (e.g. OpenAI moderation
flagging disallowed content) was logged at ERROR level with a full stack trace,
even though the guardrail is working as designed and the client correctly
receives the 4xx. The generic except in pass_through_request logged every
exception via verbose_proxy_logger.exception(), so an intentional block produced
scary traceback noise for operators tailing logs.

Branch on the existing CustomGuardrail._is_guardrail_intervention classifier
(the same predicate pipeline_executor already uses) so guardrail interventions
log once at WARNING without a traceback while genuine failures keep their ERROR
and traceback. This covers every guardrail that signals a block through the
shared typed exceptions or an HTTPException 400, not just OpenAI moderation, and
leaves the client-facing response unchanged.

Resolves LIT-3538
2026-06-27 12:18:40 -07:00
..
llm_provider_handlers fix(passthrough,streaming): recover cost on interrupted and agentic Anthropic streams (#31035) 2026-06-22 18:51:13 -07:00
test_carry_guardrail_logging_info.py fix(passthrough): emit otel guardrail span when a guardrail blocks (#29470) 2026-06-02 11:46:25 -07:00
test_llm_pass_through_endpoints.py feat(proxy): enforce key/team guardrails on bedrock passthrough routes (#30194) 2026-06-12 07:23:29 -07:00
test_method_specific_routing.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_pass_through_endpoints.py fix(pass_through): log pre-call guardrail blocks at WARNING, not ERROR with a traceback (#31500) 2026-06-27 12:18:40 -07:00
test_passthrough_auth_default.py fix(passthrough): default auth=True; drop enterprise gate on the safe option 2026-04-29 23:10:59 +00:00
test_passthrough_endpoints_common_utils.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_passthrough_guardrail_block_otel_span.py fix: missing span for guardrail passthrough (#29552) 2026-06-03 01:25:15 +00:00
test_passthrough_guardrails.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_passthrough_guardrails_field_targeting.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_passthrough_post_call_guardrails.py fix(proxy): extend response headers hook to streaming, TTS, image gen, and pass-through (#24232) 2026-06-09 22:10:23 +02:00
test_streaming_handler_interrupt.py fix(passthrough): schedule spend logging via durable logging worker (#31485) 2026-06-26 18:45:10 -07:00
test_vertex_ai_batch_passthrough.py fix(vertex-ai): fix zero cost/usage on completed Vertex AI batch jobs (#27912) 2026-05-15 04:47:02 -07:00
test_vertex_passthrough_load_balancing.py fix(proxy): Bedrock Knowledge Base pass-through: preserve SigV4 headers and signed request body (#27526) 2026-05-25 19:21:55 +05:30
test_watsonx_proxy_route.py Litellm OSS Staging 010626 (#29422) 2026-06-01 21:42:51 -07:00