fix: remove assistant event handler to prevent duplicate messages

This commit is contained in:
Zac Gaetano 2026-04-05 11:45:43 -04:00
parent 44a8ddf458
commit de8a7798c3

View file

@ -171,20 +171,9 @@ const App = () => {
}
// Claude stream-json events
if (type === 'assistant') {
// Full assistant message (not streaming)
const content = data.message?.content;
let text = '';
if (Array.isArray(content)) {
text = content.filter(b => b.type === 'text').map(b => b.text).join('');
} else if (typeof content === 'string') {
text = content;
}
if (text) {
pendingAssistantRef.current += text;
upsertStreamingMessage(pendingAssistantRef.current, false);
}
}
// NOTE: We intentionally skip the 'assistant' event type.
// It contains the full message text that was ALREADY streamed via
// content_block_delta events, so handling it would create a duplicate bubble.
if (type === 'content_block_delta') {
const delta = data.delta;