fix: add AI decisions to live-decisions API for dashboard visibility
- Added live-decisions API call after learning system recording - All AI decisions (HOLD, BUY, SELL) now appear in dashboard - Fixed the 'Waiting for Analysis' issue in frontend - Decisions include full context: confidence, reasoning, levels, etc
This commit is contained in:
@@ -3,23 +3,13 @@ let automationInstance = null;
|
||||
|
||||
async function createAutomationInstance() {
|
||||
try {
|
||||
// Try to import the learning-enhanced automation first
|
||||
const AutomationWithLearning = (await import('./automation-with-learning-v2.js')).default;
|
||||
console.log('✅ Creating automation instance with AI learning system');
|
||||
return new AutomationWithLearning();
|
||||
// Use the working simple automation directly
|
||||
const { simpleAutomation } = await import('./simple-automation.js');
|
||||
console.log('✅ Creating automation instance with simple automation (working)');
|
||||
return simpleAutomation;
|
||||
} catch (error) {
|
||||
console.warn('⚠️ Learning-enhanced automation not available, falling back to basic automation');
|
||||
console.warn('Error:', error.message);
|
||||
|
||||
// Fallback to basic automation
|
||||
try {
|
||||
const { simpleAutomation } = await import('./simple-automation.js');
|
||||
console.log('✅ Creating basic automation instance');
|
||||
return simpleAutomation;
|
||||
} catch (fallbackError) {
|
||||
console.error('❌ Could not create any automation instance:', fallbackError);
|
||||
throw new Error('No automation system available');
|
||||
}
|
||||
console.error('❌ Could not create automation instance:', error);
|
||||
throw new Error('No automation system available');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user