hermes - 💡(How to fix) Fix [Bug]: Gateway: --replace multi-worker causes Feishu WebSocket failure [1 comments, 2 participants]

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…
GitHub stats
NousResearch/hermes-agent#18693Fetched 2026-05-03 04:54:54
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×6commented ×1

Error Message

Before executing destructive commands, check and warn if the target process is critical to system stability (e.g., the only running gateway instance, or a parent process). If a destructive command would kill the only running gateway instance, Hermes should warn the user and require explicit confirmation that they understand the risk — not just approve the command blindly.

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Code Example

Debug Report	https://paste.rs/jUZeK
agent.log	https://paste.rs/O0BcK
gateway.log	https://paste.rs/7AnhX

---

Debug Report: https://paste.rs/jUZeK
agent.log:   https://paste.rs/O0BcK  
gateway.log:  https://paste.rs/7AnhX

---
System Info:
- Hermes: v0.12.0 (2026-04-30)
- Python: 3.11.0rc1
- OS: WSL2 Ubuntu 22.04
- Feishu: WebSocket mode
RAW_BUFFERClick to expand / collapse

Bug Description

Bug Description

When hermes gateway starts with --replace flag (multi-worker mode), Feishu's App ID only permits ONE active WebSocket connection at a time. Only one worker successfully connects; all other workers fail and hang. If the worker holding the Feishu connection is killed, the entire process tree crashes — Gateway goes down completely.

Steps to Reproduce

  1. Start hermes gateway (default uses --replace, spawning multiple workers)
  2. Check Feishu connection status: only one worker succeeds, others fail
  3. Kill any one worker PID → entire Gateway process group collapses

Environment

  • Hermes version: v0.12.0
  • OS: WSL2 Ubuntu 22.04
  • Feishu connection: WebSocket mode

Suggested Fix

Run in single-worker mode by default (remove --replace), which is more stable for Feishu WebSocket connections. If multi-worker is required, each worker should use an isolated Feishu App ID.

CLI: Danger command approval loop causes repeated Gateway crashes

Bug Description

Executing pkill/kill on gateway processes triggers the danger command approval system. User approves → command executes → Gateway crashes. User approves again → same destructive command runs again → Gateway crashes again. This creates an approval loop: the user keeps approving, but each approval further destroys the running system.

Steps to Reproduce

  1. Gateway is running normally
  2. Execute pkill gateway or kill <gateway_pid>
  3. Approval prompt appears → user approves
  4. Command executes → entire gateway process group crashes
  5. Repeat steps 1-4 → enters infinite crash loop

Environment

  • Hermes version: v0.12.0
  • OS: WSL2 Ubuntu 22.04

Suggested Fix

Before executing destructive commands, check and warn if the target process is critical to system stability (e.g., the only running gateway instance, or a parent process).

Skills: rglob path injection vulnerability allows reading arbitrary files

Bug Description

The skills rglob function is vulnerable to path injection. An attacker can inject arbitrary file patterns via the rglob parameter, potentially reading sensitive files outside the intended skills directory.

Affected Component

Skills loader using rglob pattern matching

Suggested Fix

Sanitize and validate all rglob input paths before use. Use allowlist for permitted paths.

Steps to Reproduce

  1. Start hermes gateway (default uses --replace, spawning multiple workers)

  2. Check Feishu connection status: only one worker succeeds, others fail

  3. Kill any one worker PID → entire Gateway process group collapses

  4. Gateway is running normally

  5. Execute pkill gateway or kill <gateway_pid>

  6. Approval prompt appears → user approves

  7. Command executes → entire gateway process group crashes

  8. Repeat steps 1-4 → enters infinite crash loop

  9. Inject malicious path pattern via rglob parameter

  10. Skills loader processes the pattern without sanitization

  11. Attacker reads arbitrary files outside skills directory

Expected Behavior

Gateway should connect to Feishu reliably in single-worker mode. If multi-worker mode is used, each worker should use an isolated Feishu App ID to avoid connection conflicts. Dangerous commands should check if the target process is critical before execution. If a destructive command would kill the only running gateway instance, Hermes should warn the user and require explicit confirmation that they understand the risk — not just approve the command blindly. rglob should only access files within the designated skills directory. Arbitrary path injection should be blocked with path validation and allowlist filtering.

Actual Behavior

Multiple workers start simultaneously. Only one worker successfully holds the Feishu WebSocket connection. All other workers fail with connection errors and hang indefinitely. If the worker holding the connection is killed (even accidentally), the entire process group collapses — Gateway becomes unavailable. When user executes pkill/kill on gateway processes:

  • Approval prompt appears, user approves
  • Command executes successfully
  • Gateway crashes immediately
  • User approves again to proceed
  • Same destructive command runs again
  • Gateway crashes again → Infinite approval loop, Gateway cannot stay alive Malicious path patterns passed to rglob are not sanitized. Attacker can traverse directories outside skills folder and read sensitive files (e.g., configs, credentials, keys).

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

N/A (CLI only)

Debug Report

Debug Report	https://paste.rs/jUZeK
agent.log	https://paste.rs/O0BcK
gateway.log	https://paste.rs/7AnhX

Operating System

windows10/WSL/Ubuntu 24.04

Python Version

Python 3.11.0rc1

Hermes Version

hermes v0.12.0 (2026-04-30)

Additional Logs / Traceback (optional)

Debug Report: https://paste.rs/jUZeK
agent.log:   https://paste.rs/O0BcK  
gateway.log:  https://paste.rs/7AnhX

---
System Info:
- Hermes: v0.12.0 (2026-04-30)
- Python: 3.11.0rc1
- OS: WSL2 Ubuntu 22.04
- Feishu: WebSocket mode

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

To fix the issues, consider running the Hermes gateway in single-worker mode, sanitizing rglob input paths, and implementing checks for critical processes before executing destructive commands.

Guidance

  • Run the Hermes gateway in single-worker mode by default to avoid Feishu connection conflicts.
  • Sanitize and validate all rglob input paths to prevent path injection vulnerabilities.
  • Implement checks to warn users before executing destructive commands that could crash the gateway.
  • Use isolated Feishu App IDs for each worker in multi-worker mode.
  • Review the provided debug reports and logs to identify specific error patterns.

Example

No code snippet is provided due to the nature of the issue, but an example of sanitizing rglob input paths could involve using a whitelist of allowed paths and patterns.

Notes

The fixes proposed are based on the information provided in the issue and may require additional modifications or testing to ensure compatibility and effectiveness.

Recommendation

Apply workarounds, such as running in single-worker mode and sanitizing rglob paths, as the issues described are critical and impact the stability and security of the Hermes gateway.

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 [Bug]: Gateway: --replace multi-worker causes Feishu WebSocket failure [1 comments, 2 participants]