hermes - 💡(How to fix) Fix bug(gateway): HERMES_IGNORE_RULES env var ignored by gateway/run.py (Telegram sessions)

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…

HERMES_IGNORE_RULES=1 in ~/.hermes/.env has no effect on Telegram gateway sessions. Memory, user profile, AGENTS.md, .cursorrules, and preloaded skills are still injected into the system prompt.

Root Cause

gateway/run.py creates AIAgent(...) in two main places (lines ~11419 and ~16283) without checking HERMES_IGNORE_RULES. The env var is only respected by:

  • cli.py (line 2809)
  • tui_gateway/server.py (lines 1927-1928)

Fix Action

Workaround

Patch gateway/run.py manually — add to both AIAgent() call sites:

skip_context_files=is_truthy_value(os.environ.get("HERMES_IGNORE_RULES")),
skip_memory=is_truthy_value(os.environ.get("HERMES_IGNORE_RULES")),

is_truthy_value is already imported from utils.

Code Example

skip_context_files=is_truthy_value(os.environ.get("HERMES_IGNORE_RULES")),
skip_memory=is_truthy_value(os.environ.get("HERMES_IGNORE_RULES")),
RAW_BUFFERClick to expand / collapse

Summary

HERMES_IGNORE_RULES=1 in ~/.hermes/.env has no effect on Telegram gateway sessions. Memory, user profile, AGENTS.md, .cursorrules, and preloaded skills are still injected into the system prompt.

Root Cause

gateway/run.py creates AIAgent(...) in two main places (lines ~11419 and ~16283) without checking HERMES_IGNORE_RULES. The env var is only respected by:

  • cli.py (line 2809)
  • tui_gateway/server.py (lines 1927-1928)

Steps to Reproduce

  1. Set HERMES_IGNORE_RULES=1 in ~/.hermes/.env
  2. Restart the gateway (hermes gateway restart)
  3. Send a message via Telegram
  4. Observe that memory, user profile, and context files are still present in the system prompt

Expected Behavior

When HERMES_IGNORE_RULES=1 is set, gateway sessions should pass skip_context_files=True and skip_memory=True to AIAgent(), consistent with CLI and TUI behavior.

Workaround

Patch gateway/run.py manually — add to both AIAgent() call sites:

skip_context_files=is_truthy_value(os.environ.get("HERMES_IGNORE_RULES")),
skip_memory=is_truthy_value(os.environ.get("HERMES_IGNORE_RULES")),

is_truthy_value is already imported from utils.

Related

  • #6731 (Feishu variant — SOUL.md not loaded)
  • #28061 (PR preserving SOUL identity across isolated runs — does not fix gateway/run.py)
  • #26596

Environment

  • Hermes: latest (git main)
  • Platform: Telegram
  • OS: Linux 6.8.0-117-generic

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): HERMES_IGNORE_RULES env var ignored by gateway/run.py (Telegram sessions)