Skip to content

OffloadStrategy

Defined in: src/context-manager/strategies/offload/base.ts:34

Experimental

Strategy returned by Offload.drop/truncate/summarize. Without conditions it acts on each matching block as it arrives, including the one the model answers next; targets '*' and 'media' need conditions from .when(). A strategy keeps per-agent state, so give each agent its own.

readonly name: string;

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

Experimental

Stable identifier for logging and observability.

ContextStrategy.name

when(conditions?): OffloadStrategy;

Defined in: src/context-manager/strategies/offload/base.ts:36

Experimental

Returns a copy of this strategy with these conditions in place of its current ones.

ParameterType
conditions?OffloadConditions

OffloadStrategy


init?(agent, stash?): void;

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

Experimental

Called once when the ContextManager is attached to an agent. Strategies can use this to register hooks (e.g., eager offloading on message arrival).

ParameterType
agentLocalAgent
stash?Stash

void

ContextStrategy.init


apply(context): Promise<boolean>;

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

Experimental

Attempt to reduce context. Returns true if it made changes, false if it decided not to act (e.g., conditions not met, nothing to offload).

ParameterType
contextContextState

Promise<boolean>

ContextStrategy.apply