Add files via upload

This commit is contained in:
公明
2026-05-28 14:34:14 +08:00
committed by GitHub
parent 8a089a826c
commit df531910cf
6 changed files with 105 additions and 1 deletions
+35
View File
@@ -1271,6 +1271,22 @@ function mergeMcpExecutionIDLists(prev, next) {
return out;
}
function formatEinoRunRetryMessage(message, data) {
const d = data && typeof data === 'object' ? data : {};
const base = String(message || '').trim();
const errRaw = d.error != null ? String(d.error).trim() : '';
if (!errRaw) {
return base;
}
const detailLabel = typeof window.t === 'function'
? window.t('chat.einoRunRetryErrorDetail')
: '错误详情';
if (base && base.indexOf(errRaw) !== -1) {
return base;
}
return base ? (base + '\n' + detailLabel + '' + errRaw) : (detailLabel + '' + errRaw);
}
// 处理流式事件
function handleStreamEvent(event, progressElement, progressId,
getAssistantId, setAssistantId, getMcpIds, setMcpIds) {
@@ -1582,6 +1598,20 @@ function handleStreamEvent(event, progressElement, progressId,
break;
}
case 'eino_run_retry': {
const d = event.data || {};
const title = typeof window.t === 'function'
? window.t('chat.einoRunRetryTitle')
: '🔁 临时错误重试';
const msg = formatEinoRunRetryMessage(event.message, d);
addTimelineItem(timeline, 'warning', {
title: title,
message: msg,
data: d
});
break;
}
case 'iteration_limit_reached': {
addTimelineItem(timeline, 'warning', {
title: typeof window.t === 'function' ? window.t('chat.iterationLimitReachedTitle') : '⛔ 达到迭代上限',
@@ -2966,6 +2996,11 @@ function addTimelineItem(timeline, type, options) {
${escapeHtml(options.message || taskCancelledLabel)}
</div>
`;
} else if (type === 'warning' && options.message) {
const streamBody = typeof formatTimelineStreamBody === 'function'
? formatTimelineStreamBody(options.message, options.data)
: options.message;
content += `<div class="timeline-item-content">${formatMarkdown(streamBody)}</div>`;
} else if (type === 'progress' && options.message) {
content += `<div class="timeline-item-content timeline-eino-trace"><pre class="tool-result">${escapeHtml(options.message)}</pre></div>`;
} else if (type === 'user_interrupt_continue' && options.message) {