Class CompactionConfig.PruneConfig

java.lang.Object
io.agentscope.harness.agent.memory.compaction.CompactionConfig.PruneConfig
Enclosing class:
CompactionConfig

public static class CompactionConfig.PruneConfig extends Object
Configuration for aggregate tool-result pruning.

Prune walks backward through tool-result messages, protecting the most recent getProtectTokens() tokens of tool output. Older tool results beyond that protection window are replaced with a head+tail preview when the total prunable amount exceeds getMinimumTokens().

This is a lightweight, non-LLM operation that runs inside ConversationCompactor.compactIfNeeded(io.agentscope.core.agent.RuntimeContext, java.util.List<io.agentscope.core.message.Msg>, io.agentscope.harness.agent.memory.compaction.CompactionConfig, java.lang.String, java.lang.String) before summarization.

  • Method Details

    • defaults

      public static CompactionConfig.PruneConfig defaults()
    • getProtectTokens

      public int getProtectTokens()
      Token budget for recent tool outputs that are never pruned (default 40 000).
    • getMinimumTokens

      public int getMinimumTokens()
      Minimum prunable token total before pruning actually executes (default 20 000).
    • getMaxOutputChars

      public int getMaxOutputChars()
      Max characters to keep per pruned tool result as head+tail preview (default 2 000).
    • getExcludedTools

      public Set<String> getExcludedTools()
      Tool names excluded from pruning (e.g. read_file, memory tools).
    • builder