What happens when it overflows
Old messages fall out of the window, and the model responds as if they never existed. This looks like sudden forgetfulness in the middle of a conversation.
How to deal with it
Long documents are split into parts and only the necessary piece is provided – this is the idea of RAG. For a dialogue, a short summary of the previous context helps instead of the entire conversation.