Asked about Working inside the window
How do you handle a conversation that outgrows the context window?
An answer that works
Trim what is no longer needed, especially old tool results. Summarise older turns while keeping recent ones verbatim. Offload large content to storage with an id. Order everything from stable to volatile so prompt caching still applies.
Reading an answer is not being able to give one. The section that teaches this is Working inside the window, 4 hours of Context management.
Learn this properlyAlso asked about Context management
What gets lost when you compact a conversation, and why does it matter?Why not just use a model with a larger context window?How would you give an assistant long-term memory?Why not store the whole conversation history as memory?A user says the assistant is confidently wrong about their project. How do you debug it?