Interface SessionSummarizerOptions

Options for constructing a SessionSummarizer.

interface SessionSummarizerOptions {
    invoker: SessionSummarizerInvoker;
    cacheDir?: string;
    modelId: string;
    maxTokens?: number;
    templateVersion?: string;
    onCallCost?: ((tokensIn, tokensOut, model) => void);
}

Properties

LLM invoker — produces the summary text.

cacheDir?: string

Optional directory for persistent disk cache. When set, summaries survive across process restarts and re-runs. Mirrors the cache layout of CachedEmbedder in framerslab/agentos-bench (src/cognitive/CachedEmbedder.ts).

modelId: string

Model identifier baked into the cache key so switching models invalidates the cache automatically. Should match the invoker's underlying model.

maxTokens?: number

Maximum tokens to ask the LLM to emit. Default 140 (generous headroom over the 50–100 target; truncate post-hoc if needed).

templateVersion?: string

Template version. Bump whenever the summarization prompt changes so disk caches from prior versions are invalidated. Current: 'v1-2026-04-19'.

onCallCost?: ((tokensIn, tokensOut, model) => void)

Optional cost-tracker hook. Called after every uncached call.

Type declaration

    • (tokensIn, tokensOut, model): void
    • Parameters

      • tokensIn: number
      • tokensOut: number
      • model: string

      Returns void