fix(desktop): surface backend error frames in Deep Research stream (#428)

This commit is contained in:
Andrew Park
2026-05-29 09:48:59 -07:00
committed by GitHub
parent 94c515bba5
commit 48dcb40be4
@@ -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 = {