hermes - 💡(How to fix) Fix [Bug]: Multiple TUI sessions — only first session gets tools; subsequent sessions lose core toolsets (only honcho remains) [1 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#17777Fetched 2026-05-01 05:55:55
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

Root Cause

Suspected Root Cause

Fix Action

Workaround

  • Use HERMES_TUI_TOOLSETS=hermes-cli env var to bypass automatic resolution
  • Use separate profiles (--profile) for each TUI session
  • Use CLI (hermes chat) instead of TUI for parallel sessions
RAW_BUFFERClick to expand / collapse

Bug Description

When running multiple hermes --tui sessions simultaneously, only the first session gets the full set of tools (terminal, web, file, browser, etc.). Subsequent TUI sessions either get no tools at all (just connect to the LLM as a plain chat) or only have honcho plugin tools (honcho_profile, honcho_search, etc.) while missing all core hermes-cli tools.

Meanwhile, a simultaneously running Weixin (wechat) session via the gateway has all tools working correctly — the issue appears specific to TUI multi-session.

Steps to Reproduce

  1. Start the first TUI session: hermes --tui
  2. In the first session, verify tools are available (e.g., /tools or ask a question that needs terminal)
  3. In another terminal, start a second TUI: hermes --tui
  4. In the second session, check available tools — they are missing or reduced to honcho only
  5. (Optional) Start a Weixin conversation through the gateway — that session still has full tools

Expected Behavior

All TUI sessions should have identical tool availability, matching the configured toolsets: [hermes-cli] in config.yaml.

Actual Behavior

Only the first TUI session gets the full toolset. Later sessions are degraded.

A concrete example observed in the affected session:

"Current session I only have honcho series tools (and they failed to init), no bash / curl / execute_code, can't call Github API。"

Architecture Context

All TUI sessions run inside a single tui_gateway process (tui_gateway/entry.py). Each TUI window creates a new AIAgent via _make_agent() in tui_gateway/server.py:1735, which calls _load_enabled_toolsets()_get_platform_tools(cfg, "cli", ...).

The gateway sessions (Weixin, Telegram, etc.) use gateway/platforms/api_server.py:_create_agent() — a different code path that works correctly.

Suspected Root Cause

_load_enabled_toolsets() at tui_gateway/server.py:864 resolves toolsets from HERMES_TUI_TOOLSETS env var or platform_toolsets.cli in config. When hermes-cli (a composite toolset) is not properly resolved in a subsequent call within the same process, only plugin-registered toolsets (like honcho) remain available, while core tools (terminal, web, file, etc.) are stripped.

Possible mechanisms:

  • Tool registry state corruption: get_tool_definitions() in model_tools.py:271 has a _tool_defs_cache keyed by (frozenset(enabled_toolsets), registry._generation, cfg_fp). If the second agent build passes different/incomplete enabled_toolsets, a wrong cache entry is created.
  • Race condition: _load_cfg() has a global _cfg_cache with _cfg_lock — concurrent agent builds within the same process may race on config reads.
  • Composite toolset resolution: _get_platform_tools() at hermes_cli/tools_config.py:771 resolves composite toolsets (like hermes-cli) to individual toolsets. A failure in this resolution path would leave only plugin toolsets, matching the "honcho-only" symptom.

Environment

  • Hermes Agent: v0.11.0 (2026.4.23)
  • OS: Linux (WSL2)
  • Config: toolsets: [hermes-cli] in config.yaml
  • Profiles: single profile (default), DeepSeek v4 Pro
  • TUI gateway: single process, multiple sessions

Workaround

  • Use HERMES_TUI_TOOLSETS=hermes-cli env var to bypass automatic resolution
  • Use separate profiles (--profile) for each TUI session
  • Use CLI (hermes chat) instead of TUI for parallel sessions

extent analysis

TL;DR

Setting the HERMES_TUI_TOOLSETS environment variable to hermes-cli before starting a TUI session may resolve the issue of missing tools in subsequent sessions.

Guidance

  • Verify that the HERMES_TUI_TOOLSETS environment variable is not set before starting the first TUI session, as this might influence the behavior of subsequent sessions.
  • Try using separate profiles (--profile) for each TUI session to isolate their configurations and potentially avoid toolset resolution conflicts.
  • Consider using the CLI (hermes chat) instead of TUI for parallel sessions, as it does not exhibit the same issue.
  • Review the _load_enabled_toolsets() function in tui_gateway/server.py to understand how toolsets are resolved and how this might lead to the observed behavior in subsequent TUI sessions.

Example

No specific code snippet is provided due to the complexity of the issue and the need for a thorough understanding of the Hermes system's internal workings.

Notes

The issue seems to be related to how toolsets are resolved and cached within the Hermes system, particularly when multiple TUI sessions are run concurrently. The provided workarounds aim to bypass or mitigate this issue but may not address the root cause.

Recommendation

Apply the workaround by setting HERMES_TUI_TOOLSETS=hermes-cli before starting a TUI session, as this directly addresses the symptom of missing tools in subsequent sessions by ensuring that the hermes-cli toolset is explicitly specified.

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]: Multiple TUI sessions — only first session gets tools; subsequent sessions lose core toolsets (only honcho remains) [1 participants]