Context Window
The maximum number of tokens a model can consider in one request — a hard, shared budget.
The context window is the token ceiling for a single call. Everything competes for it: system prompt, tool definitions, chat history, retrieved documents, the user message, plus room reserved for the output. Exceed it and the request is rejected or truncated — which is why agents need compaction.
Worked example: in a 128K window you might budget 2K system prompt + 8K tool schemas + 40K chat history + 60K retrieved docs and still reserve ~16K for the answer — and a long agent run blows through that fast. Gotcha: fitting under the limit is not enough — models recall the middle of a long context worse than the ends (“lost in the middle”), so stuffing the window can lower answer quality even when it technically fits.