forked from tuanhung303/opencode-agent-context-pruning
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathacp.schema.json
More file actions
300 lines (300 loc) · 13.8 KB
/
acp.schema.json
File metadata and controls
300 lines (300 loc) · 13.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/tuanhung303/opencode-agent-context-pruning/master/acp.schema.json",
"title": "ACP Plugin Configuration",
"description": "Configuration schema for the OpenCode Agentic Context Pruning plugin",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string",
"description": "JSON Schema reference for IDE autocomplete"
},
"enabled": {
"type": "boolean",
"default": true,
"description": "Enable or disable the ACP plugin entirely"
},
"debug": {
"type": "boolean",
"default": false,
"description": "Enable debug logging for troubleshooting"
},
"pruneNotification": {
"type": "string",
"enum": ["off", "minimal", "detailed"],
"default": "minimal",
"description": "Level of notification shown when pruning occurs: off (silent), minimal (summary), detailed (verbose)"
},
"commands": {
"type": "object",
"description": "Configuration for ACP slash commands (/acp)",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"default": true,
"description": "Enable ACP slash commands (/acp) for manual pruning control"
},
"protectedTools": {
"type": "array",
"items": {
"type": "string"
},
"default": [
"context_info",
"task",
"todowrite",
"todoread",
"context",
"batch",
"write",
"edit",
"plan_enter",
"plan_exit"
],
"description": "Additional tool names to protect from pruning via commands (e.g., /acp sweep). Default includes context_info, task, todowrite, todoread, context, batch, write, edit, plan_enter, and plan_exit"
}
}
},
"protectedFilePatterns": {
"type": "array",
"items": {
"type": "string"
},
"default": [
"**/.env",
"**/.env.*",
"**/credentials.json",
"**/secrets.json",
"**/*.pem",
"**/*.key",
"**/package.json",
"**/tsconfig.json",
"**/pyproject.toml",
"**/Cargo.toml"
],
"description": "Glob patterns for files that should be protected from pruning (e.g., '**/*.config.ts'). Default includes env files, credentials, and config files"
},
"tools": {
"type": "object",
"description": "Configuration for pruning tools",
"additionalProperties": false,
"properties": {
"settings": {
"type": "object",
"description": "General tool settings",
"additionalProperties": false,
"properties": {
"protectedTools": {
"type": "array",
"items": {
"type": "string"
},
"default": [
"context_info",
"task",
"todowrite",
"todoread",
"context",
"batch",
"write",
"edit",
"plan_enter",
"plan_exit"
],
"description": "Tool names that should be protected from automatic pruning. Default includes context_info, task, todowrite, todoread, context, batch, write, edit, plan_enter, and plan_exit"
},
"enableAssistantMessagePruning": {
"type": "boolean",
"default": true,
"description": "Enable pruning of large assistant messages to reduce context size"
},
"enableReasoningPruning": {
"type": "boolean",
"default": true,
"description": "Enable pruning of reasoning/thinking blocks from assistant messages"
},
"enableVisibleAssistantHashes": {
"type": "boolean",
"default": true,
"description": "Show visible hash markers when assistant messages are pruned for transparency"
}
}
},
"discard": {
"type": "object",
"description": "Configure the discard tool for manually removing specific tool outputs from context",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"default": true,
"description": "Enable the discard tool for manually removing specific tool outputs from context"
}
}
},
"distill": {
"type": "object",
"description": "Configuration for the distill tool",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"default": true,
"description": "Enable the distill tool for summarizing tool outputs"
},
"showDistillation": {
"type": "boolean",
"default": false,
"description": "Show distillation output in the UI for debugging"
}
}
},
"todoReminder": {
"type": "object",
"description": "Remind agent to review/update todo list when stale",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"default": true,
"description": "Enable todo reminder injection to remind agent to review/update todo list when stale"
},
"initialTurns": {
"type": "number",
"default": 5,
"description": "Number of turns before the first todo reminder is shown"
},
"repeatTurns": {
"type": "number",
"default": 4,
"description": "Number of turns between subsequent todo reminders"
},
"stuckTaskTurns": {
"type": "number",
"default": 12,
"description": "Number of turns a task can be in_progress before suggesting breakdown"
},
"maxContextTokens": {
"type": "number",
"default": 100000,
"description": "Maximum context token threshold for todo reminders"
}
}
},
"automataMode": {
"type": "object",
"description": "Autonomous reflection mechanism that injects strategic prompts",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"default": true,
"description": "Enable automata mode reflection injection for autonomous strategic prompts"
},
"initialTurns": {
"type": "number",
"default": 8,
"description": "Number of turns of continuous work before first reflection prompt"
}
}
}
}
},
"strategies": {
"type": "object",
"description": "Automatic pruning strategies",
"additionalProperties": false,
"properties": {
"purgeErrors": {
"type": "object",
"description": "Remove tool outputs that resulted in errors",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"default": false,
"description": "Enable automatic purging of tool outputs that resulted in errors"
},
"turns": {
"type": "number",
"default": 4,
"description": "Number of turns after which error outputs are purged"
},
"protectedTools": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "Tool names excluded from error purging"
}
}
},
"aggressivePruning": {
"type": "object",
"description": "Aggressive context pruning strategies for long sessions",
"additionalProperties": false,
"properties": {
"preset": {
"type": "string",
"enum": ["compact", "balanced", "verbose"],
"description": "Preset configuration to use as base. Options: compact (maximum cleanup), balanced (good for most use cases), verbose (minimal cleanup). Individual flags override preset values"
},
"pruneSourceUrls": {
"type": "boolean",
"default": true,
"description": "Prune source-url parts (web search citations) to reduce context size"
},
"pruneFiles": {
"type": "boolean",
"default": true,
"description": "Prune file attachment parts (images, documents) from old messages"
},
"pruneSnapshots": {
"type": "boolean",
"default": true,
"description": "Prune snapshot parts, keeping only the latest snapshot per file"
},
"pruneStepMarkers": {
"type": "boolean",
"default": true,
"description": "Filter out step-start/step-finish markers entirely from context"
},
"pruneToolInputs": {
"type": "boolean",
"default": true,
"description": "Strip verbose tool inputs (write/edit content) when superseded by newer operations"
},
"pruneRetryParts": {
"type": "boolean",
"default": true,
"description": "Auto-prune retry parts after successful completion of the operation"
},
"pruneUserCodeBlocks": {
"type": "boolean",
"default": true,
"description": "Truncate large code blocks in old user messages to save tokens"
},
"aggressiveFilePrune": {
"type": "boolean",
"default": true,
"description": "One-file-one-view: any file operation supersedes ALL previous operations on the same file"
},
"stateQuerySupersede": {
"type": "boolean",
"default": true,
"description": "State query supersede: ls, find, pwd, git status - keep only the latest execution"
},
"truncateOldErrors": {
"type": "boolean",
"default": true,
"description": "Truncate old error outputs to first line only, removing stack traces"
}
}
}
}
}
}
}