Hermes plugin uses only part of Hermes's plugin interface; its hooks also run in the gateway

Open
#232 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

Start by reading the docstring at plugin/hermes/__init__.py lines 29-33 and the limitations section at plugin/README.md lines 430-434, then compare them against Hermes's middleware, pre_llm_call, subagent_start and register_command docs linked in the issue. The open question is a maintainer decision: extend plugin/hermes in-tree or link the external adapter DylDigitals/tokeneconomizer-for-hermes. Done means that decision is recorded; only then can a port be scoped, with gateway, sub-agent and cron hook coverage as the target.

Written by the indexing model from the issue text.

Description

Hermes plugin hooks run in both the CLI and the gateway (event hooks: "CLI + Gateway"). plugin/hermes uses only part of that. It follows only classic CLI and one-shot sessions, so gateway sessions (Discord, Telegram, the API server), sub-agents and cron get no micro-skills or loop guard (docstring). Tool pruning, the repository map and /te are not ported (README).

Hermes documents an interface for each missing piece:

  • Tool pruning: llm_request middleware can "replace effective provider kwargs before provider execution", and the request includes the tool definitions.
  • Repository map: the same pre_llm_call hook the plugin already uses for micro-skills.
  • Sub-agents: subagent_start passes parent_session_id and child_session_id.
  • /te: ctx.register_command "adds /name in CLI and gateway sessions" (plugins).

We ported this repository at 7042ea8 with these interfaces: DylDigitals/tokeneconomizer-for-hermes. It runs in gateway sessions and supports 39 of the 41 capabilities in its MATRIX.md, with 131 offline tests and real-session runs on Hermes 0.22.2. It cannot prune tools under the codex_app_server runtime or import old session history.

Related: #85. Would you take a PR that extends plugin/hermes, or would you rather link our adapter from its README section?

Dominant language
Python
Stars
7.4k
Forks
500
Avg merge
1d 9h
Merged PRs (30d)
124

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/TokenEconomizer

All issues in microsoft/TokenEconomizer

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.