feat: add Hermes agent plugin for RTK command rewriting#1006
Open
ogallotti wants to merge 1 commit intortk-ai:developfrom
Open
feat: add Hermes agent plugin for RTK command rewriting#1006ogallotti wants to merge 1 commit intortk-ai:developfrom
ogallotti wants to merge 1 commit intortk-ai:developfrom
Conversation
Add a Python plugin for Hermes (AI coding agent) that transparently rewrites terminal commands to RTK equivalents via the pre_tool_call lifecycle hook, achieving 60-90% LLM token savings. Plugin structure follows Hermes conventions: - hermes/plugin.yaml — manifest declaring pre_tool_call hook - hermes/__init__.py — thin delegate to `rtk rewrite` - hermes/README.md — installation, architecture, usage docs - hermes/test_rtk_plugin.py — 26 tests covering all paths Design principles (same as openclaw/ plugin): - Thin delegate: all rewrite logic lives in `rtk rewrite` - Graceful degradation: never blocks command execution - In-place mutation of args dict (no return value needed) - 2-second timeout on rtk rewrite subprocess Also updates hooks/README.md to include Hermes in the supported agents table, directory listing, integration tiers, and JSON format documentation.
b4c53f2 to
df524cb
Compare
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.
Summary
Add a Python plugin for Hermes (AI coding agent by Nous Research) that transparently rewrites terminal commands to RTK equivalents via the
pre_tool_calllifecycle hook, achieving 60-90% LLM token savings.This follows the same pattern as the OpenClaw plugin (#358).
Plugin structure
How it works
Hermes has a Python plugin system with lifecycle hooks. Plugins live in
~/.hermes/plugins/<name>/and contain aplugin.yamlmanifest +__init__.pywith aregister(ctx)function.This plugin:
rtkis in $PATH (cached, checked once)pre_tool_callhookterminaltool call, delegates tortk rewrite <command>args["command"]in-place if a rewrite is availableDesign principles
rtk rewrite(Rust registry)subprocess,shutil,logging)Installation
Tests
26 tests covering: binary detection, rewrite logic, hook behavior, edge cases (timeouts, crashes, non-terminal tools), and full integration flow.
Changes to existing files
hooks/README.md: Added Hermes to supported agents table, directory listing, integration tiers, and JSON format docsChecklist