From fc6095c8ad54efef4cbdee321ef934206dce30f3 Mon Sep 17 00:00:00 2001 From: Sujay Choubey Date: Wed, 18 Feb 2026 00:00:42 +0530 Subject: [PATCH] fix: start lifecycle manager in web dashboard to update session status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dashboard was permanently showing all sessions as "spawning" because the lifecycle manager was never started. The lifecycle manager is the component that polls sessions and detects state transitions (spawning → working → pr_open → etc.), updating the metadata files accordingly. This change initializes and starts the lifecycle manager when the web services are created, enabling automatic session status updates. Closes #79 Co-Authored-By: Claude Opus 4.5 --- packages/web/src/lib/services.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/web/src/lib/services.ts b/packages/web/src/lib/services.ts index 7bd440790..ba481ef9b 100644 --- a/packages/web/src/lib/services.ts +++ b/packages/web/src/lib/services.ts @@ -14,9 +14,11 @@ import { loadConfig, createPluginRegistry, createSessionManager, + createLifecycleManager, type OrchestratorConfig, type PluginRegistry, type SessionManager, + type LifecycleManager, type SCM, type Tracker, type ProjectConfig, @@ -34,6 +36,7 @@ export interface Services { config: OrchestratorConfig; registry: PluginRegistry; sessionManager: SessionManager; + lifecycleManager: LifecycleManager; } // Cache in globalThis for Next.js HMR stability @@ -72,7 +75,13 @@ async function initServices(): Promise { const sessionManager = createSessionManager({ config, registry }); - const services = { config, registry, sessionManager }; + // Create and start the lifecycle manager to poll session status + // This runs a background loop that detects state transitions: + // spawning → working → pr_open → ci_failed/review_pending → etc. + const lifecycleManager = createLifecycleManager({ config, registry, sessionManager }); + lifecycleManager.start(); // Start polling (default: every 30 seconds) + + const services = { config, registry, sessionManager, lifecycleManager }; globalForServices._aoServices = services; return services; }