hermes - 💡(How to fix) Fix Bug: plugin-registered TUI slash commands can run in slash-worker split-brain [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#18993Fetched 2026-05-03 04:53:01
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

In the new hermes --tui, plugin-registered slash commands can execute in a separate tui_gateway.slash_worker subprocess instead of the live TUI gateway/agent process. This can give stale, unbound, or otherwise incorrect results for plugin commands that depend on live process/session/agent state.

/lcm is a concrete example, but the issue is not LCM-specific. It applies to slash commands registered by plugins through PluginContext.register_command() when they are not implemented as native TUI commands.

Root Cause

The TUI has three relevant paths:

  • Native TUI commands are found by findSlashCommand() and handled in the TypeScript TUI layer.
  • Skill commands and pending-input commands are explicitly prevented from going through the slash worker.
  • Generic plugin-registered slash commands are not excluded from slash.exec, so they run in the slash-worker subprocess if HermesCLI.process_command() succeeds there.

command.dispatch does have a plugin-command path using get_plugin_command_handler(), but the frontend only falls back to command.dispatch when slash.exec fails. For a valid plugin command, slash.exec usually succeeds, so the server-process dispatch path is never reached.

Fix Action

Fix / Workaround

command.dispatch does have a plugin-command path using get_plugin_command_handler(), but the frontend only falls back to command.dispatch when slash.exec fails. For a valid plugin command, slash.exec usually succeeds, so the server-process dispatch path is never reached.

  • Detect plugin-registered commands before slash.exec and dispatch them through the TUI gateway/server process.
  • Extend slash.exec to reject plugin commands the same way it rejects skill/pending-input commands, forcing command.dispatch or a dedicated plugin-command RPC path.
  • Pass explicit live session/agent/plugin context into plugin command handlers, and document which plugin command APIs are safe to run out-of-process.

Code Example

python -m tui_gateway.slash_worker --session-key <session>
RAW_BUFFERClick to expand / collapse

Hermes TUI: plugin-registered slash commands run in slash-worker split-brain

Summary

In the new hermes --tui, plugin-registered slash commands can execute in a separate tui_gateway.slash_worker subprocess instead of the live TUI gateway/agent process. This can give stale, unbound, or otherwise incorrect results for plugin commands that depend on live process/session/agent state.

/lcm is a concrete example, but the issue is not LCM-specific. It applies to slash commands registered by plugins through PluginContext.register_command() when they are not implemented as native TUI commands.

Reproduction

  1. Install or enable a plugin that registers an in-session slash command via register_command(). Example: enable the hermes-lcm plugin with /lcm registration.
  2. Start hermes --tui.
  3. Use the session normally so the live TUI agent has plugin/runtime state.
  4. Run the plugin slash command in the TUI, e.g. /lcm or /lcm doctor.

Expected

Plugin-registered slash commands should execute against the live TUI session context, or should receive explicit live session/agent/plugin state equivalent to the active TUI agent.

For the LCM example, /lcm should report diagnostics for the active TUI agent’s live LCM engine/session.

Actual

Unknown TUI slash commands are first sent to slash.exec in ui-tui/src/app/createSlashHandler.ts. slash.exec runs them through a persistent tui_gateway.slash_worker subprocess:

python -m tui_gateway.slash_worker --session-key <session>

That worker constructs its own HermesCLI instance and processes the command there. Because plugin commands are registered into each process’s plugin manager, a plugin slash command may execute against the worker’s plugin/runtime objects rather than the live TUI gateway/agent objects.

For /lcm, this can show stale or unbound diagnostics such as “no active Hermes session initialized LCM in this process,” even though the live TUI agent’s LCM tools and context handling are working.

Root cause

The TUI has three relevant paths:

  • Native TUI commands are found by findSlashCommand() and handled in the TypeScript TUI layer.
  • Skill commands and pending-input commands are explicitly prevented from going through the slash worker.
  • Generic plugin-registered slash commands are not excluded from slash.exec, so they run in the slash-worker subprocess if HermesCLI.process_command() succeeds there.

command.dispatch does have a plugin-command path using get_plugin_command_handler(), but the frontend only falls back to command.dispatch when slash.exec fails. For a valid plugin command, slash.exec usually succeeds, so the server-process dispatch path is never reached.

Suggested fix

Treat plugin-registered slash commands as first-class TUI/gateway commands instead of generic slash-worker commands. Possible approaches:

  • Detect plugin-registered commands before slash.exec and dispatch them through the TUI gateway/server process.
  • Extend slash.exec to reject plugin commands the same way it rejects skill/pending-input commands, forcing command.dispatch or a dedicated plugin-command RPC path.
  • Pass explicit live session/agent/plugin context into plugin command handlers, and document which plugin command APIs are safe to run out-of-process.

Stateless plugin commands may appear to work today, but plugins that depend on process-local or live session state can return misleading results under the current split-brain path.

extent analysis

TL;DR

Treat plugin-registered slash commands as first-class TUI/gateway commands to ensure they execute against the live TUI session context.

Guidance

  • Identify plugin-registered slash commands before slash.exec and dispatch them through the TUI gateway/server process to maintain live session state.
  • Consider extending slash.exec to reject plugin commands, forcing command.dispatch or a dedicated plugin-command RPC path to handle them correctly.
  • When implementing a fix, prioritize plugin commands that depend on live session or process-local state to prevent misleading results.
  • Review the get_plugin_command_handler() path in command.dispatch to ensure it correctly handles plugin-registered slash commands.

Example

No code snippet is provided as the issue description does not include specific code that needs modification, but rather suggests architectural changes to how plugin-registered slash commands are handled.

Notes

The suggested fix approaches require careful consideration of the trade-offs between handling plugin-registered commands in-process versus out-of-process, and ensuring that live session state is correctly propagated to command handlers.

Recommendation

Apply a workaround by detecting plugin-registered commands before slash.exec and dispatching them through the TUI gateway/server process, as this approach directly addresses the issue of split-brain execution and ensures live session state is maintained.

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: plugin-registered TUI slash commands can run in slash-worker split-brain [1 participants]