diff --git a/src/ClaudeDev.ts b/src/ClaudeDev.ts index 3681740..c5f8d8c 100644 --- a/src/ClaudeDev.ts +++ b/src/ClaudeDev.ts @@ -1637,7 +1637,7 @@ ${this.customInstructions.trim()} // TextBlockParam, ImageBlockParam, ToolUseBlockParam, and ToolResultBlockParam. // We need to apply parseMentions() to: // 1. All TextBlockParam's text (first user message with task) - // 2. ToolResultBlockParam's content/context text arrays if it contains "" (see formatToolDeniedFeedback and consecutiveMistakeCount >= 3 above, we place all user generated tool results in tags) + // 2. ToolResultBlockParam's content/context text arrays if it contains "" (see formatToolDeniedFeedback, attemptCompletion, executeCommand, and consecutiveMistakeCount >= 3) or "" (see askFollowupQuestion), we place all user generated content in these tags so they can effectively be used as markers for when we should parse mentions) Promise.all( userContent.map(async (block) => { if (block.type === "text") { @@ -1646,7 +1646,8 @@ ${this.customInstructions.trim()} text: await parseMentions(block.text, cwd, this.providerRef.deref()?.urlScraper), } } else if (block.type === "tool_result") { - if (typeof block.content === "string" && block.content.includes("")) { + const isUserMessage = (text: string) => text.includes("") || text.includes("") + if (typeof block.content === "string" && isUserMessage(block.content)) { return { ...block, content: await parseMentions(block.content, cwd, this.providerRef.deref()?.urlScraper), @@ -1654,7 +1655,7 @@ ${this.customInstructions.trim()} } else if (Array.isArray(block.content)) { const parsedContent = await Promise.all( block.content.map(async (contentBlock) => { - if (contentBlock.type === "text" && contentBlock.text.includes("")) { + if (contentBlock.type === "text" && isUserMessage(contentBlock.text)) { return { ...contentBlock, text: await parseMentions(