Files
hermes-web-ui/tests
ekko 842cf64360 fix: prevent run.failed from overwriting assistant message with substantial content (#1685)
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>
2026-06-20 10:12:20 +08:00
..