From 4cecf12985eabf043a4da6cbc7c9ac61dcd4ee8d Mon Sep 17 00:00:00 2001 From: spoons-and-mirrors <212802214+spoons-and-mirrors@users.noreply.github.com> Date: Tue, 2 Dec 2025 05:49:27 +0100 Subject: [PATCH] fix --- lib/fetch-wrapper/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/fetch-wrapper/index.ts b/lib/fetch-wrapper/index.ts index 80d4ce9..75fd7c8 100644 --- a/lib/fetch-wrapper/index.ts +++ b/lib/fetch-wrapper/index.ts @@ -81,7 +81,7 @@ export function installFetchWrapper( // Run deduplication after handlers have populated toolParameters cache const sessionId = state.lastSeenSessionId - if (sessionId && state.toolParameters.size > 1) { + if (sessionId && state.toolParameters.size > 0) { const toolIds = Array.from(state.toolParameters.keys()) const alreadyPruned = state.prunedIds.get(sessionId) ?? [] const alreadyPrunedLower = new Set(alreadyPruned.map(id => id.toLowerCase())) @@ -89,7 +89,9 @@ export function installFetchWrapper( if (unpruned.length > 1) { const { duplicateIds } = detectDuplicates(state.toolParameters, unpruned, config.protectedTools) if (duplicateIds.length > 0) { - state.prunedIds.set(sessionId, [...new Set([...alreadyPruned, ...duplicateIds])]) + // Normalize to lowercase to match janitor's ID normalization + const normalizedIds = duplicateIds.map(id => id.toLowerCase()) + state.prunedIds.set(sessionId, [...new Set([...alreadyPruned, ...normalizedIds])]) } } }