All plugins

hermes-compute-priority

Keeps the Hermes process that serves a connection ahead of the isolated turn workers it spawns: every tui_gateway.compute_host worker owned by the same user is deprioritised within two seconds of appearing - niceness +10 by default on Linux and macOS, the BELOW_NORMAL or IDLE priority class on Windows - and nothing else is touched unless extra rules are opted into. Disclosure - it reads process metadata only: /proc/<pid>/cmdline and /proc/<pid>/ ownership on Linux, psutil on macOS and Windows; it only ever LOWERS the priority of processes belonging to the same user, never raises one, never signals, stops or kills anything, opens no socket, writes no file, reads no credential and uses no privilege, and it is a no-op where turn isolation is off or where psutil is missing on macOS or Windows (a read-only /status route says why). Backend only: no tool, no hook, no middleware, no dashboard tab.

atostivintToolsv0.3.2Updated 2 days ago

About

Keeps the Hermes process that serves a connection ahead of the isolated turn workers it spawns: every tui_gateway.compute_host worker owned by the same user is deprioritised within two seconds of appearing - niceness +10 by default on Linux and macOS, the BELOW_NORMAL or IDLE priority class on Windows - and nothing else is touched unless extra rules are opted into. Disclosure - it reads process metadata only: /proc/<pid>/cmdline and /proc/<pid>/ ownership on Linux, psutil on macOS and Windows; it only ever LOWERS the priority of processes belonging to the same user, never raises one, never signals, stops or kills anything, opens no socket, writes no file, reads no credential and uses no privilege, and it is a no-op where turn isolation is off or where psutil is missing on macOS or Windows (a read-only /status route says why). Backend only: no tool, no hook, no middleware, no dashboard tab.

hermes-compute-priority

A Hermes plugin that keeps the process serving your connection ahead of the processes running your
agents.

The problem it solves

Hermes can run agent turns in a child process (dashboard.turn_isolation). That child is where the
GIL is held while a turn parses a model stream or dispatches tools. The process that answers your
Desktop's WebSocket is its parent.

On a small machine, the parent must win — and configuration alone cannot make it:

KnobWhat it arbitratesWhy it is not enough
CPUWeight (systemd)between unitsthe child lives in the parent's cgroup, so it gets the same share
Nice (systemd)between processesniceness is inherited at fork/exec: the child starts at the parent's nice and stays there

Measured on a 1 vCPU host, five dashboard processes across two generations: all at -5. The parent
had no priority over its own worker.

So the worker's niceness has to be raised after it starts. That needs no privilege — lowering a
process's priority of a process you own is always allowed — and it can never make anything more
urgent than it already was.

What it does

Two panels on one core: without the plugin the worker inherits the parent's nice and competes on equal terms; with it the worker is reniced -5 to +10 and yields to the process serving the connection

Every two seconds, in the Hermes process that loaded it:

  1. finds processes owned by the same user whose command line contains
    tui_gateway.compute_host (how tui_gateway/host_supervisor.py spawns a turn worker) — by
    reading /proc on Linux, and by asking psutil on macOS and Windows;
  2. lowers their priority to +10, skipping any worker already at or below that value;
  3. logs one line per worker, once.

It does nothing else. On a host where turn isolation is off, no worker of that shape exists, so the
plugin is a no-op.

How scheduling priority works

Priority makes nothing faster: it decides who yields when two processes want the same core. POSIX
calls that number nice — -20 to 19, a larger value meaning less CPU — and Windows uses a
per-process priority class instead, which the plugin maps explicitly. The catch is inheritance: a
child starts at its parent's nice, so a systemd unit cannot separate the two, and the child has to be
lowered after it starts. How scheduling priorities work covers the two layers
(cgroup CPUWeight between units, nice between processes), which operation needs a privilege on each
platform, and what this plugin deliberately leaves alone.

What it does not do

  • It does not speed up turns: work handed to a worker still costs the same CPU, it just yields
    first.
  • It does not help sessions whose agent was built in-process (they never use a worker, so there
    is no separate process to deprioritise).
  • It is not a resource limit. If you want a hard ceiling on a whole process tree, use cgroup
    CPUQuota in the unit — this plugin is about ordering, not capping.

Install

hermes plugins install https://github.com/atostivint/hermes-compute-priority
hermes plugins enable hermes-compute-priority

Or copy the directory into <HERMES_HOME>/plugins/hermes-compute-priority/, run
hermes plugins enable hermes-compute-priority, and restart the gateway.

