mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 09:13:08 +00:00
fix: update feature status counting and enhance overview handler
- Change 'waiting_approval' status to 'in_progress' and add handling for 'waiting_approval' as pending. - Introduce counting of live running features per project in the overview handler by fetching all running agents. - Ensure accurate representation of project statuses in the overview. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -45,9 +45,13 @@ function computeFeatureCounts(features: Feature[]): FeatureStatusCounts {
|
|||||||
break;
|
break;
|
||||||
case 'running':
|
case 'running':
|
||||||
case 'generating_spec':
|
case 'generating_spec':
|
||||||
case 'waiting_approval':
|
case 'in_progress':
|
||||||
counts.running++;
|
counts.running++;
|
||||||
break;
|
break;
|
||||||
|
case 'waiting_approval':
|
||||||
|
// waiting_approval means agent finished, needs human review - count as pending
|
||||||
|
counts.pending++;
|
||||||
|
break;
|
||||||
case 'completed':
|
case 'completed':
|
||||||
counts.completed++;
|
counts.completed++;
|
||||||
break;
|
break;
|
||||||
@@ -153,6 +157,9 @@ export function createOverviewHandler(
|
|||||||
const settings = await settingsService.getGlobalSettings();
|
const settings = await settingsService.getGlobalSettings();
|
||||||
const projectRefs: ProjectRef[] = settings.projects || [];
|
const projectRefs: ProjectRef[] = settings.projects || [];
|
||||||
|
|
||||||
|
// Get all running agents once to count live running features per project
|
||||||
|
const allRunningAgents = await autoModeService.getRunningAgents();
|
||||||
|
|
||||||
// Collect project statuses in parallel
|
// Collect project statuses in parallel
|
||||||
const projectStatusPromises = projectRefs.map(async (projectRef): Promise<ProjectStatus> => {
|
const projectStatusPromises = projectRefs.map(async (projectRef): Promise<ProjectStatus> => {
|
||||||
try {
|
try {
|
||||||
@@ -165,6 +172,13 @@ export function createOverviewHandler(
|
|||||||
const autoModeStatus = autoModeService.getStatusForProject(projectRef.path, null);
|
const autoModeStatus = autoModeService.getStatusForProject(projectRef.path, null);
|
||||||
const isAutoModeRunning = autoModeStatus.isAutoLoopRunning;
|
const isAutoModeRunning = autoModeStatus.isAutoLoopRunning;
|
||||||
|
|
||||||
|
// Count live running features for this project (across all branches)
|
||||||
|
// This ensures we only count features that are actually running in memory
|
||||||
|
const liveRunningCount = allRunningAgents.filter(
|
||||||
|
(agent) => agent.projectPath === projectRef.path
|
||||||
|
).length;
|
||||||
|
featureCounts.running = liveRunningCount;
|
||||||
|
|
||||||
// Get notification count for this project
|
// Get notification count for this project
|
||||||
let unreadNotificationCount = 0;
|
let unreadNotificationCount = 0;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user