Fix classifier import and duplicate output
This commit is contained in:
parent
28a2f63713
commit
fcee065231
|
|
@ -457,6 +457,18 @@
|
|||
events.scrollTop = events.scrollHeight;
|
||||
}
|
||||
|
||||
function eventsInclude(eventsList, type) {
|
||||
return Array.isArray(eventsList) && eventsList.some((event) => event.type === type);
|
||||
}
|
||||
|
||||
function shouldRenderImmediateResult(data) {
|
||||
if (!data || !data.status) return false;
|
||||
if (data.status === "completed" && eventsInclude(data.events, "task_completed")) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
async function loadRecentEvents() {
|
||||
const response = await fetch("/events?limit=1000");
|
||||
const data = await response.json();
|
||||
|
|
@ -611,8 +623,10 @@
|
|||
if (data.events && Array.isArray(data.events)) {
|
||||
data.events.forEach(addEvent);
|
||||
}
|
||||
if (shouldRenderImmediateResult(data)) {
|
||||
renderRuntimeResult(data.result, data.status);
|
||||
}
|
||||
}
|
||||
|
||||
async function resolveSecret(secret) {
|
||||
if (!lastSecretRequest) {
|
||||
|
|
@ -641,8 +655,10 @@
|
|||
});
|
||||
const data = await response.json();
|
||||
data.events.forEach(addEvent);
|
||||
if (shouldRenderImmediateResult(data)) {
|
||||
renderRuntimeResult(data.result, data.status);
|
||||
}
|
||||
}
|
||||
|
||||
async function resolvePassword(password) {
|
||||
if (!lastPasswordRequest) {
|
||||
|
|
@ -671,8 +687,10 @@
|
|||
});
|
||||
const data = await response.json();
|
||||
data.events.forEach(addEvent);
|
||||
if (shouldRenderImmediateResult(data)) {
|
||||
renderRuntimeResult(data.result, data.status);
|
||||
}
|
||||
}
|
||||
|
||||
async function sendTask() {
|
||||
const taskId = "web-" + Date.now();
|
||||
|
|
@ -707,7 +725,9 @@
|
|||
clearSecretControls();
|
||||
clearPasswordControls();
|
||||
data.events.forEach(addEvent);
|
||||
if (shouldRenderImmediateResult(data)) {
|
||||
renderRuntimeResult(data.result, data.status);
|
||||
}
|
||||
if (data.task_id) {
|
||||
attachStream(data.task_id);
|
||||
}
|
||||
|
|
@ -742,8 +762,10 @@
|
|||
data.retry_result.events.forEach(addEvent);
|
||||
}
|
||||
currentTaskId = data.retry_result.task_id || currentTaskId;
|
||||
if (shouldRenderImmediateResult(data.retry_result)) {
|
||||
renderRuntimeResult(data.retry_result.result, data.retry_result.status);
|
||||
}
|
||||
}
|
||||
if (data.status !== "ok") {
|
||||
addSystemMessage("Feedback", data.message || "Не удалось сохранить feedback.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||
import asyncio
|
||||
import json
|
||||
import logging
|
||||
import re
|
||||
from typing import Any
|
||||
|
||||
from app.core.contracts import ExecutionDirective
|
||||
|
|
|
|||
Loading…
Reference in New Issue