Skip to content

Commit b39ef03

Browse files
authored
Merge pull request #170 from Opencode-DCP/dev
v1.0.4 - Fix pruning of pending/running tool inputs
2 parents 8dd3aec + a6c28e2 commit b39ef03

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

lib/messages/prune.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ const pruneToolInputs = (
151151
if (part.tool !== 'write' && part.tool !== 'edit') {
152152
continue
153153
}
154+
// Don't prune yet if tool is still pending or running
155+
if (part.state.status === "pending" || part.state.status === "running") {
156+
continue
157+
}
158+
154159
if (part.state.input?.content !== undefined) {
155160
part.state.input.content = PRUNED_TOOL_INPUT_REPLACEMENT
156161
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json.schemastore.org/package.json",
33
"name": "@tarquinen/opencode-dcp",
4-
"version": "1.0.3",
4+
"version": "1.0.4",
55
"type": "module",
66
"description": "OpenCode plugin that optimizes token usage by pruning obsolete tool outputs from conversation context",
77
"main": "./dist/index.js",

0 commit comments

Comments
 (0)