Skip to content

Commit 2c4c145

Browse files
committed
fix: continue task
1 parent 1be4276 commit 2c4c145

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/core/tools/attemptCompletionTool.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,20 @@ export async function attemptCompletionTool(
129129
})
130130

131131
toolResults.push(...formatResponse.imageBlocks(images))
132-
cline.userMessageContent.push({ type: "text", text: `${toolDescription()} Result:` })
133-
cline.userMessageContent.push(...toolResults)
132+
133+
const newMessage: (Anthropic.TextBlockParam | Anthropic.ImageBlockParam)[] = [
134+
{ type: "text", text: `${toolDescription()} Result:` },
135+
...toolResults,
136+
]
137+
if (cline.apiConfiguration?.toolCallEnabled === true && block.toolUseId) {
138+
cline.userMessageContent.push({
139+
type: "tool_result",
140+
tool_use_id: block.toolUseId,
141+
content: newMessage,
142+
})
143+
} else {
144+
cline.userMessageContent.push(...newMessage)
145+
}
134146

135147
return
136148
}

0 commit comments

Comments
 (0)