fix(ui-conversation): ignore legacy compact events without ids

This commit is contained in:
imccyu
2026-08-09 20:21:49 +08:00
parent fcbc97a88d
commit 0cfe852c2d
2 changed files with 23 additions and 1 deletions

View File

@@ -39,7 +39,9 @@ export const compactionDefinition: ConversationNodeDefinition<CompactionState> =
|| event.type === 'compact/summary'
|| event.type === 'compact/end') {
if (event.data.sourceCommandId !== undefined) return null
return { id: String(event.data.compactionId), role: event.type === 'compact/start' ? 'start' : 'update' }
const compactionId: unknown = event.data.compactionId
if (typeof compactionId !== 'string' || compactionId === '') return null
return { id: compactionId, role: event.type === 'compact/start' ? 'start' : 'update' }
}
return null
},