This commit is contained in:
seb
2026-10-04 08:18:36 +02:00
parent f2fce9097b
commit 4edd417dab
19 changed files with 141 additions and 220 deletions

View File

@@ -177,14 +177,17 @@ function MessageRow({ msg, showTime = true }) {
bodyLength = textContent.length;
}
let displayText = '';
if (resObj && ('answer' in resObj || 'content' in resObj) && ('tool_call_id' in resObj) && !('status' in resObj)) {
displayText = resObj.answer || resObj.content || '';
} else {
displayText = statusText
const isToolAnswer =
Boolean(resObj) &&
('answer' in resObj || 'content' in resObj) &&
'tool_call_id' in resObj &&
!('status' in resObj);
const displayText = isToolAnswer
? resObj.answer || resObj.content || ''
: statusText
? `${statusText}${bodyLength != null ? ` · ${bodyLength} byte` : ''}`
: (bodyLength != null ? `${bodyLength} byte` : String(textContent));
}
return (
<Box sx={{ display: 'flex', justifyContent: 'flex-start', py: 0.35, px: 2 }}>