mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 06:51:16 +08:00
When the stream consumer has sent at least one message (already_sent=True), the gateway skips sending the final response to avoid duplicates. But this also suppressed error messages when the agent failed mid-loop — rate limit exhaustion, context overflow, compression failure, etc. The user would see the last streamed content and then nothing: no error message, no explanation. The agent appeared to 'stop responding.' Fix: check the 'failed' flag at both the producer (_run_agent marks already_sent) and consumer (_handle_message_with_agent checks it) sites. Error messages are always delivered regardless of streaming state.