From 5d1ee20076eebe34ba470209c46b9d55801ba150 Mon Sep 17 00:00:00 2001 From: jayvenn21 Date: Wed, 4 Feb 2026 10:06:18 -0500 Subject: [PATCH] fix: prevent duplicate generator spawns in handleSessionInit Co-authored-by: Cursor --- src/services/worker/http/routes/SessionRoutes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/worker/http/routes/SessionRoutes.ts b/src/services/worker/http/routes/SessionRoutes.ts index fdf93546..8944f6f3 100644 --- a/src/services/worker/http/routes/SessionRoutes.ts +++ b/src/services/worker/http/routes/SessionRoutes.ts @@ -291,8 +291,8 @@ export class SessionRoutes extends BaseRouteHandler { }); } - // Start agent in background using the helper method - this.startGeneratorWithProvider(session, this.getSelectedProvider(), 'init'); + // Idempotent: ensure generator is running (matches handleObservations / handleSummarize) + this.ensureGeneratorRunning(sessionDbId, 'init'); // Broadcast session started event this.eventBroadcaster.broadcastSessionStarted(sessionDbId, session.project);