Skip to content

ContextState

Defined in: src/context-manager/types.ts:42

Experimental

State passed to strategies during apply().

messages: Message[];

Defined in: src/context-manager/types.ts:44

Experimental

The agent’s current message array (the context window). Strategies mutate this in place.


agent: LocalAgent;

Defined in: src/context-manager/types.ts:47

Experimental

The agent instance.


utilization: number;

Defined in: src/context-manager/types.ts:50

Experimental

Current context utilization ratio (0-1+). Above 1.0 means overflow.


optional overflow?: boolean;

Defined in: src/context-manager/types.ts:57

Experimental

Set when running in response to a ContextWindowOverflowError. Strategies should bypass utilization gates when true — the provider already rejected the request, so the estimate is not trustworthy.


optional stash?: Stash;

Defined in: src/context-manager/types.ts:60

Experimental

L1 stash for persisting offloaded content. Present when storage is configured.