mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-25 22:20:43 +00:00
* fix(responses): answer Codex compaction_trigger on the chat-completions bridge Codex's remote compaction v2 ends the Responses input with a compaction_trigger item and expects exactly one compaction output item back. The Responses to chat completions bridge dropped the trigger as a content-less item, so Claude on Bedrock (and every other bridged provider) answered a normal turn and Codex failed with "expected exactly one compaction output item, got 0". When the input ends in a compaction_trigger, the bridge handler now swaps it for the gateway's existing compact summary prompt in the same upstream call and returns the reply as one summary-only compaction item, streamed or not. That item is the shape the bridge already replays as a summary on later turns. Text and tool calls from the summary turn stay out of the output, and a reply with no summary is a 502 so the client retries. Requests without a trailing trigger are unchanged. The strict claude_bedrock xfail on the Codex auto-compaction e2e row is removed. * fix(responses): let a compaction summary turn write text when the caller forces a tool A forced tool_choice on a request ending in compaction_trigger made the model call a tool instead of writing the summary, so every retry came back as a 502. The summary turn now relaxes a forced choice to auto and keeps the tools. * fix(responses): bill, scan and parse compaction summaries safely Three gaps around the summary a compaction_trigger turn returns. A client that disconnected mid-summary was billed no output tokens, because the bridge saved each streamed chunk after hiding its summary text. It now saves the chunk as received and hides the text only from what the client sees. Purview's output scan read message text and tool arguments but not the summary inside a compaction item, so a summary went out unscanned. It now reads it through the same reader the shared Responses guardrails use. The summary-tag parse used a pattern that took seconds on a reply full of unclosed tags. It now finds the tags with two linear searches, which also covers the /v1/messages compaction editor that shares it. * refactor(responses): drop a comment that restates the compaction 502 * test(responses): expect the mid-stream error a dropped summary stream raises |
||
|---|---|---|
| .. | ||
| 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 | ||