refactor: identify and freeze messages at creation

This commit is contained in:
_Kerman
2026-07-28 13:55:59 +08:00
parent c49c0ba497
commit fbf87e660c
345 changed files with 5220 additions and 2901 deletions
+1 -1
View File
@@ -94,7 +94,7 @@ export function waitForIdle(ctx: Context, agent: Agent): Promise<void> {
export function finalText(events: SessionEvent[]): string {
const message = events.findLast(event => event.type === 'assistant/message')
if (message?.type !== 'assistant/message') return ''
return message.data.content
return message.data.message.content
.filter(block => block.type === 'text')
.map(block => block.text)
.join('')