Start here. This is the direct spoken answer to practice first.
Overview
Limit handling must be intentional because a partially removed instruction or answer can look valid while changing the feature's meaning.
The service should calculate or estimate the complete token budget before calling the model, including instructions, history, retrieved text, tool results, and reserved output. If it does not fit, it should apply an explicit policy: reject an oversized input, remove low-priority history, retrieve fewer better passages, summarize an approved portion, or use a model with a suitable window. It should never silently cut arbitrary tokens. A truncated response is detected from the provider's finish reason or missing validated structure.