mirror of
https://github.com/EKKOLearnAI/hermes-web-ui.git
synced 2026-07-18 14:33:04 +00:00
842cf64360
When a run.failed event fires while the assistant message is still streaming, addAgentErrorMessage previously unconditionally overwrote the message with an error — losing the assistant reply even if it had already produced meaningful output. This commonly happened during Socket.IO disconnects in long tool-use runs. The fix checks whether the streaming message has substantial content (>100 chars). If so, it only closes the stream and appends a separate error message instead of overwriting. For empty/trivial messages, the original overwrite behavior is preserved since the run failed before producing useful output. Fixes #1644 Co-authored-by: Andy365-365 <andy365-365@users.noreply.github.com>