litellm/tests/test_litellm/proxy/policy_engine
mateo-berri 20d80b5420 fix(guardrails): scan each choice's tool-call arguments apart on n>1 streams and log why a rewrite was discarded
The rebuilt streamed response keyed tool-call fragments by tool index alone, so
on n>1 chat streams the two choices' argument fragments were concatenated into
one string and post_call guardrails scanned garbled JSON. Fragments are now
keyed by (choice index, tool index).

When a guardrail's rewrite cannot be written back to the stream (multi-choice
streams, a rewrite that adds or drops a tool call, legacy-hook shapes the
translation cannot rescan), the pipeline now logs a warning naming the
guardrail and the exact reason before releasing the original stream.

Also commits the regenerated dashboard API types that make check produced.
2026-09-13 01:45:07 -07:00
..
__init__.py
test_attachment_registry.py perf(policy_engine): dedup attachments in one pass after sorting (#40883) 2026-09-12 14:19:20 -07:00
test_condition_evaluator.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_pipeline_executor.py fix(guardrails): scan each choice's tool-call arguments apart on n>1 streams and log why a rewrite was discarded 2026-09-13 01:45:07 -07:00
test_policy_engine_endpoints.py fix(policy_engine): decide config policy suppression from fresh db query only 2026-07-30 16:01:57 -07:00
test_policy_matcher.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_policy_resolver.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_policy_validator.py fix(policies): reject non-existent team/key/model scope entries on attachment create (#32131) 2026-07-04 11:58:29 -07:00
test_policy_versioning.py test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
test_policy_versioning_e2e.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_response_retrieval.py fix(proxy): type the new pipeline tests and keep tag values out of the deferral warning 2026-09-08 19:59:09 -07:00