Skip to content

feat: add Hermes Agent support — configs, plugin, README#425

Open
tayuLuc wants to merge 1 commit intomksglu:nextfrom
tayuLuc:feat/hermes-agent-support
Open

feat: add Hermes Agent support — configs, plugin, README#425
tayuLuc wants to merge 1 commit intomksglu:nextfrom
tayuLuc:feat/hermes-agent-support

Conversation

@tayuLuc
Copy link
Copy Markdown

@tayuLuc tayuLuc commented May 4, 2026

What / Why / How

Adds Hermes Agent support to context-mode — the first upstream integration for this platform.

What: Configuration files, plugin, and README updates to support context-mode on Hermes Agent.

Why: Hermes Agent is an open-source AI agent framework by Nous Research with 130k+ GitHub stars, running across CLI, Telegram, Discord, and other platforms. It natively supports MCP servers and has a Python plugin system — making it a natural fit for context-mode.

How:

  • configs/hermes/AGENTS.md — routing rules for Hermes (same pattern as OpenClaw/OpenCode configs)
  • plugins/context-saver/ — Hermes Agent plugin with pre_tool_call and pre_llm_call hooks that enforce context-mode routing
  • README updates — Hermes added to the platform table and install section

No dependency on context-mode's npm package — the plugin uses Hermes' native execute_code as the sandbox, making it zero-dependency.

Affected platforms

  • Claude Code
  • Cursor
  • VS Code Copilot (GitHub Copilot)
  • JetBrains Copilot
  • Gemini CLI
  • Qwen Code
  • OpenCode
  • KiloCode
  • Codex CLI
  • OpenClaw (Pi Agent)
  • Pi
  • Kiro
  • Antigravity
  • Zed
  • Hermes Agent (new)
  • All platforms

Test plan

  1. Install context-mode as MCP server: hermes mcp add context-mode -- npx -y context-mode
  2. Copy plugin to ~/.hermes/plugins/context-saver/
  3. Enable in config: plugins.enabled: [context-saver]
  4. Restart: hermes gateway restart
  5. Verify pre_tool_call blocks curl — model redirects to ctx_execute
  6. Verify ctx stats / ctx doctor utility commands work via MCP

Checklist

  • Tests added/updated (TDD: red → green)
  • npm test passes (no JS/TS changes — Python plugin only)
  • npm run typecheck passes
  • Docs updated if needed (README, platform-support.md)
  • No Windows path regressions (forward slashes only)
  • Targets next branch (unless hotfix)
Cross-platform notes

The plugin is pure Python 3.9+ — no native dependencies. Hermes Agent runs on macOS, Linux, and Windows (WSL).

@tayuLuc tayuLuc force-pushed the feat/hermes-agent-support branch 2 times, most recently from 07de05b to a4b5daa Compare May 4, 2026 23:49
@tayuLuc tayuLuc closed this May 4, 2026
@tayuLuc tayuLuc force-pushed the feat/hermes-agent-support branch from a4b5daa to 41f6579 Compare May 4, 2026 23:56
@tayuLuc tayuLuc reopened this May 5, 2026
@mksglu
Copy link
Copy Markdown
Owner

mksglu commented May 5, 2026

Why is it py?

@tayuLuc
Copy link
Copy Markdown
Author

tayuLuc commented May 5, 2026

Why is it py?

It's dictated by the Hermes runtime.

Hermes Agent is a Python-based application, and its plugin system (pre_tool_call, pre_llm_call, etc.) is designed to be Python modules loaded directly into its execution environment. The official Hermes documentation for building plugins exclusively uses the __init__.py + plugin.yaml Python pattern.

To hook into the agent's tool selection process (e.g., intercepting a curl call before it happens and telling the model to use ctx_execute instead), the hook must run in the Hermes Python process.

This is analogous to the existing plugins in this repo: Cursor's .claude-plugin/ and OpenClaw's .openclaw-plugin/ are written in JavaScript/TypeScript because they run in the Node.js / VS Code environments. .hermes-plugin/ is Python because it runs in the Hermes Python runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants