hermes - 💡(How to fix) Fix v0.15.1 still highly unstable: Unclosed connector + Telegram timeouts + double gateway instance race condition

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  • ERROR asyncio: Unclosed client session + Unclosed connector still appears (reduced but not eliminated) ERROR gateway.run: Another gateway instance (PID XXX) started during our startup. Exiting to avoid double-running.

Fix Action

Fix / Workaround

Workaround applied:

  • Changed systemd service to hermes gateway run (removed --replace) + Restart=on-failure

Code Example

ERROR gateway.run: Another gateway instance (PID XXX) started during our startup. Exiting to avoid double-running.
RAW_BUFFERClick to expand / collapse

Version: Hermes Agent v0.15.1 (2026-05-29)

Environment:

  • OS: Linux (systemd managed)
  • Installation: system-wide Python
  • Heavy Hindsight usage + Telegram platform

Current Status (v0.15.1):

Even after the latest release, the gateway remains extremely unstable due to multiple issues:

1. Unclosed connector still occurs

  • ERROR asyncio: Unclosed client session + Unclosed connector still appears (reduced but not eliminated)

2. Main restart driver: Telegram + Auxiliary failures

  • Repeated telegram connect timed out after 30s
  • OpenRouter payment/credit errors
  • Nous authentication missing

3. Newly identified critical issue: Double gateway instance race condition

  • When using hermes gateway run --replace under systemd Restart=always, a race condition occurs:
    ERROR gateway.run: Another gateway instance (PID XXX) started during our startup. Exiting to avoid double-running.
  • This causes the new instance to immediately exit with status=1, triggering another restart
  • Restart counter quickly climbs (already reached 23+)

4. Related closed issues still not resolved

  • #10865 Multiple AIAgent instances leak aiohttp client sessions
  • #11923 Hindsight still leaks aiohttp ClientSession/connector after fix

Impact:

  • Gateway restarts thousands of times per day
  • Production usage nearly impossible
  • Both resource leak and lack of resilience + startup race condition exist

Workaround applied:

  • Changed systemd service to hermes gateway run (removed --replace) + Restart=on-failure

@sharyuke

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix v0.15.1 still highly unstable: Unclosed connector + Telegram timeouts + double gateway instance race condition