From 081c53657021d8a2838000a5d4e4f8756dfd1974 Mon Sep 17 00:00:00 2001 From: Daniel Smolsky Date: Sun, 30 Nov 2025 21:16:11 -0500 Subject: [PATCH] feat: rename pruning tool to 'prune (DCP)' and make protectedTools additive - Rename tool from 'context_pruning' to 'prune (DCP)' for better UX - Change protectedTools config behavior: user values now merge with built-in defaults instead of replacing them - Update config template comments to clarify additive behavior --- index.ts | 2 +- lib/config.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/index.ts b/index.ts index cf66fc5c..cb0362bf 100644 --- a/index.ts +++ b/index.ts @@ -88,7 +88,7 @@ const plugin: Plugin = (async (ctx) => { event: createEventHandler(ctx.client, janitor, logger, config, toolTracker), "chat.params": createChatParamsHandler(ctx.client, state, logger), tool: config.strategies.onTool.length > 0 ? { - context_pruning: createPruningTool(janitor, config, toolTracker), + "prune (DCP)": createPruningTool(janitor, config, toolTracker), } : undefined, } }) satisfies Plugin diff --git a/lib/config.ts b/lib/config.ts index a7fe23ec..ed7390d8 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -30,7 +30,7 @@ export interface ConfigResult { const defaultConfig: PluginConfig = { enabled: true, debug: false, - protectedTools: ['task', 'todowrite', 'todoread', 'context_pruning'], + protectedTools: ['task', 'todowrite', 'todoread', 'prune (DCP)'], showModelErrorToasts: true, strictModelSelection: false, pruning_summary: 'detailed', @@ -122,9 +122,9 @@ function createDefaultConfig(): void { // Summary display: "off", "minimal", or "detailed" "pruning_summary": "detailed", // How often to nudge the AI to prune (every N tool results, 0 = disabled) - "nudge_freq": 10, - // Tools that should never be pruned - "protectedTools": ["task", "todowrite", "todoread", "context_pruning"] + "nudge_freq": 10 + // Additional tools to protect from pruning (merged with built-in: task, todowrite, todoread, prune (DCP)) + // "protectedTools": ["bash"] } ` @@ -196,7 +196,7 @@ export function getConfig(ctx?: PluginInput): ConfigResult { config = { enabled: globalConfig.enabled ?? config.enabled, debug: globalConfig.debug ?? config.debug, - protectedTools: globalConfig.protectedTools ?? config.protectedTools, + protectedTools: [...new Set([...config.protectedTools, ...(globalConfig.protectedTools ?? [])])], model: globalConfig.model ?? config.model, showModelErrorToasts: globalConfig.showModelErrorToasts ?? config.showModelErrorToasts, strictModelSelection: globalConfig.strictModelSelection ?? config.strictModelSelection, @@ -227,7 +227,7 @@ export function getConfig(ctx?: PluginInput): ConfigResult { config = { enabled: projectConfig.enabled ?? config.enabled, debug: projectConfig.debug ?? config.debug, - protectedTools: projectConfig.protectedTools ?? config.protectedTools, + protectedTools: [...new Set([...config.protectedTools, ...(projectConfig.protectedTools ?? [])])], model: projectConfig.model ?? config.model, showModelErrorToasts: projectConfig.showModelErrorToasts ?? config.showModelErrorToasts, strictModelSelection: projectConfig.strictModelSelection ?? config.strictModelSelection,