install only offers to enable — it prompts, and a non-interactive run (CI, Docker, a piped
script) leaves the plugin disabled. Hermes imports a user plugin's backend only when the plugin is
listed in plugins.enabled, so the enable line is a required step, not a confirmation.

The backend is reached through the dashboard, so the directory has to keep
dashboard/manifest.json next to dashboard/plugin_api.py. The manifest is what tells the
dashboard to import that file and mount its router at /api/plugins/hermes-compute-priority/;
without it Hermes skips the plugin silently and the status route below does not exist at all.
tests/test_dashboard_manifest.py fails if the manifest disappears or if its version drifts
from plugin.yaml's.

The root __init__.py exists only to satisfy the plugin loader's shape check — a directory plugin
is "a plugin.yaml and an __init__.py exposing register(ctx)", and Hermes logs
Failed to load plugin 'hermes-compute-priority' in logs/errors.log without it — and it
registers nothing: the loop is started by the dashboard loader, never by this file.

The plugin works on Linux, macOS and Windows; see Platforms for what each one does
and for the psutil requirement on macOS and Windows.

Platforms

One contract, three backends (platform_backend.py). The observable behaviour is the same
everywhere: the turn workers of the current user are found by command line and lowered, once, with
no privilege and never in the other direction.

PlatformEnumerationPriorityExtra dependency
Linux/proc/<pid>/cmdline, st_uid for ownershipos.setpriority (0–19 niceness)none
macOSpsutil.Process.cmdline()psutil.Process.nice(10) (0–19 niceness)psutil
Windowspsutil.Process.cmdline()psutil.Process.nice(<priority class>)psutil

psutil is already a core hermes-agent dependency, so on those two platforms it is normally
present. It stays optional for this plugin: with no psutil on macOS or Windows the plugin
loads, enumerates nothing, changes nothing, and says so:

{"ok": true, "enabled": false, "backend": "psutil-win32", "platform": "win32",
 "available": false, "reason": "psutil is not installed, so processes cannot be enumerated on this platform; install it with `pip install psutil` …"}

enabled: false plus a reason is the whole point: a plugin that cannot see processes must not
report a scan loop that is running fine.

Windows: niceness has no 0–19 scale

On Windows nice() reads and writes a priority class, not a number between 0 and 19. The
translation is an explicit table, not arithmetic, because it is a policy choice:

Target nicenessWindows priority classMeaning
15–19IDLE_PRIORITY_CLASSthe lowest class Windows offers
5–14BELOW_NORMAL_PRIORITY_CLASSclearly behind the serving process
0–4(no action)NORMAL is the floor the plugin is allowed to ask for

A target below 5 does nothing on purpose. The only classes left are NORMAL_PRIORITY_CLASS (the
ordinary priority — i.e. no change at all) and classes above NORMAL, which would make a process
more urgent than the default. This plugin only ever lowers a priority, so anything under 5 is
refused rather than approximated; /status reports it in a note field when you configure such a
target. The default of 10 lands on BELOW_NORMAL_PRIORITY_CLASS.

Reading a class back for the idempotence check is coarse but safe: IDLE reads as 19,
BELOW_NORMAL as 10, and anything at or above NORMAL as 0 — low enough that a worker which
somehow outranks NORMAL still gets lowered, never raised. An unrecognised class is skipped.

Same user, on a platform without uids()

psutil.Process.uids() is POSIX-only. Where it is missing, the candidate's
psutil.Process.username() is compared with this process's own (case-insensitively on Windows,
where account names are case-insensitive). A user name that cannot be read — or our own — means
the candidate is skipped, not guessed at: not knowing who owns a process is not a licence to
lower its priority.

Settings

Environment, read once when the backend is imported:

VariableDefaultMeaning
HERMES_COMPUTE_PRIORITY10 disables the scan entirely
HERMES_COMPUTE_PRIORITY_NICE10target priority for workers: niceness 0–19 (19 is the lowest) on Linux and macOS, translated to a priority class on Windows (see Platforms; 5–14 = below normal, 15–19 = idle)
HERMES_COMPUTE_PRIORITY_INTERVAL_S2.0seconds between scans
HERMES_COMPUTE_PRIORITY_RULES(empty)opt-in extra process classes, see below

Extra rules — off by default

The plugin knows exactly one class of process until you tell it about others. That is deliberate: a
published plugin must not start deprioritising parts of someone else's Hermes without being asked.

HERMES_COMPUTE_PRIORITY_RULES='[
  {"name": "mcp",         "match": "mcp-server",              "nice": 15},
  {"name": "plugin-host", "match": "hermes_cli.plugin_host_child", "nice": 8}
]'

