Skip to content

Commit 0e86549

Browse files
daniel-lxsEric Wheeler
authored andcommitted
fix: only add text block to newUserContent when responseText has content
This prevents the API error 'text content blocks must be non-empty' that occurs when resuming a task without providing new instructions.
1 parent 0d234e7 commit 0e86549

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/core/task/Task.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -987,12 +987,12 @@ export class Task extends EventEmitter<ClineEvents> {
987987
return "just now"
988988
})()
989989

990-
newUserContent.push({
991-
type: "text",
992-
text: responseText
993-
? `\n\nNew instructions for task continuation:\n<user_message>\n${responseText}\n</user_message>`
994-
: "",
995-
})
990+
if (responseText) {
991+
newUserContent.push({
992+
type: "text",
993+
text: `\n\nNew instructions for task continuation:\n<user_message>\n${responseText}\n</user_message>`,
994+
})
995+
}
996996

997997
if (responseImages && responseImages.length > 0) {
998998
newUserContent.push(...formatResponse.imageBlocks(responseImages))

0 commit comments

Comments
 (0)