Skip to content

Commit 122676b

Browse files
committed
Remove weird output in codegen row
Now printing only readable things.
1 parent abbf34f commit 122676b

File tree

1 file changed

+1
-37
lines changed

1 file changed

+1
-37
lines changed

apps/desktop/src/lib/codegen/messages.ts

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -529,38 +529,6 @@ function contentBlockToString(lastBlock?: ContentBlockParam): string | undefined
529529

530530
if (lastBlock.type === 'text') {
531531
return lastBlock.text;
532-
} else if (lastBlock.type === 'web_search_tool_result') {
533-
const toolUse = lastBlock.content;
534-
if (Array.isArray(toolUse)) {
535-
const lastTool = toolUse.at(-1);
536-
if (lastTool) {
537-
return lastTool.url;
538-
}
539-
}
540-
} else if (lastBlock.type === 'tool_result') {
541-
// Skipping tool calls until we figure out how to parse them safely.
542-
const content = lastBlock.content;
543-
if (typeof content === 'string') {
544-
return content;
545-
} else if (Array.isArray(content)) {
546-
const lastBlock = content.at(-1);
547-
if (lastBlock?.type === 'text') {
548-
return lastBlock.text;
549-
} else if (lastBlock?.type === 'image') {
550-
const source = lastBlock.source;
551-
if (source.type === 'url') {
552-
return source.url;
553-
} else {
554-
return '<image>';
555-
}
556-
}
557-
}
558-
} else if (lastBlock.type === 'thinking') {
559-
return lastBlock.thinking;
560-
} else if (lastBlock.type === 'server_tool_use') {
561-
return lastBlock.name;
562-
} else if (lastBlock.type === 'redacted_thinking') {
563-
return lastBlock.data;
564532
}
565533
}
566534

@@ -575,11 +543,7 @@ export function extractLastMessage(messages: ClaudeMessage[]): string | undefine
575543
const { payload } = message;
576544
if (payload.source === 'claude') {
577545
const content = payload.data;
578-
if (content.type === 'assistant') {
579-
const contentBlocks = content.message.content;
580-
const summary = contentBlockToString(contentBlocks.at(-1));
581-
if (summary) return summary;
582-
} else if (content.type === 'result') {
546+
if (content.type === 'result') {
583547
if (content.subtype === 'success') {
584548
if (content.result) return content.result;
585549
} else {

0 commit comments

Comments
 (0)