diff --git a/backend/src/routes/interviewWorkflow.js b/backend/src/routes/interviewWorkflow.js index e8650c2..e5700d1 100644 --- a/backend/src/routes/interviewWorkflow.js +++ b/backend/src/routes/interviewWorkflow.js @@ -122,13 +122,12 @@ router.get('/analysis', wrapAsync(async (req, res) => { findingCounts[type] = (findingCounts[type] || 0) + 1; }); - try { - const parsed = JSON.parse(interview.inference_notes || '{}'); + const inferenceNotes = String(interview.inference_notes || '').trim(); + if (inferenceNotes.startsWith('{')) { + const parsed = JSON.parse(inferenceNotes); (parsed.tags || []).forEach((tag) => { tagCounts[tag] = (tagCounts[tag] || 0) + 1; }); - } catch (error) { - console.error('Failed to parse interview inference notes', error); } });