mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-02 01:28:38 +00:00
* fix(responses): keep every input item in the logged input The cache control and prompt management hooks ran on the role-bearing input items only and left that filtered list as the logged messages, so function_call and function_call_output items never reached logging callbacks. A stray messages field on a /responses body also replaced the logged input Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(responses): keep the lint gate level and cover the stored prompt path The pre-call logging check read the request body through untyped attribute accesses, which pushed the type gate past its ceiling. It now goes through one typed helper. Adds a regression test for a stored prompt on /responses Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(responses): log the copy a guardrail masked, test injection on native routing A pre-call guardrail that rewrites only messages on a Responses call keeps its masked copy in the logged input, and one that replaces input is logged too. The cache-control logging tests now run on native Responses routing and assert the merged input with the injected marker Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(responses): log a string input as a user message and keep every item in WebSocket turn logs Logging.update_messages wraps a str input the way Logging.__init__ does, so a /v1/responses call with input="..." still logs a user message after the logged input is reset from the hooked body. Each Responses WebSocket turn now logs every item of its response.create frame, so function_call and function_call_output items reach callbacks there too. The new tests are fully typed and their guardrail stubs return new dicts * fix(responses): log nested response.create frames and record WebSocket turns without patching Logging * fix(responses): set a WebSocket turn's logged messages through update_messages log_pre_api_call's messages argument and the failed-turn token estimate read Logging.messages, which still held the connection's value. Also drop the WebSocket route from the responses input check, since its pre-call body never carries input * test(responses): prove vector store context keeps tool items in the logged input * fix(xecguard): read input_text and output_text parts when flattening messages * test(responses): fake OpenAI over HTTP in the logged input tests and type the XecGuard test --------- Co-authored-by: mateo <277851410+mateo-berri@users.noreply.github.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| guardrail_hooks | ||
| __init__.py | ||
| test_anthropic_sse.py | ||
| test_auto_router_compression.py | ||
| test_content_filter_path_traversal.py | ||
| test_content_utils.py | ||
| test_custom_code_security.py | ||
| test_deferred_guardrail_logging.py | ||
| test_endpoint_image_scan.py | ||
| test_guardrail_coverage.py | ||
| test_guardrail_endpoints.py | ||
| test_guardrail_helpers.py | ||
| test_guardrail_initializers.py | ||
| test_guardrail_load_balancing.py | ||
| test_guardrail_registry.py | ||
| test_init_guardrails.py | ||
| test_llm_as_a_judge.py | ||
| test_mcp_jwt_signer.py | ||
| test_pillar_guardrails.py | ||
| test_prompt_security_guardrails.py | ||
| test_qostodian_nexus_guardrail.py | ||
| test_usage_endpoints.py | ||
| test_usage_tracking.py | ||