Each rule is:

FieldMeaning
namea label, for the log line and the status route
matcha plain substring of the command line, at least 3 characters — the only stable handle a plugin has, since it may not hook core code
nicetarget niceness, 0–19 (on Windows: 5–14 = below normal, 15–19 = idle, below 5 = no action)

A match shorter than three characters is refused. "a" would hit most command lines on the
machine, and a typo must not renice half the box.

Rules are evaluated in order, and the first match wins. A process already at or below its target
is skipped, so a rule can never make anything more urgent — and a nice below 0 is rejected at
parse time, because raising a priority needs a privilege this plugin does not want.

Anything invalid in the list is dropped silently rather than raising: a typo in an optional feature
must not take down the loop that protects the connection.

Per-process configuration

The plugin runs inside each Hermes process, so "per process" is simply "per unit":

# hermes-dashboard.service.d/10-scheduling.conf
Environment=HERMES_COMPUTE_PRIORITY_NICE=15

# hermes-gateway.service.d/10-scheduling.conf
Environment=HERMES_COMPUTE_PRIORITY_NICE=5

Only the process that actually spawns a worker benefits: today that is the one serving sessions
(the dashboard). Configuring a unit that never isolates turns is harmless and inert.

Verify it works

# before a turn that uses an isolated session  (Linux; on macOS: ps -o pid,ppid,ni,command -A)
ps -o pid,ppid,ni,args -C python3 | grep compute_host
# Windows: the class is what moves, not a 0-19 number
Get-CimInstance Win32_Process -Filter "Name = 'python.exe'" |
  Where-Object { $_.CommandLine -like '*tui_gateway.compute_host*' } |
  ForEach-Object { Get-Process -Id $_.ProcessId | Select-Object Id, PriorityClass }
# -> BelowNormal by default (Idle for a target of 15 or more)

The worker should move within a couple of seconds of starting, while the serving process keeps its
own value. The plugin also answers a read-only route:

# the deployment's session token, or a Bearer token from the auth flow
curl -H "X-Hermes-Session-Token: $HERMES_DASHBOARD_SESSION_TOKEN" \
  http://127.0.0.1:<dashboard port>/api/plugins/hermes-compute-priority/status

which reports the target, the scan count, the workers deprioritised so far, the backend in use
(procfs, psutil-posix, psutil-win32) and the last error if any. On a platform where the
backend cannot run, it answers {"enabled": false, "reason": …} — read that field before assuming
a plugin that loaded is a plugin that works.

The route sits behind the dashboard's auth gate: nothing under /api/plugins/ is on the public
allowlist, so a credential-less request gets 401 {"error": "unauthenticated", "detail": "Unauthorized", ...} from the gate and never reaches the plugin — a 401 therefore says nothing
about whether the plugin loaded. dashboard.basic_auth is a form provider (the password is
POSTed to /auth/password-login); there is no HTTP Basic, so curl -u with that username and
password does not authenticate anything. The gate only reads Authorization: Bearer <token>, a
session cookie, or X-Hermes-Session-Token, and on /api/* it always answers with the 401 JSON
above — never a redirect.

Two proofs need no credentials at all:

# one line per worker reniced, from the plugin's own file log. The dashboard process installs
# file handlers only and runs uvicorn with log_config=None, so nothing of this reaches the journal.
grep compute-priority /var/lib/hermes-agent/.hermes/logs/agent.log

# the plugin's scan thread, inside the serving process. comm is truncated to 15 characters,
# so "compute-priority" (16) shows up as "compute-priorit".
grep -l compute-priorit /proc/$(systemctl show -p MainPID --value hermes-dashboard)/task/*/comm

If both are empty while turn isolation is on, check hermes plugins list first — a plugin that is
installed but not enabled never has its backend imported.

Disclosure

Written the way the Hermes plugin catalog expects:

  • Network: none. The plugin opens no socket and contacts nothing.
  • Files: on Linux, reads /proc/<pid>/cmdline and /proc/<pid>/ ownership for processes of
    the same user. On macOS and Windows, enumeration goes through psutil, which reads process
    metadata from the OS. Reads nothing in your home directory and writes no file.
  • Processes: lowers the priority of processes it has already matched and that belong to the
    same user — os.setpriority on Linux and macOS, SetPriorityClass via psutil on Windows. It
    never raises a priority, never signals, stops or kills anything, and it skips its own pid.
  • Threads: one daemon thread inside the Hermes process that loaded it, started at import and
    stopped when that process exits.
  • Credentials: none read, none stored.
  • Telemetry: none.

