n. / Prompts and context
Definition
Context window overflow happens when the input to a model is larger than its context window. The provider returns an error, or your code silently cuts text to fit and loses information.
In more detail
In long agent runs it appears slowly: each step adds messages and tool output until a call fails or, worse, an old instruction falls out of view and the agent starts behaving differently. Alert on input size approaching the limit and on truncation in your own code, not just on hard errors.
Example
A research agent pastes full web pages into its history. On step 12 the input reaches 130,000 tokens and the provider rejects the call with a context length error.
