For AJAX requests IPB does not update user session and after some time it is removed. IPB can not determine the user's browser and prohibits the use of RTE editor. Instead of the text in the chat starts output HTML.
Maybe it's a mistake IPB - to determine the browser, it uses session data, not the headers.
IPB: 3.1.2
Dirty fix