refactor: total_failed_tasks -> total_ongoing_tasks

This commit is contained in:
a7m-1st 2025-11-14 15:47:15 +03:00
parent b9a7b4c69e
commit 3b18bb64ff
5 changed files with 7 additions and 10 deletions

View file

@ -189,12 +189,12 @@ export default function ProjectDialog({
<div className="flex flex-col gap-xs">
<span className="text-text-label text-label-sm font-normal">
{t("layout.failed")}
{t("layout.ongoing")}
</span>
<div className="flex flex-row items-center gap-sm">
<CircleSlash className="w-4 h-4 text-icon-cuation" />
<CircleSlash className="w-4 h-4 text-icon-information" />
<span className="text-text-heading text-body-lg font-bold">
{project.total_failed_tasks}
{project.total_ongoing_tasks}
</span>
</div>
</div>

View file

@ -110,10 +110,9 @@ export default function ProjectGroup({
return date.toLocaleDateString();
};
// Calculate if project has issues (failed tasks or tasks requiring human in the loop)
const hasFailedTasks = project.total_failed_tasks > 0;
// Calculate if project has issues (requiring human in the loop)
const hasHumanInLoop = project.ongoing_tasks?.some(task => task.status === 'pending') || false;
const hasIssue = hasFailedTasks || hasHumanInLoop;
const hasIssue = hasHumanInLoop;
// Calculate agent count (placeholder - count unique agents from tasks if available)
const agentCount = project.tasks?.length > 0

View file

@ -207,7 +207,6 @@ export default function GroupedHistoryView({
tasks: [],
ongoing_tasks: [],
total_completed_tasks: 0,
total_failed_tasks: 0,
total_ongoing_tasks: 0,
average_tokens_per_task: 0
};

View file

@ -17,7 +17,7 @@ const groupTasksByProject = (tasks: HistoryTask[]): ProjectGroup[] => {
latest_task_date: task.created_at || new Date().toISOString(),
tasks: [],
total_completed_tasks: 0,
total_failed_tasks: 0,
total_ongoing_tasks: 0,
average_tokens_per_task: 0,
last_prompt: task.question || "",
});

View file

@ -45,8 +45,7 @@ export interface ProjectGroup {
ongoing_tasks?: OngoingTask[]; // Add ongoing tasks to the project group
// Additional project-level metadata
total_completed_tasks: number;
total_failed_tasks: number;
total_ongoing_tasks?: number;
total_ongoing_tasks: number;
average_tokens_per_task: number;
}