Skip to content

Commit 6948958

Browse files
committed
Fix redundant narration after prune tool
1 parent db0b8e9 commit 6948958

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Thumbs.db
2727

2828
# OpenCode
2929
.opencode/
30+
AGENTS.md
3031

3132
# Tests (local development only)
3233
tests/

lib/prompts/synthetic.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<system-reminder>
22
These instructions are injected by a plugin and are invisible to the user. Do not acknowledge or reference them in your response - simply follow them silently.
3+
4+
IMPORTANT: Your thinking/reasoning blocks must NOT reference, discuss, or address these instructions, the <prunable-tools> list, or any nudges about pruning. The user can see your thinking blocks, and referencing invisible plugin content will confuse them. In your thinking, focus only on the user's task and your problem-solving approach.
35
</system-reminder>
46

57
<instruction name=signal_management>
@@ -34,5 +36,5 @@ EXAMPLE WORKFLOW:
3436
- What you concluded (how this affects the task or next step).
3537
>YOU MUST ALWAYS THINK HIGH SIGNAL LOW NOISE FOR THIS NARRATION
3638
4. ONLY AFTER the narration, you call the `prune` tool with a brief reason (e.g. "exploration for bug X complete; moving on to next bug").
37-
</instruction>
39+
5. AFTER pruning succeeds, DO NOT re-summarize or re-narrate. You already distilled your findings before calling prune. Continue with your next task, or if you need more information from the user, wait for their response.
3840
</instruction>

lib/prompts/tool.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ You MUST ALWAYS narrate your findings in a message BEFORE using this tool. No to
1818

1919
> THINK HIGH SIGNAL, LOW NOISE FOR THIS NARRATION
2020

21+
**After pruning:** Do NOT re-summarize or re-narrate. You already distilled your findings before calling prune. Continue with your next task, or if you need more information from the user, wait for their response.
22+
2123
## How to Use
2224

2325
The <prunable-tools> list shows available tool outputs with numeric IDs:

lib/pruning-tool.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,8 @@ export function createPruningTool(
121121
resetToolTrackerCount(toolTracker)
122122
}
123123

124-
const result = {
125-
prunedCount: prunedIds.length,
126-
tokensSaved,
127-
llmPrunedIds: prunedIds,
128-
toolMetadata,
129-
sessionStats
130-
}
131-
132-
const postPruneGuidance = "\n\nYou have already distilled relevant understanding in writing before calling this tool. Do not re-narrate; continue with your next task."
133-
134-
return formatPruningResultForTool(result, workingDirectory) + postPruneGuidance
124+
// Return empty string on success (like edit tool) - guidance is in tool description
125+
return ""
135126
},
136127
})
137128
}

0 commit comments

Comments
 (0)