fix(server): close the memory recall step when nothing is found or recall fails (UF-051)

Only a successful recall reported its outcome, so an empty or failed
recall left "Recalling relevant memories..." as the last step after the
answer. Both cases now send a closing step and the turn goes on.
This commit is contained in:
shumeiko.it
2026-10-27 12:54:51 +01:00
parent 06d267dec8
commit b3b61e14c9
3 changed files with 125 additions and 1 deletions

View File

@@ -1892,11 +1892,16 @@ ${wsConfig?.templateId ? `- Workspace template: ${wsConfig.templateId} — tailo
});
sendEvent('tool_result', { name: 'auto_recall', result: resultText, duration: recallDuration, isError: false });
} else {
// UF-051: close the "Recalling…" step with its outcome, or it
// reads as still running after the answer lands.
sendEvent('step', { content: 'No relevant memories found.' });
sendEvent('tool_result', { name: 'auto_recall', result: 'No relevant memories found', duration: recallDuration, isError: false });
}
} catch {
throwIfTurnAborted();
// Non-blocking — if recall fails, continue without it
// Non-blocking — if recall fails, continue without it, and say so.
sendEvent('step', { content: 'Could not search memory. Continuing without it.' });
sendEvent('tool_result', { name: 'auto_recall', result: 'Memory search failed', isError: true });
}
}