Repository navigation
Conversation
Hermes Agent (NousResearch) panes now get the same status the Claude Code integration gives: notifications, Needs you on approval/clarify/sudo prompts, working/idle, subagent lines, the prompt log and the diff refresh. - resources/hermes-plugin: a Python Hermes plugin that maps Hermes plugin hooks onto the Claude Code hook events wmux-hook.js already handles. It does nothing outside a wmux pane and never forwards a session id. - hermes-context.ts: installs it to <HERMES_HOME>/plugins/wmux under the Status hooks consent, only if Hermes is installed. It enables the plugin with Hermes's own 'hermes plugins enable', never edits config.yaml, and respects 'hermes plugins disable wmux'. Removal takes back only files that carry the marker. - 'hermes' is an agent kind and Hermes's write_file counts as an edit.
Hermes runs every session in one shared gateway (a managed worker per session), whose environment belongs to whichever pane started it. The plugin read WMUX_SURFACE_ID from that environment, so every Hermes session reported into one unrelated pane. - The plugin now takes the pane from the session's client environment (agent.session_client_env), remembers it per session id for hooks fired off the turn's thread, and routes a delegated child into its parent's pane. A session with no client env (desktop, messaging) reports nothing. The pipe token is read from wmux's token file. - wmux adds the WMUX_* routing names to Hermes's terminal.client_env_passthrough via `hermes config set`, merged with the user's list, and takes them back out on removal. - Hermes pins an admitted plugin's contents, so wmux re-runs `hermes plugins enable wmux` after every update of the plugin files. Without that, an updated plugin is never loaded again. - The plugin is installed into every Hermes profile, since each loads only its own plugins. Verified end to end against a real Hermes gateway: a `hermes chat` in one pane reported SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop and SessionEnd into that pane, while the gateway's own environment named another.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This PR adds a Hermes Agent (NousResearch/hermes-agent) integration. A pane running
hermesgets the same status as a Claude Code pane:delegate_task)How
Hermes has no Claude-style hook file, but its Python plugins can register lifecycle hooks.
resources/hermes-plugin/is a small plugin of wmux's own. It translates Hermes hooks into the Claude Code hook events thatwmux-hook.jsalready handles, so a Hermes pane takes the same path a Claude Code pane does and nothing changes in main or the renderer.on_session_startSessionStartpre_llm_call(main session)UserPromptSubmit(with the prompt)pre_tool_call/post_tool_callPreToolUse/PostToolUse(tool names mapped,tool_call_idastool_use_idso the block retracts per #399)on_human_input_requestNotification(permission_prompt/elicitation_dialog)on_session_endStop, orSubagentStopfor a delegated childon_session_finalizeSessionEndsubagent_startWhich pane: the session's client, not the gateway
Hermes runs every session in one shared gateway (a managed worker per session), whatever terminal
hermeswas typed into. That process's environment belongs to whichever pane started the gateway, soWMUX_SURFACE_IDthere names the wrong pane for every other session.A shell-launched Hermes client sends its allowlisted environment with the session (
agent.session_client_env). The plugin takes the pane from that environment on every hook, and remembers it per session id for hooks that fire off the turn's thread. A delegated child reports into its parent's pane. A session with no client environment (Hermes Desktop, messaging platforms) reports nothing. The pipe token is a credential and never travels, so the plugin reads it from wmux's token file.src/main/hermes-context.tsinstalls the plugin under the Status hooks consent (agent-integration.ts, #132). The rules it follows:HERMES_HOMEif absolute, otherwise%LOCALAPPDATA%\hermes(~/.hermeselsewhere). It installs into the root profile and every named profile (profiles/<name>/), since each profile loads only its own plugins.config.yamlitself. Both config changes go through Hermes's own CLI, resolved by absolute path inside the Hermes home:hermes -p <profile> plugins enable wmux --no-allow-tool-override. This also runs after every update of the plugin files, as a precaution: a plugin that is listed as enabled but never went throughplugins enableis not loaded, and it's unconfirmed whether an update needs re-admitting.hermes -p <profile> config set terminal.client_env_passthrough [...]adds theWMUX_*routing names, merged with the user's own list. None of them is a credential.hermes plugins disable wmux.wmux-plugin-versionmarker. Removal takes back only files that carry it, and leaves alone a same-named plugin of the user's.claude --resume).Stop,SessionEndorNotification.Stop.Smaller changes:
hermesis now an agent kind inagent-argv.ts.write_filecounts as an edit tool..gitignorenow ignores__pycache__/and*.pyc.electron-builder.jsonships the plugin directory without bytecode.Session restore for Hermes isn't part of this PR. It can follow the
*-resume.tspattern later.Testing
tests/unit/hermes-context.test.ts(39 tests):enabled/disabledparsing.wmux-hook.js. The process env plays the gateway's and names another pane. Cases:SessionStarthermes chattyped into one pane sent SessionStart → UserPromptSubmit → PreToolUse(Bash) → PostToolUse → Stop → SessionEnd to that pane, while the gateway's ownWMUX_SURFACE_IDnamed another.hermes plugins validate resources/hermes-pluginpasses. Hermes's loader confirms the plugin loads and its declared hooks match what it registers.npm run typecheck,npm run verify:resourcesandnpm run build(NSIS) pass.eslintreports no new problems.npm test: the only failures are inorchestrator-*,orchestration-status-vocabandpowershell-shim. They fail the same way onmasterwithout this change on the test machine, so they depend on the environment.