Spaces:
Running
Fix summary not displaying: frontend was looking for result.final_answer but backend returns result.summary
Browse filesCRITICAL BUG FIX - Summary Display:
ISSUE:
- Frontend showed 'Analysis complete. Check the generated artifacts.' instead of actual summary
- User saw generic message instead of detailed analysis results
ROOT CAUSE:
- Frontend ChatInterface.tsx line 193: result.final_answer
- Backend orchestrator.py line 2438: result['summary']
- Field name mismatch!
BACKEND RETURNS (orchestrator.py lines 2437-2450):
{
'status': 'success',
'summary': summary_text, # Backend uses 'summary'
'metrics': metrics_data,
'artifacts': artifacts_data,
'plots': plots_data,
'workflow_history': workflow_history
}
FRONTEND WAS CHECKING:
result.final_answer || 'Analysis complete...' # Wrong field name!
FIX:
Changed frontend to check result.summary first:
const summaryText = result.summary || result.final_answer || 'Analysis complete...';
Now supports both field names for backward compatibility.
EVIDENCE FROM LOGS:
- Backend log: ' Enhanced summary generated with 3 plots, 2 metrics'
- Backend log: ' Session saved: 12a697fa-9520-451e-bf0e-8de78a01c9dd'
- Summary WAS generated but not displayed due to field mismatch
USER WILL NOW SEE:
- Full analysis summary with insights, findings, recommendations
- Model performance metrics
- Key insights from data
- Next steps and recommendations
Instead of just 'Analysis complete. Check the generated artifacts.'
|
@@ -186,7 +186,9 @@ export const ChatInterface: React.FC<{ onBack: () => void }> = ({ onBack }) => {
|
|
| 186 |
assistantContent += `📈 **Generated ${plots.length} Visualizations**\n\n`;
|
| 187 |
}
|
| 188 |
|
| 189 |
-
|
|
|
|
|
|
|
| 190 |
|
| 191 |
// Add assistant message with result
|
| 192 |
const assistantMessage: Message = {
|
|
|
|
| 186 |
assistantContent += `📈 **Generated ${plots.length} Visualizations**\n\n`;
|
| 187 |
}
|
| 188 |
|
| 189 |
+
// Extract summary from backend (field changed from final_answer to summary)
|
| 190 |
+
const summaryText = result.summary || result.final_answer || 'Analysis complete. Check the generated artifacts.';
|
| 191 |
+
assistantContent += summaryText;
|
| 192 |
|
| 193 |
// Add assistant message with result
|
| 194 |
const assistantMessage: Message = {
|