DeferStrategy
Defined in: src/context-manager/strategies/deferred-tool-loading.ts:85
Experimental
A strategy that keeps tools’ input schemas out of the model’s context until the model loads them with load_tools.
The model still sees each deferred tool’s name and description. A call to a deferred tool made before its load
doesn’t run: the model gets the tool’s schema and calls it again. It never changes the messages.
Extends
Section titled “Extends”Properties
Section titled “Properties”readonly name: string;Defined in: src/context-manager/types.ts:21
Experimental
Stable identifier for logging and observability.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”when()
Section titled “when()”when(conditions?): DeferStrategy;Defined in: src/context-manager/strategies/deferred-tool-loading.ts:91
Experimental
Returns a copy of this strategy with these conditions in place of its current ones.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
conditions? | DeferConditions |
Returns
Section titled “Returns”DeferStrategy
Throws
Section titled “Throws”Error when a condition name is unknown or its value is invalid
init()?
Section titled “init()?”init?(agent, archive?): void;Defined in: src/context-manager/types.ts:30
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).
archive is @internal — it is not exported, so its shape is not a stable contract for
strategies outside the SDK. Pass it to Offload strategies rather than calling it directly.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
agent | LocalAgent |
archive? | Archive |
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:36
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>