litellm/tests/unit/completion_extras
Mateo Wang 386fb49dff
fix(responses): cache bridged system prompts on stored GPT-6.2 requests (#52906)
* fix(responses): cache bridged system prompts on stored GPT-6.2 requests

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

* fix(responses): skip a system prompt the stored chain already holds

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

* fix(responses): keep the stored chain lookup out of logging callbacks

The lookup that reads the start of a stored chain went through the logged
list_input_items entry points, so callbacks received the chain's stored
messages as a call of its own, even on a no-log request. It now runs as a
no-log subcall. Also narrows the lookup's error handling and drops two
mutable annotations so the strict lint and type discipline gates pass

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

* fix(responses): keep instructions on truncation auto and read Azure chains with AD credentials

A follow-up that sets truncation auto no longer reads the stored chain, since
truncation may cut the stored system message. The lookup also forwards the
deployment's Azure AD credentials, so token-only Azure deployments can read
the chain

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

* fix(responses): read the stored chain only from the provider of the request

A LiteLLM-encoded previous_response_id carries a provider that the listing call
follows, so an id naming another provider sent the request's credentials there.
The lookup now uses the provider's own id and is skipped, keeping instructions,
when the id names a different provider

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

* fix(responses): apply the request timeout to the stored chain lookup

Listing a response's input items dropped the timeout it was given, so the
lookup before a follow-up turn could wait past the caller's limit

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

* fix(responses): send the request's extra headers on the stored chain lookup

A gateway that authenticates by header rejected the lookup, so follow-up
turns kept sending the system prompt twice

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

* fix(responses): send only the caller's instructions on a follow-up whose chain holds the system prompt

A follow-up that carries both a system prompt and the caller's own instructions
sent them joined, so the stored system prompt was billed again. It now sends
only the caller's part, as the first turn did. The stored chain lookup also
uses the deployment's ssl_verify setting

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

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-19 14:03:43 -08:00
..
litellm_responses_transformation fix(responses): cache bridged system prompts on stored GPT-6.2 requests (#52906) 2026-11-19 14:03:43 -08:00
__init__.py test: add __init__.py to migrated tests/unit packages 2026-09-20 11:53:49 +00:00
test_litellm_responses_transformation_transformation.py
test_responses_bridge_provider_propagation.py fix(responses): honor request cache controls on chat completions bridged to the Responses API (#44676) 2026-10-05 17:52:44 -07:00