hermes - 💡(How to fix) Fix `hermes config set` does not write to `.env`, causing Discord authorization to silently fail

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 config set DISCORD_ALLOWED_USERS <value> writes to config.yaml, but the Discord gateway authorization check reads from .env. This causes a silent mismatch where the user believes the setting is applied but the gateway rejects messages from the newly added user with no clear error to the end user.

Error Message

hermes config set DISCORD_ALLOWED_USERS <value> writes to config.yaml, but the Discord gateway authorization check reads from .env. This causes a silent mismatch where the user believes the setting is applied but the gateway rejects messages from the newly added user with no clear error to the end user. hermes config set should detect which file is the authoritative source for a given key and write there — or write to both files to keep them in sync. At minimum, hermes config set should warn the user when a key is set in config.yaml but the runtime reads it from .env.

Root Cause

hermes config set writes exclusively to config.yaml. However, the Discord platform adapter reads DISCORD_ALLOWED_USERS (and likely other gateway-related keys) from .env. These two files are not synchronized by hermes config set, creating a silent split-brain configuration state.

Fix Action

Workaround

Manually update .env directly:

sed -i 's/^DISCORD_ALLOWED_USERS=.*/DISCORD_ALLOWED_USERS=ID1,ID2/' ~/.hermes/.env
hermes gateway restart

Code Example

hermes config set DISCORD_ALLOWED_USERS "ID1,ID2"

---

grep DISCORD_ALLOWED_USERS ~/.hermes/config.yaml
   # → DISCORD_ALLOWED_USERS: ID1,ID2

---

hermes gateway restart

---

WARNING: Unauthorized slash attempt: user=<name> id=<ID2> ... reason='user not in DISCORD_ALLOWED_USERS / DISCORD_ALLOWED_ROLES'

---

DISCORD_ALLOWED_USERS=ID1

---

sed -i 's/^DISCORD_ALLOWED_USERS=.*/DISCORD_ALLOWED_USERS=ID1,ID2/' ~/.hermes/.env
hermes gateway restart
RAW_BUFFERClick to expand / collapse

hermes config set does not write to .env, causing Discord authorization to silently fail

Summary

hermes config set DISCORD_ALLOWED_USERS <value> writes to config.yaml, but the Discord gateway authorization check reads from .env. This causes a silent mismatch where the user believes the setting is applied but the gateway rejects messages from the newly added user with no clear error to the end user.

Steps to Reproduce

  1. Add a new Discord user ID via hermes config set:
    hermes config set DISCORD_ALLOWED_USERS "ID1,ID2"
  2. Confirm the value appears in config.yaml:
    grep DISCORD_ALLOWED_USERS ~/.hermes/config.yaml
    # → DISCORD_ALLOWED_USERS: ID1,ID2
  3. Restart the gateway:
    hermes gateway restart
  4. Have the new user (ID2) send a message to the bot on Discord.

Expected Behavior

The new user (ID2) should be authorized and receive a response.

Actual Behavior

The gateway rejects the message silently from the new user's perspective. The server-side log shows:

WARNING: Unauthorized slash attempt: user=<name> id=<ID2> ... reason='user not in DISCORD_ALLOWED_USERS / DISCORD_ALLOWED_ROLES'

Meanwhile, ~/.hermes/.env still contains only the original value:

DISCORD_ALLOWED_USERS=ID1

The gateway reads DISCORD_ALLOWED_USERS from .env at runtime, not from config.yaml.

Root Cause

hermes config set writes exclusively to config.yaml. However, the Discord platform adapter reads DISCORD_ALLOWED_USERS (and likely other gateway-related keys) from .env. These two files are not synchronized by hermes config set, creating a silent split-brain configuration state.

Workaround

Manually update .env directly:

sed -i 's/^DISCORD_ALLOWED_USERS=.*/DISCORD_ALLOWED_USERS=ID1,ID2/' ~/.hermes/.env
hermes gateway restart

Suggested Fix

hermes config set should detect which file is the authoritative source for a given key and write there — or write to both files to keep them in sync. At minimum, hermes config set should warn the user when a key is set in config.yaml but the runtime reads it from .env.

Environment

  • Hermes version: 2026.5.27 (27ae826)
  • OS: Ubuntu (Linux)
  • Platform: Discord 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 `hermes config set` does not write to `.env`, causing Discord authorization to silently fail