mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-06 10:47:12 +08:00
When run_conversation encounters a non-retryable client error (401, 400, etc.), it returns a dict with failed=True instead of raising. The gateway's _run_and_close only branched on exceptions, so it always emitted run.completed even for failed runs — clients could not distinguish success from failure. Inspect the result dict before emitting: if failed=True, emit run.failed with the error message; otherwise emit run.completed as before. The existing except Exception path is unchanged for genuine programming errors. Fixes #15561