Skill 5.2.1
Resolve content handling issues to ensure that necessary information is processed completely in FM interactions (for example, by using context window overflow diagnostics, dynamic chunking strategies, prompt design optimization, truncation-related error analysis)
Key Concepts
Context window overflow appears as a validation error that the input is too long, or as silently truncated history in frameworks that trim automatically. Diagnosis compares input token counts (from usage data or estimation) with the model's context window. Fixes include fewer retrieved chunks, summarising history, moving to a model with a larger window or splitting the task (map-reduce summarisation).
Truncated outputs have a stopReason of max_tokens; the fix is to raise maxTokens, ask for shorter output or generate in sections. Dynamic chunking sizes chunks or the number of chunks according to the remaining token budget, and prompt design optimisation places key instructions where models attend well, typically at the start and repeated near the end of long prompts.