Skip to content

[compact]

Auto-compaction settings. When the session’s estimated input tokens cross threshold_pct of the effective context budget (context_length - max_output_tokens), the next LLM call is preceded by a summarization pass that replaces the transcript with a compact rewrite. See sealed-docs/docs/internal/compacting.md.

threshold_pct is Option<u32> because a good default depends on the model’s context_length: smaller contexts have less absolute headroom at the same percentage and need to fire earlier. Left as None, the runtime picks a value from [CompactConfig::default_threshold_pct]; an explicit value in seal.toml always wins.

TypebooleanDefaulttrue

Disable auto-compaction entirely. Default true.

TypeintegerDefault20000

Cap on the compact call’s own max_output_tokens. Anthropic bills and counts output-budget against the context window, so a bloated cap eats into the very headroom compaction is trying to reclaim. 20K is enough for a detailed 9-section summary.

Typeinteger | nullDefaultnull

Optional override of the context-aware default threshold.

Typeobject

Time-based microcompact: when the wall-clock gap since the last assistant message exceeds gap_threshold_minutes, the agent replaces tool-result content older than keep_recent with a short sentinel string before dispatching the next LLM request. Pure payload reduction — the model already would have seen a cache miss at this gap (server-side prompt caches expire well under an hour for every backend seal targets), so shrinking what gets re-tokenized is free.

Anchored on the wall-clock TTL of the most aggressive cached backend (Anthropic ephemeral, 5min default; 1h beta tier). 60min is past every TTL we know of, so firing at 60 never forces a miss that wouldn’t have happened.

TypebooleanDefaulttrue

Master switch. Default true — the elision is provider- agnostic and lossless for any tool-result the model wouldn’t otherwise have re-read.

TypeintegerDefault60

Trigger when (now - last_assistant_ms) > this many minutes. 60 is the safe choice across every backend seal targets — at or past Anthropic ephemeral TTL, OpenRouter passthrough TTL, and DeepSeek auto-cache TTL.

TypeintegerDefault5

Number of most-recent compactable tool-results to leave untouched even when the trigger fires. 5 balances “model still has working context” against “stale exploration reads get cleared.” A floor of 1 is applied at use-site: clearing every tool-result is degenerate.