fix: prevent duplicate generator spawns in handleSessionInit

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jayvenn21
2026-02-04 10:06:18 -05:00
committed by Alex Newman
parent 576d407c00
commit 5d1ee20076
@@ -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);