Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ DCP uses multiple strategies to reduce context size:

**Deduplication** — Identifies repeated tool calls (e.g., reading the same file multiple times) and keeps only the most recent output. Runs automatically on every request with zero LLM cost.

**Prune Thinking Blocks** — Removes LLM thinking/reasoning blocks from the conversation history.

**On Idle Analysis** — Uses a language model to semantically analyze conversation context during idle periods and identify tool outputs that are no longer relevant.

**Prune Tool** — Exposes a `prune` tool that the AI can call to manually trigger pruning when it determines context cleanup is needed.

*More strategies coming soon.*

Your session history is never modified. DCP replaces pruned outputs with a placeholder before sending requests to your LLM.

## Impact on Prompt Caching
Expand Down Expand Up @@ -66,10 +66,6 @@ DCP uses its own config file (`~/.config/opencode/dcp.jsonc` or `.opencode/dcp.j
// Additional tools to protect from pruning
"protectedTools": []
},
// Remove thinking/reasoning LLM blocks
"pruneThinkingBlocks": {
"enabled": false
},
// Exposes a prune tool to your LLM to call when it determines pruning is necessary
"pruneTool": {
"enabled": true,
Expand Down
24 changes: 0 additions & 24 deletions lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ export interface Deduplication {
protectedTools: string[]
}

export interface PruneThinkingBlocks {
enabled: boolean
}

export interface OnIdle {
enabled: boolean
model?: string
Expand All @@ -39,7 +35,6 @@ export interface PluginConfig {
pruningSummary: "off" | "minimal" | "detailed"
strategies: {
deduplication: Deduplication
pruneThinkingBlocks: PruneThinkingBlocks
onIdle: OnIdle
pruneTool: PruneTool
}
Expand All @@ -59,9 +54,6 @@ export const VALID_CONFIG_KEYS = new Set([
'strategies.deduplication',
'strategies.deduplication.enabled',
'strategies.deduplication.protectedTools',
// strategies.pruneThinkingBlocks
'strategies.pruneThinkingBlocks',
'strategies.pruneThinkingBlocks.enabled',
// strategies.onIdle
'strategies.onIdle',
'strategies.onIdle.enabled',
Expand Down Expand Up @@ -135,11 +127,6 @@ function validateConfigTypes(config: Record<string, any>): ValidationError[] {
errors.push({ key: 'strategies.deduplication.protectedTools', expected: 'string[]', actual: typeof strategies.deduplication.protectedTools })
}

// pruneThinkingBlocks
if (strategies.pruneThinkingBlocks?.enabled !== undefined && typeof strategies.pruneThinkingBlocks.enabled !== 'boolean') {
errors.push({ key: 'strategies.pruneThinkingBlocks.enabled', expected: 'boolean', actual: typeof strategies.pruneThinkingBlocks.enabled })
}

// onIdle
if (strategies.onIdle) {
if (strategies.onIdle.enabled !== undefined && typeof strategies.onIdle.enabled !== 'boolean') {
Expand Down Expand Up @@ -237,9 +224,6 @@ const defaultConfig: PluginConfig = {
enabled: true,
protectedTools: [...DEFAULT_PROTECTED_TOOLS]
},
pruneThinkingBlocks: {
enabled: false
},
pruneTool: {
enabled: true,
protectedTools: [...DEFAULT_PROTECTED_TOOLS],
Expand Down Expand Up @@ -322,10 +306,6 @@ function createDefaultConfig(): void {
// Additional tools to protect from pruning
"protectedTools": []
},
// Remove thinking/reasoning LLM blocks
"pruneThinkingBlocks": {
"enabled": false
},
// Exposes a prune tool to your LLM to call when it determines pruning is necessary
"pruneTool": {
"enabled": true,
Expand Down Expand Up @@ -396,9 +376,6 @@ function mergeStrategies(
])
]
},
pruneThinkingBlocks: {
enabled: override.pruneThinkingBlocks?.enabled ?? base.pruneThinkingBlocks.enabled
},
onIdle: {
enabled: override.onIdle?.enabled ?? base.onIdle.enabled,
model: override.onIdle?.model ?? base.onIdle.model,
Expand Down Expand Up @@ -435,7 +412,6 @@ function deepCloneConfig(config: PluginConfig): PluginConfig {
...config.strategies.deduplication,
protectedTools: [...config.strategies.deduplication.protectedTools]
},
pruneThinkingBlocks: { ...config.strategies.pruneThinkingBlocks },
onIdle: {
...config.strategies.onIdle,
protectedTools: [...config.strategies.onIdle.protectedTools]
Expand Down