Limitations, stated plainly

  • Polling, not hooking. The delay between a worker starting and being deprioritised is up to one
    interval. Hooking the spawn would be exact, but that is core code: a plugin may only use the
    published plugin API.
  • Detection by command line. If upstream renames the module, the match breaks — loudly in the
    status route (applied_total stops moving), silently otherwise.
  • One process. The plugin acts inside the process that loaded it. If your dashboard and gateway
    are separate units, install it on the one that spawns the workers.
  • Windows granularity. Three priority classes are coarse next to 20 niceness levels: a target of
    6 and one of 13 are the same BELOW_NORMAL_PRIORITY_CLASS. The direction is always right; the
    step is wider.
  • psutil on macOS and Windows. Without it there is no enumeration, so the plugin stays idle
    and reports why. Linux never needs it.

The better fix, upstream

subprocess.Popen(..., preexec_fn=...) or a nice= argument in
tui_gateway/host_supervisor.py would make this exact, in one line, without a polling thread (on
Windows the same spawn takes creationflags= with a priority class). This plugin exists because
that line is not there yet.

License

MIT — see LICENSE.

README from the reviewed commit 2a1cc9a; it updates when the author re-pins.

More by atostivint

4 plugins by atostivint in the catalog.

atostivinthermes-adaptive-effortChoose a separate scorer to set the reasoning effort of each Hermes request. Disclosure — off by default; when a mode is enabled (or on an explicit /hae probe), sends the latest user message (or the parent-written subagent goal), truncated to 4000 characters, plus any configured guidance to the scorer you select (TypeSafe Jev at api.typesafe.ai by default, or OpenAI Decisions, OpenRouter, Cloudflare Workers AI, Nace at console.nace.ai, a seventh scorer — a local Ollama endpoint that needs no key — or a custom URL) using that service's key, or with no key at all for Ollama (local only) and for an unauthenticated custom endpoint; by default an enabled mode also sends up to 4 earlier user/assistant text messages (1200 characters each, up to 6 when configured; never on subagents or /hae probe) and a separate yes/no continuation question to the same scorer on each turn (set dialogue_context_messages or continuation_downgrade_votes to 0 to stop this), and an opt-in setting can also send the target model identity. The prompt stays on this machine only when the Ollama endpoint is local: this plugin cannot vouch for a remote address an operator types. Named effort vocabularies cover the fifteen exact openai-codex codex_responses ids, the exact commandcode deepseek/deepseek-v4.1-flash route and the OpenCode Go chat_completions routes, including five newly measured ids (hy4-flash-free, qwen4-max, kimi-k2.7-code, longcat-2.0, iceman-contributor-free); allow_none is opt-in and changes nothing today (no dynamic route's ladder declares none). adaptive_effort_routes is an operator opt-in that trades the prefix cache for per-turn effort on a chosen registered route. /hae cache reports seven-day per-route counters of effort-attributable cache loss; that store keeps no prompt text, session ids or request ids. /hae output is localized in French, German and Spanish on the Hermes core surface with an English fallback; the Desktop surface stays English. In Hermes Desktop it also sets the focused chat's session reasoning selector through the gateway config.set API after each applied change, and it keeps a prompt-free effort-change history (64 changes × 64 conversations), per-conversation mode overrides (at most 256 conversations) and per-route cache verdicts built from provider token counters (at most 128 routes) in its plugin data directory.Communitymodels4atostivinthermes-vitals-lightCPU, load, free RAM, Linux PSI CPU pressure, active sessions, running Hermes processes and round-trip time of the connected Hermes server in the Desktop status bar, plus an optional TUI card. Disclosure — the Desktop chip's backend route reads CPU/memory figures via psutil, Linux /proc/pressure/cpu and /proc/meminfo, every process's command line (only per-command Hermes process counts are returned) and the server's own loopback /api/status, and reports the server hostname to the Desktop; the optional TUI card, copied by hand into tui-widgets/, runs the same code as a long-lived python3 -c child of the TUI and saves its options to <HERMES_HOME>/vitals.json; no third-party network call, no telemetry, no credentials.CommunityDesktop appatostivintwhoamiColoured pill in the composer showing which Hermes profile a new session will use.CommunityDesktop app

Developer Mode

Explore built-in Hermes toolsets and actions.

HermesAgent

Developer?

Create a Hermes extension for Desktop or agent workflows.

Developer Section