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:
mindesbunister
2025-07-29 18:04:27 +02:00
parent 158cd1741b
commit b930f02362
4 changed files with 124 additions and 16 deletions

View File

@@ -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');
}
}