Skip to content

Commit 8fdc4d3

Browse files
committed
fix: exclude protected tools from total count in log output
1 parent d977255 commit 8fdc4d3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/fetch-wrapper/handler.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,13 @@ export async function handleFormat(
117117
const toolOutputs = format.extractToolOutputs(data, ctx.state)
118118
const protectedToolsLower = new Set(ctx.config.protectedTools.map(t => t.toLowerCase()))
119119
let replacedCount = 0
120+
let prunableCount = 0
120121

121122
for (const output of toolOutputs) {
122123
if (output.toolName && protectedToolsLower.has(output.toolName.toLowerCase())) {
123124
continue
124125
}
126+
prunableCount++
125127

126128
if (allPrunedIds.has(output.id)) {
127129
if (format.replaceToolOutput(data, output.id, PRUNED_CONTENT_MESSAGE, ctx.state)) {
@@ -133,7 +135,7 @@ export async function handleFormat(
133135
if (replacedCount > 0) {
134136
ctx.logger.info("fetch", `Replaced pruned tool outputs (${format.name})`, {
135137
replaced: replacedCount,
136-
total: toolOutputs.length
138+
total: prunableCount
137139
})
138140

139141
if (ctx.logger.enabled) {

0 commit comments

Comments
 (0)