From cc6cc68ec35eecc9c1518479646636bca30743c2 Mon Sep 17 00:00:00 2001 From: Daniel Smolsky Date: Sat, 13 Dec 2025 17:49:00 -0500 Subject: [PATCH] refactor: use shared buildToolIdList from utils --- lib/strategies/deduplication.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/lib/strategies/deduplication.ts b/lib/strategies/deduplication.ts index f58a13a8..50b30fa3 100644 --- a/lib/strategies/deduplication.ts +++ b/lib/strategies/deduplication.ts @@ -1,7 +1,7 @@ import { PluginConfig } from "../config" import { Logger } from "../logger" import type { SessionState, WithParts } from "../state" -import { calculateTokensSaved } from "../utils" +import { buildToolIdList, calculateTokensSaved } from "../utils" /** * Deduplication strategy - prunes older tool calls that have identical @@ -75,20 +75,6 @@ export const deduplicate = ( } } -function buildToolIdList(messages: WithParts[]): string[] { - const toolIds: string[] = [] - for (const msg of messages) { - if (msg.parts) { - for (const part of msg.parts) { - if (part.type === 'tool' && part.callID && part.tool) { - toolIds.push(part.callID) - } - } - } - } - return toolIds -} - function createToolSignature(tool: string, parameters?: any): string { if (!parameters) { return tool