From a405b5545b0563b878b32277428b6d7c206c1759 Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 31 May 2026 16:49:36 +0200 Subject: [PATCH] fix: exclude orchestrator sessions from active-session guard in update API POST /api/update returns 409 when the orchestrator session (which is always 'idle') is counted as active. This prevents the dashboard Update button from ever working because the orchestrator itself is always running while the dashboard is up. Filter out orchestrator sessions with isOrchestratorSession() so only worker sessions block the update. --- packages/web/src/app/api/update/route.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/web/src/app/api/update/route.ts b/packages/web/src/app/api/update/route.ts index 6fdc7af04c..2df430ac86 100644 --- a/packages/web/src/app/api/update/route.ts +++ b/packages/web/src/app/api/update/route.ts @@ -13,7 +13,7 @@ import { spawn } from "node:child_process"; import { NextResponse, type NextRequest } from "next/server"; -import { isWindows } from "@aoagents/ao-core"; +import { isOrchestratorSession, isWindows } from "@aoagents/ao-core"; import { getServices } from "@/lib/services"; export const dynamic = "force-dynamic"; @@ -39,7 +39,11 @@ export async function POST(_req: NextRequest) { try { const { sessionManager } = await getServices(); const sessions = await sessionManager.list(); - activeCount = sessions.filter((s) => ACTIVE_STATUSES.has(s.status)).length; + activeCount = sessions.filter( + (s) => + ACTIVE_STATUSES.has(s.status) && + !isOrchestratorSession(s), + ).length; } catch (err) { return NextResponse.json( {