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.
Extends
Section titled “Extends”Properties
Section titled “Properties”readonly name: string;Defined in: src/context-manager/types.ts:23
Experimental
Stable identifier for logging and observability.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”when()
Section titled “when()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
conditions? | OffloadConditions |
Returns
Section titled “Returns”OffloadStrategy
init()?
Section titled “init()?”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).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
agent | LocalAgent |
stash? | Stash |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”apply()
Section titled “apply()”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).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
context | ContextState |
Returns
Section titled “Returns”Promise<boolean>