We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2cd3bc2 commit c008b88Copy full SHA for c008b88
.agents/context-pruner.ts
@@ -390,9 +390,12 @@ const definition: AgentDefinition = {
390
if (Array.isArray(message.content)) {
391
for (const part of message.content) {
392
if (part.type === 'text' && typeof part.text === 'string') {
393
- const text = (part.text as string).trim()
394
- if (text) {
395
- textParts.push(text)
+ // Remove <think> tags and their contents before summarizing
+ const textWithoutThinkTags = (part.text as string)
+ .replace(/<think>[\s\S]*?<\/think>/g, '')
396
+ .trim()
397
+ if (textWithoutThinkTags) {
398
+ textParts.push(textWithoutThinkTags)
399
}
400
} else if (part.type === 'tool-call') {
401
const toolName = part.toolName as string
0 commit comments