diff --git a/app/api/learning/persistent-status/route.js b/app/api/learning/persistent-status/route.js index 861d0ad..9d0d7b1 100644 --- a/app/api/learning/persistent-status/route.js +++ b/app/api/learning/persistent-status/route.js @@ -64,6 +64,7 @@ export async function GET() { // Get current automation status if available let currentStatus = null; + let learningStatus = null; try { const { getAutomationInstance } = await import('../../../../lib/automation-singleton.js'); const automation = await getAutomationInstance(); @@ -72,7 +73,7 @@ export async function GET() { // If automation has learning status, get it too if (typeof automation.getLearningStatus === 'function') { - const learningStatus = await automation.getLearningStatus(); + learningStatus = await automation.getLearningStatus(); if (learningStatus && learningStatus.report) { // Update some data from current learning status persistentData.lastUpdated = new Date().toISOString(); @@ -88,7 +89,7 @@ export async function GET() { success: true, persistentData: { ...persistentData, - isLive: currentStatus?.isActive || false, + isLive: currentStatus?.isActive || currentStatus?.isRunning || learningStatus?.enabled || false, currentRunTime: currentStatus?.startTime || null, enhancedSummary: { totalDecisions: persistentData.learningDecisions, diff --git a/prisma/prisma/dev.db b/prisma/prisma/dev.db index a3357d7..2c7f048 100644 Binary files a/prisma/prisma/dev.db and b/prisma/prisma/dev.db differ