Skip to content

Commit 856fa26

Browse files
fix: preserve non-text content in consolidateContentForClaudeCode
When original response contains only non-text content (e.g., images), return the original response unchanged instead of creating an empty text block that overwrites the content. Co-authored-by: Cameron Cooke <cameroncooke@users.noreply.github.com>
1 parent 63228ae commit 856fa26

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/utils/validation.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ export function consolidateContentForClaudeCode(response: ToolResponse): ToolRes
238238
// Note: Image content is not handled in this workaround as it requires special formatting
239239
});
240240

241+
// If no text content was found, return the original response to preserve non-text content
242+
if (textParts.length === 0) {
243+
return response;
244+
}
245+
241246
const consolidatedText = textParts.join('');
242247

243248
return {

0 commit comments

Comments
 (0)