fix(agent,webui): show agent error messages and fix IME enter key bug

This commit is contained in:
yiling
2026-06-03 11:46:24 +08:00
parent 8683bc463e
commit 9dc2d07151
3 changed files with 50 additions and 1 deletions
+8 -1
View File
@@ -153,7 +153,7 @@ If you need to create files in the local filesystem (for example, a temporary fi
}
})
const text = assistantMessage.content
let text = assistantMessage.content
.filter((c) => c.type === 'text')
.map((c) => {
if ('text' in c && typeof c.text === 'string') {
@@ -163,6 +163,13 @@ If you need to create files in the local filesystem (for example, a temporary fi
})
.join('\n')
if (assistantMessage.stopReason === 'error' && assistantMessage.errorMessage) {
if (text) {
text += '\n\n'
}
text += `Error: ${assistantMessage.errorMessage}`
}
const usage: Usage = {
model: modelId,
inputTokens: assistantMessage.usage?.input || 0,