mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-27 02:28:37 +00:00
feat(agent): opt-in tool-result context pruning
This commit is contained in:
committed by
Peter Steinberger
parent
937e0265a3
commit
eeaa6ea46f
@@ -850,6 +850,27 @@ export type AgentModelListConfig = {
|
||||
fallbacks?: string[];
|
||||
};
|
||||
|
||||
export type AgentContextPruningConfig = {
|
||||
mode?: "off" | "adaptive" | "aggressive";
|
||||
keepLastAssistants?: number;
|
||||
softTrimRatio?: number;
|
||||
hardClearRatio?: number;
|
||||
minPrunableToolChars?: number;
|
||||
tools?: {
|
||||
allow?: string[];
|
||||
deny?: string[];
|
||||
};
|
||||
softTrim?: {
|
||||
maxChars?: number;
|
||||
headChars?: number;
|
||||
tailChars?: number;
|
||||
};
|
||||
hardClear?: {
|
||||
enabled?: boolean;
|
||||
placeholder?: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type ClawdbotConfig = {
|
||||
auth?: AuthConfig;
|
||||
env?: {
|
||||
@@ -895,6 +916,8 @@ export type ClawdbotConfig = {
|
||||
userTimezone?: string;
|
||||
/** Optional display-only context window override (used for % in status UIs). */
|
||||
contextTokens?: number;
|
||||
/** Opt-in: prune old tool results from the LLM context to reduce token usage. */
|
||||
contextPruning?: AgentContextPruningConfig;
|
||||
/** Default thinking level when no /think directive is present. */
|
||||
thinkingDefault?: "off" | "minimal" | "low" | "medium" | "high";
|
||||
/** Default verbose level when no /verbose directive is present. */
|
||||
|
||||
Reference in New Issue
Block a user