File tree Expand file tree Collapse file tree
litellm/responses/litellm_completion_transformation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1080,13 +1080,15 @@ async def _patch_get_session_from_redis(previous_response_id: str) -> Optional[D
10801080 if litellm .cache is None or not hasattr (litellm .cache , 'cache' ) or not hasattr (litellm .cache .cache , 'init_async_client' ):
10811081 return None
10821082
1083- # NOTE: Use the raw previous_response_id as-is (no decoding)
1084- # The response_id stored in Redis is the same format as previous_response_id
1085- # (both are the LiteLLM-encoded IDs containing provider/model info)
1083+ # Decode response ID to get actual request ID
1084+ from litellm .responses .utils import ResponsesAPIRequestUtils
1085+ actual_request_id = ResponsesAPIRequestUtils .decode_previous_response_id_to_original_previous_response_id (
1086+ previous_response_id
1087+ )
10861088
10871089 # Get session data from Redis using the async Redis client
10881090 async_redis_client = litellm .cache .cache .init_async_client ()
1089- session_json = await async_redis_client .get (name = f"litellm_patch:session:{ previous_response_id } " )
1091+ session_json = await async_redis_client .get (name = f"litellm_patch:session:{ actual_request_id } " )
10901092
10911093 if session_json :
10921094 return json .loads (session_json )
You can’t perform that action at this time.
0 commit comments