From 48dcb40be480410c1b36255c98ceea5955ec6cee Mon Sep 17 00:00:00 2001 From: Andrew Park Date: Fri, 29 May 2026 09:48:59 -0700 Subject: [PATCH] fix(desktop): surface backend error frames in Deep Research stream (#428) --- frontend/src/components/Chat/InputArea.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/frontend/src/components/Chat/InputArea.tsx b/frontend/src/components/Chat/InputArea.tsx index dacb805c..31fa20f7 100644 --- a/frontend/src/components/Chat/InputArea.tsx +++ b/frontend/src/components/Chat/InputArea.tsx @@ -308,6 +308,23 @@ export function InputArea() { energy_j: ev.energy_j, duration_s: ev.duration_s, }); + } else if (ev.type === 'error') { + // Backend setup/worker failure (Ollama down, planner model + // missing, KnowledgeStore locked, etc.). Without surfacing the + // message, the user sees only the generic "No response was + // generated" fallback and has no way to self-diagnose. + const msg = ev.message || 'Research failed (no detail provided)'; + accumulatedContent = accumulatedContent + ? `${accumulatedContent}\n\n**Research stopped:** ${msg}` + : `**Research failed:** ${msg}`; + setStreamState({ content: accumulatedContent, phase: '' }); + useAppStore.getState().addLogEntry({ + timestamp: Date.now(), + level: 'error', + category: 'chat', + message: `Deep Research error: ${msg}`, + }); + toast.error(msg, { duration: 8000 }); } else if (ev.type === 'done') { if (ev.usage) { usage = {