hermes - ✅(Solved) Fix Feature: Allow custom descriptions for Telegram bot command menu (i18n support) [1 pull requests, 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#17091Fetched 2026-04-29 06:37:16
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×4commented ×1cross-referenced ×1

Error Message

def telegram_bot_commands() -> list[tuple[str, str]]: overrides = _resolve_config_gates() desc_overrides = {} try: from hermes_cli.config import read_raw_config cfg = read_raw_config() desc_overrides = cfg.get("telegram", {}).get("command_descriptions", {}) or {} except Exception: pass result = [] for cmd in COMMAND_REGISTRY: if not _is_gateway_available(cmd, overrides): continue tg_name = _sanitize_telegram_name(cmd.name) if tg_name: desc = desc_overrides.get(cmd.name, cmd.description) result.append((tg_name, desc)) ...

Fix Action

Fixed

PR fix notes

PR #17134: fix: resolve 4 identified issues [automated]

Description (problem / solution / changelog)

Fixes #16974, #17091, #17009, #17049

Changed files

  • Dockerfile (modified, +2/-1)
  • agent/context_compressor.py (modified, +462/-51)
  • agent/transports/chat_completions.py (modified, +11/-0)
  • cli.py (modified, +13/-2)
  • cron/scheduler.py (modified, +5/-6)
  • gateway/platforms/discord.py (modified, +20/-7)
  • gateway/platforms/feishu.py (modified, +26/-7)
  • gateway/run.py (modified, +90/-31)
  • gateway/status.py (modified, +8/-1)
  • hermes_cli/commands.py (modified, +22/-1)
  • hermes_cli/config.py (modified, +1/-1)
  • hermes_cli/copilot_auth.py (modified, +1/-1)
  • hermes_cli/gateway.py (modified, +4/-0)
  • hermes_cli/main.py (modified, +94/-5)
  • hermes_cli/web_server.py (modified, +1/-1)
  • model_tools.py (modified, +44/-13)
  • run_agent.py (modified, +326/-55)
  • skills/red-teaming/godmode/scripts/load_godmode.py (modified, +9/-8)
  • tests/agent/test_context_compressor.py (modified, +389/-0)
  • tests/gateway/test_compress_command.py (modified, +49/-0)
  • tests/run_agent/test_413_compression.py (modified, +81/-1)
  • tests/run_agent/test_compression_boundary_hook.py (modified, +42/-0)
  • tests/run_agent/test_run_agent.py (modified, +100/-13)
  • tools/session_search_tool.py (modified, +2/-2)
  • tui_gateway/server.py (modified, +4/-3)
  • ui-tui/src/app/turnController.ts (modified, +1/-1)

Code Example

/new: Start a new session (fresh session ID + history)
/retry: Retry the last message (resend to agent)
/undo: Remove the last user/assistant exchange
...

---

telegram:
  command_descriptions:
    new: 开始新会话
    retry: 重试上一条消息
    undo: 撤销最后一组对话
    ...

---

def telegram_bot_commands() -> list[tuple[str, str]]:
    overrides = _resolve_config_gates()
    desc_overrides = {}
    try:
        from hermes_cli.config import read_raw_config
        cfg = read_raw_config()
        desc_overrides = cfg.get("telegram", {}).get("command_descriptions", {}) or {}
    except Exception:
        pass
    result = []
    for cmd in COMMAND_REGISTRY:
        if not _is_gateway_available(cmd, overrides):
            continue
        tg_name = _sanitize_telegram_name(cmd.name)
        if tg_name:
            desc = desc_overrides.get(cmd.name, cmd.description)
            result.append((tg_name, desc))
    ...
RAW_BUFFERClick to expand / collapse

Problem

The Telegram bot command menu (shown when users type /) displays all command descriptions in English. For non-English users (e.g., Chinese), this creates a language barrier — they can see the commands but can't understand what they do.

Current behavior:

/new: Start a new session (fresh session ID + history)
/retry: Retry the last message (resend to agent)
/undo: Remove the last user/assistant exchange
...

Proposed Solution

Add a config option to override Telegram bot command descriptions:

telegram:
  command_descriptions:
    new: 开始新会话
    retry: 重试上一条消息
    undo: 撤销最后一组对话
    ...

Implementation

The telegram_bot_commands() function in hermes_cli/commands.py already iterates through COMMAND_REGISTRY. Adding config-based description overrides would be minimal:

def telegram_bot_commands() -> list[tuple[str, str]]:
    overrides = _resolve_config_gates()
    desc_overrides = {}
    try:
        from hermes_cli.config import read_raw_config
        cfg = read_raw_config()
        desc_overrides = cfg.get("telegram", {}).get("command_descriptions", {}) or {}
    except Exception:
        pass
    result = []
    for cmd in COMMAND_REGISTRY:
        if not _is_gateway_available(cmd, overrides):
            continue
        tg_name = _sanitize_telegram_name(cmd.name)
        if tg_name:
            desc = desc_overrides.get(cmd.name, cmd.description)
            result.append((tg_name, desc))
    ...

Benefits

  • Non-breaking: Falls back to English when no overrides are configured
  • User-configurable: Users can customize any command description
  • Minimal code change: ~10 lines added to telegram_bot_commands()
  • Community-driven: Users can share their localization configs

Related Issues

  • #12954 - Chinese Localization for Hermes Agent CLI
  • #16546 - i18n / Multi-Language Support for System Messages
  • #12375 - Add i18n / Multi-language UI support for CLI interface

Additional Context

I've already implemented this locally and it works well. The Telegram menu now shows Chinese descriptions after adding the config. Would be happy to submit a PR if the maintainers are interested.

extent analysis

TL;DR

To fix the language barrier issue in the Telegram bot command menu, add a config option to override command descriptions with translations.

Guidance

  • Review the proposed solution and implementation in the hermes_cli/commands.py file to understand how the config-based description overrides would work.
  • Test the implementation by adding the suggested config options for non-English languages, such as Chinese, to verify that the command descriptions are correctly overridden.
  • Consider submitting a PR with the proposed changes to add official support for customizable command descriptions.
  • Evaluate the related issues (#12954, #16546, #12375) to ensure that the proposed solution aligns with the overall i18n and multi-language support goals.

Example

The provided code snippet in hermes_cli/commands.py demonstrates how to implement the config-based description overrides:

desc_overrides = cfg.get("telegram", {}).get("command_descriptions", {}) or {}
...
desc = desc_overrides.get(cmd.name, cmd.description)

This code retrieves the config overrides and uses them to determine the command description.

Notes

The proposed solution seems minimal and non-breaking, but it's essential to review and test it thoroughly to ensure it works as expected for all languages and use cases.

Recommendation

Apply the workaround by adding the proposed config option to override command descriptions, as it provides a flexible and user-configurable solution for supporting multiple languages.

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 - ✅(Solved) Fix Feature: Allow custom descriptions for Telegram bot command menu (i18n support) [1 pull requests, 1 comments, 2 participants]