hermes - 💡(How to fix) Fix [Bug]: Nix package omits locales, causing raw i18n keys in gateway command replies

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…

Root Cause

This appears to happen because the Nix package installs agent/i18n.py into the sealed Python environment, but the repo-root locales/ directory is not installed next to it.

Fix Action

Workaround

I worked around this in my NixOS config by adding an extra Python package that monkey-patches agent.i18n._locales_dir() to point at the flake source locales/ directory, and ensuring that patch is first in the container PYTHONPATH.

After that, the same runtime check resolved correctly:

locales /nix/store/...-source/locales True
status 📊 **Hermes Gateway Status**
reset ✨ Session reset! Starting fresh.

Code Example

/new
gateway.reset.header_default

Model: gpt-5.4-mini
Provider: openai-codex
Context: 272K tokens (detected)gateway.reset.tip

/status
gateway.status.header

gateway.status.session_id
gateway.status.created
gateway.status.last_activity
gateway.status.tokens
gateway.status.agent_running

gateway.status.platforms

---

return Path(__file__).resolve().parent.parent / "locales"

---

Session reset! Starting fresh.
📊 **Hermes Gateway Status**

---

gateway.reset.header_default
gateway.reset.tip
gateway.status.header
gateway.status.session_id

---

i18n /nix/store/...-hermes-agent-env/lib/python3.12/site-packages/agent/i18n.py
locales /nix/store/...-hermes-agent-0.13.0/lib/python3.12/site-packages/locales False
status gateway.status.header

---

[tool.setuptools.package-data]
hermes_cli = ["web_dist/**/*"]
gateway = ["assets/**/*"]

---

graft skills
graft optional-skills
global-exclude __pycache__
global-exclude *.py[cod]

---

locales /nix/store/...-source/locales True
status 📊 **Hermes Gateway Status**
reset ✨ Session reset! Starting fresh.
RAW_BUFFERClick to expand / collapse

Bug Description

In a NixOS module/container-mode install, Hermes gateway command replies can show raw i18n key paths instead of user-facing text.

Observed in Telegram:

/new
gateway.reset.header_default

◆ Model: gpt-5.4-mini
◆ Provider: openai-codex
◆ Context: 272K tokens (detected)gateway.reset.tip

/status
gateway.status.header

gateway.status.session_id
gateway.status.created
gateway.status.last_activity
gateway.status.tokens
gateway.status.agent_running

gateway.status.platforms

This appears to happen because the Nix package installs agent/i18n.py into the sealed Python environment, but the repo-root locales/ directory is not installed next to it.

agent/i18n.py resolves catalogs with:

return Path(__file__).resolve().parent.parent / "locales"

In the Nix sealed env this points to a missing site-packages-level locales/ directory, so _load_catalog() returns {} and t() falls back to returning the key itself.

Steps to Reproduce

  1. Install Hermes via the NixOS module.
  2. Enable container mode.
  3. Configure Telegram gateway with TELEGRAM_BOT_TOKEN and TELEGRAM_ALLOWED_USERS.
  4. Start hermes-agent.service.
  5. Send /new or /status to the Telegram bot.

Expected Behavior

Telegram command replies should render localized/default English strings, for example:

✨ Session reset! Starting fresh.
📊 **Hermes Gateway Status**

Actual Behavior

Telegram command replies render raw i18n keys such as:

gateway.reset.header_default
gateway.reset.tip
gateway.status.header
gateway.status.session_id

Affected Component

Setup / Installation

Messaging Platform

Telegram

Debug / Investigation Notes

Runtime check inside the container showed:

i18n /nix/store/...-hermes-agent-env/lib/python3.12/site-packages/agent/i18n.py
locales /nix/store/...-hermes-agent-0.13.0/lib/python3.12/site-packages/locales False
status gateway.status.header

The upstream source does contain the catalog entries in locales/en.yaml, including the gateway reset/status strings.

However, current packaging metadata does not appear to include locales/:

[tool.setuptools.package-data]
hermes_cli = ["web_dist/**/*"]
gateway = ["assets/**/*"]

MANIFEST.in currently includes:

graft skills
graft optional-skills
global-exclude __pycache__
global-exclude *.py[cod]

There is no graft locales or equivalent package-data entry.

This may be hidden in Docker/dev/editable installs because the full source tree exists at runtime, so locales/ is present next to agent/. In the Nix sealed environment, only installed package files are available.

Workaround

I worked around this in my NixOS config by adding an extra Python package that monkey-patches agent.i18n._locales_dir() to point at the flake source locales/ directory, and ensuring that patch is first in the container PYTHONPATH.

After that, the same runtime check resolved correctly:

locales /nix/store/...-source/locales True
status 📊 **Hermes Gateway Status**
reset ✨ Session reset! Starting fresh.

Proposed Fix

Package locales/ as a real runtime resource and load it from a packaged location.

Possible approaches:

  1. Move locales/ under a Python package and load it via importlib.resources.
  2. Add the current repo-root locales/ directory to source/package data and ensure the Nix sealed environment installs it at the path expected by agent/i18n.py.
  3. In the Nix package, explicitly copy locales/ into the sealed Python environment or expose a deterministic locales path to agent.i18n.

Operating System

NixOS unstable

Python Version

3.12.13

Hermes Version

0.13.0

Additional Context

Using the upstream NixOS module with:

  • services.hermes-agent.container.enable = true
  • services.hermes-agent.settings.model.provider = "openai-codex"
  • services.hermes-agent.settings.model.default = "gpt-5.4-mini"

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]: Nix package omits locales, causing raw i18n keys in gateway command replies