Skip to content

Commit e9a2a63

Browse files
author
OpenClaw
committed
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
1 parent 2f4f21c commit e9a2a63

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

agents/context-pruner.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,12 @@ export function summarizeToolCall(
251251
return query ? `Web search: "${query}"` : 'Web search'
252252
}
253253
case 'read_docs': {
254-
const query = input.query as string | undefined
255-
return query ? `Read docs: "${query}"` : 'Read docs'
254+
const libraryTitle = input.libraryTitle as string | undefined
255+
const topic = input.topic as string | undefined
256+
if (libraryTitle && topic) {
257+
return `Read docs: "${libraryTitle} - ${topic}"`
258+
}
259+
return libraryTitle ? `Read docs: "${libraryTitle}"` : 'Read docs'
256260
}
257261
case 'set_output':
258262
return 'Set output'
@@ -543,8 +547,12 @@ const definition: AgentDefinition = {
543547
return query ? `Web search: "${query}"` : 'Web search'
544548
}
545549
case 'read_docs': {
546-
const query = input.query as string | undefined
547-
return query ? `Read docs: "${query}"` : 'Read docs'
550+
const libraryTitle = input.libraryTitle as string | undefined
551+
const topic = input.topic as string | undefined
552+
if (libraryTitle && topic) {
553+
return `Read docs: "${libraryTitle} - ${topic}"`
554+
}
555+
return libraryTitle ? `Read docs: "${libraryTitle}"` : 'Read docs'
548556
}
549557
case 'set_output':
550558
return 'Set output'

0 commit comments

Comments
 (0)