ExAgent.Compaction.ClearToolResults (ExAgent v3.0.0)

View Source

Replaces older tool return content with short markers in the model request. Run history and checkpoints retain the original returns. A marker retains the reference issued by ExAgent.Tool.OutputLimit, when present.

Stability — Candidate.

Set :threshold_tokens (default 4000) to trigger above an estimated request size, including advertised schemas. :keep_recent (default 3) counts the most recent successful and tool-error results, including parallel calls. :exclude_tools and :keep_call_ids are lists of names and call IDs to retain verbatim. Reused IDs protect every matching occurrence.

Instructions, user messages, retries and failed outcomes stay intact. The entire prefix through an exchange carrying thinking, signatures or opaque provider continuation data is pinned. Only shorter replacements are applied. A later Summary capability sees the edited projection and applies its own independent policy.

Summary

Functions

Clear eligible results when the estimated request exceeds the configured threshold.

Validate the token threshold, recent window, pinned names and call IDs.

Functions

compact(messages, opts, ctx)

Clear eligible results when the estimated request exceeds the configured threshold.

validate(opts)

Validate the token threshold, recent window, pinned names and call IDs.