Class CompactionConfig.TruncateArgsConfig
java.lang.Object
io.agentscope.harness.agent.memory.compaction.CompactionConfig.TruncateArgsConfig
- Enclosing class:
- CompactionConfig
Configuration for the lightweight argument-truncation pass that runs before
summarization.
When triggered, large string arguments of ToolUseBlocks in older messages
(before the keep window) are clipped to getMaxArgLength() characters.
This is a cheap, non-LLM operation that prevents context ballooning from verbose
tool invocations (e.g., write_file, edit_file).
Defaults (when enabled via CompactionConfig.Builder.truncateArgs(TruncateArgsConfig)):
- Trigger at 25 messages or 40 000 tokens
- Keep the 20 most recent messages untouched
- Max argument length: 2 000 characters
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Method Summary
Modifier and TypeMethodDescriptionbuilder()intintintMaximum character length of any single tool argument value (default 2 000).intintSuffix appended after the first 20 characters of a truncated argument.
-
Method Details
-
getTriggerMessages
public int getTriggerMessages() -
getTriggerTokens
public int getTriggerTokens() -
getKeepMessages
public int getKeepMessages() -
getKeepTokens
public int getKeepTokens() -
getMaxArgLength
public int getMaxArgLength()Maximum character length of any single tool argument value (default 2 000). -
getTruncationText
Suffix appended after the first 20 characters of a truncated argument. -
builder
-