litellm/tests/unit/proxy/guardrails
devin-ai-integration[bot] 888686d858
test(headroom): pin that SDK-echoed null tool_calls never reach /v1/compress (#39667)
* fix(headroom): drop null tool_calls before calling /v1/compress

headroom-ai 0.27.0 through 0.30.0 iterate msg.get("tool_calls", []) and fail
with 'NoneType' object is not iterable when an assistant row carries an explicit
tool_calls: null, which the fail-closed guardrail then surfaces as a 502. Strip
the null key from rows sent to the compression service; real tool_calls lists
are forwarded unchanged

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(headroom): pin that SDK-echoed null tool_calls never reach /v1/compress

Main now withholds every assistant row from /v1/compress (#39974), so the
null tool_calls strip added here never runs on a row headroom-ai 0.27-0.30
fails on. Drop the strip and pin the customer's history shape through the
public OpenAI chat translation handler instead.

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: yucheng-berri <293926326+yucheng-berri@users.noreply.github.com>
2026-10-10 17:29:46 -07:00
..
guardrail_hooks test(headroom): pin that SDK-echoed null tool_calls never reach /v1/compress (#39667) 2026-10-10 17:29:46 -07:00
__init__.py feat(guardrails): send a configured gateway_name from noma_v2 to Noma (#43678) 2026-09-29 10:20:40 -07:00
test_auto_router_compression.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_content_filter_path_traversal.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_content_utils.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_custom_code_security.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_deferred_guardrail_logging.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_guardrail_coverage.py test: move offline proxy auth, hook, spend and pass-through tests to tests/unit (#45568) 2026-10-09 09:49:13 -07:00
test_guardrail_endpoints.py feat(guardrails): split logging_only_scope direction from input-failure policy (#45709) 2026-10-10 01:46:39 -07:00
test_guardrail_initializers.py refactor(types): replace Any with proven types in 157 files (#44798) 2026-10-06 15:31:54 +00:00
test_guardrail_registry.py feat(guardrails): split logging_only_scope direction from input-failure policy (#45709) 2026-10-10 01:46:39 -07:00
test_init_guardrails.py refactor(proxy): expose public names for private proxy helpers (#45170) 2026-10-07 18:59:27 -07:00
test_llm_as_a_judge.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_mcp_jwt_signer.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_pillar_guardrails.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_prompt_security_guardrails.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_qostodian_nexus_guardrail.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_usage_endpoints.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00
test_usage_tracking.py test(proxy): move management_endpoints, management_helpers and guardrails tests into tests/unit/proxy (#44003) 2026-10-01 10:52:03 -07:00