@@ -2,7 +2,6 @@ import type { SessionState, ToolParameterEntry, WithParts } from "../state"
22import type { PluginConfig } from "../config"
33import type { Logger } from "../logger"
44import type { PruneToolContext } from "./types"
5- import { buildToolIdList } from "../messages/utils"
65import { syncToolCache } from "../state/tool-cache"
76import { PruneReason , sendUnifiedNotification } from "../ui/notification"
87import { formatPruningResultForTool } from "../ui/utils"
@@ -52,14 +51,15 @@ export async function executePruneOperation(
5251 await syncToolCache ( state , config , logger , messages )
5352
5453 const currentParams = getCurrentParams ( state , messages , logger )
55- const toolIdList : string [ ] = buildToolIdList ( state , messages , logger )
54+
55+ const toolIdList = state . toolIdList
5656
5757 const validNumericIds : number [ ] = [ ]
5858 const skippedIds : string [ ] = [ ]
5959
6060 // Validate and filter IDs
6161 for ( const index of numericToolIds ) {
62- // Validate that all numeric IDs are within bounds
62+ // Validate that index is within bounds
6363 if ( index < 0 || index >= toolIdList . length ) {
6464 logger . debug ( `Rejecting prune request - index out of bounds: ${ index } ` )
6565 skippedIds . push ( index . toString ( ) )
0 commit comments