mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-03 01:38:46 +00:00
* fix(responses): encode ids on faked Responses streams and drop unmarked reasoning on affinity pins A streamed Responses call that litellm answers with a faked stream (web search interception, providers without native streaming, a JSON answer to a streamed request) returned the upstream response id and raw reasoning ids and blobs. The next turn could then not be routed back to the deployment that minted the reasoning, and a mixed replay reached the wrong deployment and failed with invalid_encrypted_content The faked stream now encodes its response the way the non-streamed path does, so the id carries the deployment and, with encrypted_content_affinity on, the reasoning carries its origin marker. An already-encoded response is left as is. The web search wrap now reuses the handler's replay so it passes the request metadata too When the affinity check pins a request by one item's marker, encrypted reasoning with no marker is now dropped, keeping its summary, since its origin is unknown * test(routing): expect the affinity pin to strip the unmarked reasoning blob * test(responses): cover the post-success hook request and the /v1/messages pin strip with real objects * fix(responses): drop ids paired with stripped reasoning so store-default turns answer With store unset, OpenAI answers 400 to a resent function_call or assistant message whose stored id names a reasoning item the request no longer carries When the strip removes a reasoning item's id, the output items that follow it in the same response now lose their ids too * fix(responses): replay id-less web_search_call items in the chat bridge The affinity strip drops the id of a web_search_call that follows a stripped reasoning item, since OpenAI answers 400 when that id is resent without its reasoning item. The chat bridge rejected an id-less web_search_call and answered 500 when such a session moved to a Claude group, so it now replays the item as text the same way it replays one without an action * fix(router): send unmarked reasoning to the pinned deployment as before Take out the unmarked reasoning strip on affinity pins, the id drop for output items after a stripped reasoning item, and the chat bridge text replay for id-less web_search_call items. The strip cost sessions that worked their hidden reasoning, and a code_interpreter_call session answered 400 where the merge base answered 200, since OpenAI needs both that call's id and its reasoning item when store is unset The faked Responses stream id encoding stays, which is the fix LIT-11035 asks for --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| litellm_completion_transformation | ||
| mcp | ||
| __init__.py | ||
| test_additional_tools.py | ||
| test_custom_tool_call.py | ||
| test_input_items_query.py | ||
| test_instructions_length.py | ||
| test_metadata_codex_callback.py | ||
| test_no_duplicate_spend_logs.py | ||
| test_null_test_fix.py | ||
| test_responses_api_bridge_flag.py | ||
| test_responses_api_lifecycle.py | ||
| test_responses_api_request_body.py | ||
| test_responses_prompt_management.py | ||
| test_responses_router_cooldown.py | ||
| test_responses_streaming_iterator.py | ||
| test_responses_supported_endpoints_passthrough.py | ||
| test_responses_utils.py | ||
| test_responses_websocket_all_providers.py | ||
| test_rust_bridge_websocket.py | ||
| test_sse_output_recovery.py | ||
| test_streaming_iterator.py | ||
| test_streaming_iterator_error_events.py | ||
| test_text_format_conversion.py | ||