Threshold and precedence
Use the existing context-usage slider to choose the per-model threshold. The Rolls over by N% label includes the five-percentage-point force buffer: a 70% slider setting displays Rolls over by 75%. Automatic rollover is evaluated when sending and after a settled tool step. The displayed percentage is an upper bound; the hard request ceiling takes precedence if reached first. Rollover starts a fresh window without summarizing earlier messages. The transcript shows a Context window rollover divider; earlier messages remain on disk, in the UI, and in exports.- Manual
/compactand idle compaction still summarize normally. - Continuous compaction and effective RLM take precedence over rollover.
- Setting the usage threshold to 100% disables automatic rollover and its warning. Hard request-size checks still apply, including after settled tool steps: the turn can pause without queuing a rollover or discarding completed tool results.
session_historymust be allowed by the agent’s inherited tool policy and any caller restrictions. Built-in Exec, Plan, and Explore already allow it. Narrow custom agents can addsession_historyor a matching wildcard totools.add. If access is omitted or disabled, rollover pauses before sealing existing context instead of falling back to a lossy summary.
/compact retain their existing middleware behavior.
Keeping useful context
Two machine-authored prompts, each at most once per window, ask the agent to write important context to the conventionalworkspace/context-notes.md file, up to 8 KiB, if the workspace is writable:
- An advance warning (the collapsible Context budget warning row) fires ahead of the rollover point and asks the agent to write or update the notes, then continue the task. It fires ten percentage points below the threshold (fifteen before the rollover point) and, on small context windows, at least 6,144 tokens before the rollover point, but never earlier than half of the usable window.
- A final flush (the Context window ending: notes flush row) is offered when a settled tool step crosses the rollover point mid-stream with enough headroom for one more notes-writing step. The agent gets a single provider step for one
memorycall, with every tool other thanmemoryandsession_historydisabled for that step,memorylimited to one create-or-update ofworkspace/context-notes.md, and repository tool hooks and programmatic tool calling turned off; the window is then sealed regardless of what it wrote. The final flush is skipped when memory is read-only,session_historyis unavailable, the projected usage leaves no headroom (checked again when the step dispatches), a user message is already queued, the rollover happens on a new user message rather than mid-stream, or Xum restarted before the flush step dispatched.
session_history to list windows, search, or read earlier messages in the same workspace. Results are capped at 16 KiB per call, with scans bounded to 2 MiB, 500 rows, and 1 MiB per line. Large histories may require further bounded calls.
The newest manual /clear --soft is a privacy floor: the tool cannot retrieve messages before it. Manual reset behavior and edited-file carryover are unchanged. Turning the experiment off removes retrieval access without deleting old windows.