Skip to content

Commit 4cecf12

Browse files
fix
1 parent c52a7e4 commit 4cecf12

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/fetch-wrapper/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,17 @@ export function installFetchWrapper(
8181

8282
// Run deduplication after handlers have populated toolParameters cache
8383
const sessionId = state.lastSeenSessionId
84-
if (sessionId && state.toolParameters.size > 1) {
84+
if (sessionId && state.toolParameters.size > 0) {
8585
const toolIds = Array.from(state.toolParameters.keys())
8686
const alreadyPruned = state.prunedIds.get(sessionId) ?? []
8787
const alreadyPrunedLower = new Set(alreadyPruned.map(id => id.toLowerCase()))
8888
const unpruned = toolIds.filter(id => !alreadyPrunedLower.has(id.toLowerCase()))
8989
if (unpruned.length > 1) {
9090
const { duplicateIds } = detectDuplicates(state.toolParameters, unpruned, config.protectedTools)
9191
if (duplicateIds.length > 0) {
92-
state.prunedIds.set(sessionId, [...new Set([...alreadyPruned, ...duplicateIds])])
92+
// Normalize to lowercase to match janitor's ID normalization
93+
const normalizedIds = duplicateIds.map(id => id.toLowerCase())
94+
state.prunedIds.set(sessionId, [...new Set([...alreadyPruned, ...normalizedIds])])
9395
}
9496
}
9597
}

0 commit comments

Comments
 (0)