Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions lib/messages/prune.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const buildPrunableToolsList = (
if (config.strategies.pruneTool.protectedTools.includes(toolParameterEntry.tool)) {
return
}
if (toolParameterEntry.compacted) {
return
}
const numericId = toolIdList.indexOf(toolCallId)
const paramKey = extractParameterKey(toolParameterEntry.tool, toolParameterEntry.parameters)
const description = paramKey ? `${toolParameterEntry.tool}, ${paramKey}` : toolParameterEntry.tool
Expand Down
1 change: 1 addition & 0 deletions lib/state/tool-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export async function syncToolCache(
parameters: part.state?.input ?? {},
status: part.state.status as ToolStatus | undefined,
error: part.state.status === "error" ? part.state.error : undefined,
compacted: part.state.status === "completed" && !!part.state.time.compacted,
}
)

Expand Down
1 change: 1 addition & 0 deletions lib/state/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface ToolParameterEntry {
parameters: any
status?: ToolStatus
error?: string
compacted?: boolean
}

export interface SessionStats {
Expand Down