Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions lib/strategies/deduplication.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down