{"record":{"id":"f84569fece89680f","repo":"earendil-works/pi","slug":"summarization-attempted-to-call-a-tool","errorCode":null,"errorMessage":"Summarization attempted to call a tool","messagePattern":"Summarization attempted to call a tool","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/core/compaction/compaction.ts","lineNumber":706,"sourceCode":"\t\tsignal,\n\t\tthinkingLevel,\n\t\tsessionId,\n\t);\n\n\tconst response = await completeSummarization(\n\t\tmodel,\n\t\tbuildSummarizationContext(promptText),\n\t\tcompletionOptions,\n\t\tstreamFn,\n\t\tretry,\n\t\tcallbacks,\n\t);\n\n\tif (response.stopReason === \"error\") {\n\t\tthrow new Error(`Summarization failed: ${response.errorMessage || \"Unknown error\"}`);\n\t}\n\tif (response.content.some((block) => block.type === \"toolCall\")) {\n\t\tthrow new Error(\"Summarization attempted to call a tool\");\n\t}\n\n\tconst textContent = contentText(response.content);\n\n\treturn { text: textContent, usage: response.usage };\n}\n\n// ============================================================================\n// Compaction Preparation (for extensions)\n// ============================================================================\n\nexport interface CompactionPreparation {\n\t/** UUID of first entry to keep */\n\tfirstKeptEntryId: string;\n\t/** Messages that will be summarized and discarded */\n\tmessagesToSummarize: AgentMessage[];\n\t/** Messages that will be turned into turn prefix summary (if splitting) */\n\tturnPrefixMessages: AgentMessage[];","sourceCodeStart":688,"sourceCodeEnd":724,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/coding-agent/src/core/compaction/compaction.ts#L688-L724","documentation":"Error \"Summarization attempted to call a tool\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/coding-agent/src/core/compaction/compaction.ts:706 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}