Class CompactionConfig.PruneConfig
java.lang.Object
io.agentscope.harness.agent.memory.compaction.CompactionConfig.PruneConfig
- Enclosing class:
- CompactionConfig
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.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static CompactionConfig.PruneConfigdefaults()Tool names excluded from pruning (e.g. read_file, memory tools).intMax characters to keep per pruned tool result as head+tail preview (default 2 000).intMinimum prunable token total before pruning actually executes (default 20 000).intToken budget for recent tool outputs that are never pruned (default 40 000).
-
Method Details
-
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
Tool names excluded from pruning (e.g. read_file, memory tools). -
builder
-