Expand description
Pure, task-aware context pressure policy. No I/O, clocks, prompts, or tools.
Pressure is preparation, not a percentage-based stop. Existing execution can continue through the warning band, but a new task or execution after a plan should start in fresh context. At rollover only a bounded Plan/WrapUp extension is allowed; provider capacity always takes precedence.
The host owns token accounting and safe session replacement. Assess before
each model round, then persist assessment.next_state at that admission
checkpoint (not for UI-only polling). It charges one round for each bounded
extension. Keep that state across phase reports and mode changes; reset it
only after successful context replacement. Neither phase reports nor these
decisions authorize tools, disclosures, or mutations of session history.
Structs§
- Context
Assessment - Context
Budget - Host-supplied, conservative accounting for the next request.
- Context
State - Per-context state. Private counters prevent phase reports from replenishing the allowance. The host must preserve this state across model rounds.
- Context
Thresholds
Enums§
- Context
Action - Context
Band - Context
Reason - Work
Phase - Advisory task phase. A report is not evidence of authorization or capacity.
Functions§
- assess_
context - Pure assessment, independent of UI, model prose, and tool authority. Hard capacity wins even in Off mode. Invalid programmatic configuration fails closed; config-file validation normally catches it before this call.