hermes - 💡(How to fix) Fix macOS Atomic Hermes desktop-gateway conflicts with CLI gateway --replace and blocks Discord token lock

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

  • detect that the owner is Atomic desktop-gateway and provide a clear actionable error, or

Fix Action

Fix / Workaround

  1. Manual workaround:
    • terminate PID 32059
    • restart ~/.local/bin/hermes gateway run --replace

Code Example

~/.local/bin/hermes gateway run --replace

---

discord: Discord bot token already in use (PID <desktop-gateway-pid>). Stop the other gateway first.
RAW_BUFFERClick to expand / collapse

Bug Description

On macOS, when Atomic Hermes is running its bundled desktop-gateway.py and a CLI gateway is started with:

~/.local/bin/hermes gateway run --replace

the CLI gateway can fail to start Discord with:

discord: Discord bot token already in use (PID <desktop-gateway-pid>). Stop the other gateway first.

This leaves Discord responses down until the Atomic desktop-gateway process is manually terminated and the CLI gateway is restarted.

Environment

  • OS: macOS
  • Atomic Hermes desktop app: 0.1.36
  • Hermes agent commit: 755a28042
  • Hermes home:
    • ~/.hermes
    • Atomic app Hermes home is symlinked to ~/.hermes
  • Platform: Discord
  • Lock path:
    • ~/.local/state/hermes/gateway-locks/discord-bot-token-<redacted>.lock

Observed Timeline

  1. Atomic Hermes starts:

    • /Applications/Atomic Hermes.app/Contents/Resources/python-server/desktop-gateway.py
    • PID: 32059
  2. Atomic desktop-gateway connects successfully:

    • [Discord] Connected as <bot>
    • ✓ discord connected
    • Gateway running with 2 platform(s)
  3. CLI gateway starts with --replace:

    • ~/.local/bin/hermes gateway run --replace
  4. CLI gateway fails:

    • [Discord] Discord bot token already in use (PID 32059). Stop the other gateway first.
    • Gateway hit a non-retryable startup conflict
    • gateway_state: startup_failed
  5. Manual workaround:

    • terminate PID 32059
    • restart ~/.local/bin/hermes gateway run --replace
  6. Discord recovers:

    • [Discord] Connected as <bot>
    • ✓ discord connected
    • Gateway running with 1 platform(s)

Expected Behavior

gateway run --replace should either:

  • correctly replace the Atomic desktop-gateway process if it owns the same Hermes gateway lock/token, or
  • detect that the owner is Atomic desktop-gateway and provide a clear actionable error, or
  • avoid starting a second gateway from the CLI when Atomic Hermes already owns the same Discord token.

Actual Behavior

The CLI gateway starts, sees the Discord token lock owned by Atomic desktop-gateway, fails with discord-bot-token_lock, and Discord responses stop working until manual process cleanup.

Related

Possibly related to:

  • #20712 macOS scoped-lock staleness detection
  • #22391 duplicate gateway / restart behavior

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