CompactionPolicy
Defined in: agents/src/types.ts:318
Model-only history trimming. The full journal and session turn are never shortened.
Properties
Section titled “Properties”contextWindow
Section titled “contextWindow”contextWindow: number;Defined in: agents/src/types.ts:322
Supply the actual window for the configured model. No model-name guessing.
identity
Section titled “identity”identity: string;Defined in: agents/src/types.ts:320
Change when the summary prompt or hidden provider configuration changes.
keepTokens?
Section titled “keepTokens?”optional keepTokens?: number;Defined in: agents/src/types.ts:328
Recent tokens to keep. Core’s historyBudgetTokens(contextWindow) is the default.
retryOnContextLimit?
Section titled “retryOnContextLimit?”optional retryOnContextLimit?: boolean;Defined in: agents/src/types.ts:326
Keep the run’s task through every cut. A length rejection before the first chunk can buy one shorter retry per run, using the same turn. Never retries a hosted-tool request. After a restart, use a trim note rather than resend an interrupted summary.
summarize?
Section titled “summarize?”optional summarize?: object;Defined in: agents/src/types.ts:331
Omit to trim without a paid call. This provider must do inference only. The SDK sends no tools, allows one attempt, counts usage and refuses interrupted summarization.
instructions
Section titled “instructions”instructions: string;maxTokens
Section titled “maxTokens”maxTokens: number;provider
Section titled “provider”provider: Provider;