From e9a2a6317d68abce3e07ee26e40099d3afc74f20 Mon Sep 17 00:00:00 2001 From: OpenClaw Date: Tue, 10 Mar 2026 17:21:24 +0800 Subject: [PATCH] fix: use correct fields for read_docs tool call summary The context-pruner's summarizeToolCall function was reading input.query which doesn't exist on ReadDocsParams. It should read libraryTitle and topic fields instead. Fixes #466 --- agents/context-pruner.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/agents/context-pruner.ts b/agents/context-pruner.ts index dbb3c3cc5..69e3257ec 100644 --- a/agents/context-pruner.ts +++ b/agents/context-pruner.ts @@ -251,8 +251,12 @@ export function summarizeToolCall( return query ? `Web search: "${query}"` : 'Web search' } case 'read_docs': { - const query = input.query as string | undefined - return query ? `Read docs: "${query}"` : 'Read docs' + const libraryTitle = input.libraryTitle as string | undefined + const topic = input.topic as string | undefined + if (libraryTitle && topic) { + return `Read docs: "${libraryTitle} - ${topic}"` + } + return libraryTitle ? `Read docs: "${libraryTitle}"` : 'Read docs' } case 'set_output': return 'Set output' @@ -543,8 +547,12 @@ const definition: AgentDefinition = { return query ? `Web search: "${query}"` : 'Web search' } case 'read_docs': { - const query = input.query as string | undefined - return query ? `Read docs: "${query}"` : 'Read docs' + const libraryTitle = input.libraryTitle as string | undefined + const topic = input.topic as string | undefined + if (libraryTitle && topic) { + return `Read docs: "${libraryTitle} - ${topic}"` + } + return libraryTitle ? `Read docs: "${libraryTitle}"` : 'Read docs' } case 'set_output': return 'Set output'