mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-07-16 17:07:39 +02:00
Add files via upload
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user