fix(responses): store complete assistant response in Redis sessions#89
Open
josemaria-vilaplana wants to merge 1 commit intoupstream-sync/v1.81.0-stablefrom
Open
Conversation
Previously, Redis session storage only stored input messages, missing the assistant response with tool_calls and provider_specific_fields. This caused Gemini thinking models (2.5/3) to fail on multi-turn tool calling conversations with "Base64 decoding failed for thought_signature" errors. Changes: - Extract and store complete assistant message including tool_calls - Preserve provider_specific_fields containing thought_signatures - Handle both streaming and non-streaming response paths - Add comprehensive tests for thought_signature preservation Fixes multi-turn conversations with Gemini thinking models when using tool calling via the Responses API. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
mateo-di
reviewed
Feb 6, 2026
Collaborator
mateo-di
left a comment
There was a problem hiding this comment.
@josemaria-vilaplana can we check if we have a test already that verify this carto-customization in the smoke-ai tests in cloud-native?
Author
No way we can test this with our current tests approach. This fails randomly, only when the thought_signatures in base64 is bigger then 2K, which happens only from time to time depending on the encoded value. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tool_callsandprovider_specific_fieldsChanges
tool_callsin Redis sessionsprovider_specific_fieldscontainingthought_signatures(critical for Gemini thinking models)Test plan
pytest tests/test_litellm/responses/litellm_completion_transformation/test_thought_signature_preservation.py(17 passed)pytest tests/test_litellm/responses/litellm_completion_transformation/(98 passed, 1 skipped due to missing dependency)🤖 Generated with Claude Code