hermes - ✅(Solved) Fix Chinese Localization for Hermes Agent CLI [1 pull requests, 2 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#13625Fetched 2026-04-22 08:05:14
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×3commented ×2cross-referenced ×1

PR fix notes

PR #12632: fix: add circuit breaker for infinite tool-call loops

Description (problem / solution / changelog)

Summary

Add a circuit breaker mechanism to detect and break infinite tool-call loops in the agent framework.

Problem

When the LLM gets stuck in a retry loop calling the same tool with identical arguments repeatedly, it wastes tokens and never makes progress. This can happen with any tool (terminal, execute_code, etc.).

Solution

Added circuit breaker logic in both execution paths:

  • _invoke_tool() — concurrent execution path
  • _execute_tool_calls_sequential() — sequential execution path

How it works:

  1. Each tool call gets a signature: tool_name:md5(json_args)
  2. Signatures are recorded in order
  3. When the last N calls all have the same signature, the breaker triggers
  4. Returns an error message to the LLM, forcing it to try a different strategy
  5. After triggering, the counter resets so future calls can succeed

Default threshold: 5 consecutive identical calls (configurable via _circuit_breaker_threshold)

Testing

  • 22 existing tests pass
  • Manual testing confirms breaker triggers on repeated identical calls
  • Different tool/args combinations correctly reset the counter
  • After breaker triggers, new calls succeed normally

Changes

  • run_agent.py: Added _consecutive_tool_calls and _circuit_breaker_threshold state
  • run_agent.py: Added circuit breaker logic to _invoke_tool() and _execute_tool_calls_sequential()
  • Error messages in English for upstream compatibility

Changed files

  • ComfyUI-VolcEngine/install.py (added, +85/-0)
  • README.md (modified, +23/-159)
  • README.zh.md (added, +49/-0)
  • agent/context_compressor.py (modified, +1/-1)
  • agent/display.py (modified, +29/-1)
  • agent/file_safety.py (modified, +1/-2)
  • cli.py (modified, +21/-20)
  • discussion_draft.md (added, +73/-0)
  • hermes_cli/banner.py (modified, +96/-18)
  • hermes_cli/commands.py (modified, +112/-8)
  • hermes_cli/config.py (modified, +2/-1)
  • hermes_cli/skin_engine.py (modified, +66/-3)
  • hermes_cli/tips.py (modified, +171/-3)
  • hermes_cli/web_server.py (modified, +26/-3)
  • run_agent.py (modified, +341/-12)
  • scripts/i18n_cli.py (added, +67/-0)
  • scripts/i18n_cli_patch.py (added, +96/-0)
  • tests/agent/test_context_compressor.py (modified, +12/-12)
  • tests/agent/test_minimax_provider.py (modified, +1/-0)
  • tests/gateway/test_agent_cache.py (modified, +5/-1)
  • tests/hermes_cli/conftest.py (added, +13/-0)
  • tests/hermes_cli/test_tips.py (modified, +33/-14)
  • tests/run_agent/test_concurrent_interrupt.py (modified, +4/-1)
  • tests/tools/test_browser_camofox.py (modified, +1/-1)
  • tests/tools/test_file_state_registry.py (modified, +2/-0)
  • tests/tools/test_modal_sandbox_fixes.py (modified, +6/-0)
  • tests/tools/test_zombie_process_cleanup.py (modified, +4/-4)
  • tools/approval.py (modified, +227/-5)
  • tools/browser_tool.py (modified, +6/-2)
  • tools/file_tools.py (modified, +1/-1)
  • tools/i18n.py (added, +155/-0)
  • tools/web_tools.py (modified, +56/-1)
  • ui-tui/src/app/slash/commands/core.ts (modified, +44/-3)
  • ui-tui/src/components/appChrome.tsx (modified, +3/-2)
  • ui-tui/src/content/verbs.ts (modified, +24/-0)
  • ui-tui/src/theme.ts (modified, +38/-0)

Code Example

approvals:
     language: zh  # or 'en' for English

---

# Before
print("🗜️ Compressing {count} messages...")

# After
print(f"🗜️ {format_zh('Compressing {count} messages', count=count)}...")

---

🗜️ 正在压缩 10 条消息...

---

🗜️ Compressing 10 messages...
RAW_BUFFERClick to expand / collapse

Chinese Localization for Hermes Agent CLI

Background

Hermes Agent has a growing user base in China and other Chinese-speaking regions. Many users (including myself) would benefit from having the CLI interface localized to Chinese, especially for:

  • Compression feedback messages
  • Session token usage display
  • Voice mode status
  • Approval prompts and choices
  • Timeout warnings
  • MCP server reload messages

Proposed Solution

I've implemented a lightweight i18n solution in my fork: https://github.com/gzsiang/hermes-agent

Key Features

  1. Configurable language switching via approvals.language in ~/.hermes/config.yaml:

    approvals:
      language: zh  # or 'en' for English
  2. Zero breaking changes - defaults to English when no language is set

  3. Minimal code changes:

    • Added tools/i18n.py (~250 lines) with format_zh() function
    • Wrapped user-facing strings in cli.py with format_zh() calls
    • No external dependencies (pure Python)
  4. Easy to extend - translation dictionary can be expanded for more strings or additional languages

Example Usage

# Before
print("🗜️ Compressing {count} messages...")

# After
print(f"🗜️ {format_zh('Compressing {count} messages', count=count)}...")

Output with language: zh:

🗜️ 正在压缩 10 条消息...

Output with language: en (default):

🗜️ Compressing 10 messages...

Questions for the Maintainers

  1. Is there an official i18n plan for Hermes Agent? If so, I'd love to align my implementation with it.

  2. Would you be open to a PR for this lightweight i18n approach? I'm happy to:

    • Improve code style to match the project
    • Add unit tests
    • Expand translations based on feedback
    • Refactor if there's a preferred pattern
  3. If not ready for i18n, I'll continue maintaining this in my fork for Chinese users. No pressure!

Notes

  • Current implementation only covers high-frequency CLI strings (~20 locations)
  • Translation quality could be improved with native speaker review
  • The approach is designed to be non-intrusive and easy to remove if not adopted

Thanks for building such an amazing tool! 🙏

extent analysis

TL;DR

To add Chinese localization to the Hermes Agent CLI, implement a lightweight i18n solution using a configurable language switch via approvals.language in ~/.hermes/config.yaml.

Guidance

  • Review the proposed i18n solution in the provided fork (https://github.com/gzsiang/hermes-agent) and consider its alignment with any existing official i18n plans for Hermes Agent.
  • Evaluate the implementation's key features, such as configurable language switching and minimal code changes, to determine its suitability for the project.
  • Assess the ease of extending the translation dictionary for additional strings or languages, and consider the potential need for native speaker review to improve translation quality.
  • If adopting the proposed solution, ensure to improve code style, add unit tests, and expand translations based on feedback.

Example

The provided example usage demonstrates how to wrap user-facing strings with format_zh() calls to support Chinese localization:

print(f"🗜️ {format_zh('Compressing {count} messages', count=count)}...")

Notes

The current implementation only covers high-frequency CLI strings (~20 locations), and the approach is designed to be non-intrusive and easy to remove if not adopted.

Recommendation

Apply the proposed workaround by implementing the lightweight i18n solution, as it provides a configurable and extensible approach to supporting Chinese localization in the Hermes Agent CLI.

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 Chinese Localization for Hermes Agent CLI [1 pull requests, 2 comments, 2 participants]