Files
fusion/plugins/fusion-plugin-hermes-runtime
dependabot[bot] af3d78d2cd chore(deps-dev): bump vitest from 4.1.8 to 4.1.10 (#2446)
Bumps
[vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)
from 4.1.8 to 4.1.10.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/vitest-dev/vitest/releases">vitest's
releases</a>.</em></p>
<blockquote>
<h2>v4.1.10</h2>
<h3>   🐞 Bug Fixes</h3>
<ul>
<li><strong>browser</strong>: Check fs access in builtin commands
[backport to v4]  -  by <a
href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a>,
<strong>Hiroshi Ogawa</strong> and <strong>OpenCode
(claude-opus-4-8)</strong> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10680">vitest-dev/vitest#10680</a>
<a href="https://github.com/vitest-dev/vitest/commit/5c18dd267"><!-- raw
HTML omitted -->(5c18d)<!-- raw HTML omitted --></a></li>
<li><strong>vm</strong>: Fix external module resolve error with deps
optimizer query for encoded URI [backport to v4]  -  by <a
href="https://github.com/SveLil"><code>@​SveLil</code></a> and <a
href="https://github.com/hi-ogawa"><code>@​hi-ogawa</code></a> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10661">vitest-dev/vitest#10661</a>
<a href="https://github.com/vitest-dev/vitest/commit/bae52b511"><!-- raw
HTML omitted -->(bae52)<!-- raw HTML omitted --></a></li>
</ul>
<h5>    <a
href="https://github.com/vitest-dev/vitest/compare/v4.1.9...v4.1.10">View
changes on GitHub</a></h5>
<h2>v4.1.9</h2>
<h3>🐞 Bug Fixes</h3>
<ul>
<li>Fix <code>importOriginal</code> with optimizer and query import
[backport to v4] - by <strong>Hiroshi Ogawa</strong>, <strong>David
Harris</strong>, <strong>Codex</strong>and <strong>Vladimir</strong> in
<a
href="https://redirect.github.com/vitest-dev/vitest/issues/10546">vitest-dev/vitest#10546</a>
<a href="https://github.com/vitest-dev/vitest/commit/a5180190c"><!-- raw
HTML omitted -->(a5180)<!-- raw HTML omitted --></a></li>
<li><strong>browser</strong>:
<ul>
<li>Wait for orchestrator readiness before resolving browser sessions
[backport to v4] - by <strong>Vladimir</strong> and <strong>Séamus
O'Connor</strong> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10555">vitest-dev/vitest#10555</a>
<a href="https://github.com/vitest-dev/vitest/commit/7fb29651a"><!-- raw
HTML omitted -->(7fb29)<!-- raw HTML omitted --></a></li>
<li>Wait for iframe tester readiness before preparing [backport to v4] -
by <strong>Vladimir</strong> and <strong>Séamus O'Connor</strong> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10497">vitest-dev/vitest#10497</a>
and <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10556">vitest-dev/vitest#10556</a>
<a href="https://github.com/vitest-dev/vitest/commit/fbc626c40"><!-- raw
HTML omitted -->(fbc62)<!-- raw HTML omitted --></a></li>
</ul>
</li>
<li><strong>mocker</strong>:
<ul>
<li>Hoist vi.mock() for vite-plus/test imports [backport to v4] - by
<strong>Hiroshi Ogawa</strong>, <strong>LongYinan</strong>,
<strong>Claude Opus 4.8</strong> and <strong>Vladimir</strong> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10548">vitest-dev/vitest#10548</a>
<a href="https://github.com/vitest-dev/vitest/commit/2c9559c02"><!-- raw
HTML omitted -->(2c955)<!-- raw HTML omitted --></a></li>
</ul>
</li>
<li><strong>pool</strong>:
<ul>
<li>Prevent test run hang on worker crash [backport to v4] - by
<strong>Ari Perkkiö</strong> and <strong>Jattioui Ismail</strong> in <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10543">vitest-dev/vitest#10543</a>
and <a
href="https://redirect.github.com/vitest-dev/vitest/issues/10564">vitest-dev/vitest#10564</a>
<a href="https://github.com/vitest-dev/vitest/commit/934b0f587"><!-- raw
HTML omitted -->(934b0)<!-- raw HTML omitted --></a></li>
</ul>
</li>
</ul>
<h5><a
href="https://github.com/vitest-dev/vitest/compare/v4.1.8...v4.1.9">View
changes on GitHub</a></h5>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="db616d227b"><code>db616d2</code></a>
chore: release v4.1.10 (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/10718">#10718</a>)</li>
<li><a
href="bae52b5112"><code>bae52b5</code></a>
fix(vm): fix external module resolve error with deps optimizer query for
enco...</li>
<li><a
href="a7a61e78c7"><code>a7a61e7</code></a>
chore: release v4.1.9 (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/10598">#10598</a>)</li>
<li><a
href="934b0f587c"><code>934b0f5</code></a>
fix(pool): prevent test run hang on worker crash (<a
href="https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest/issues/10543">#10543</a>)
[backport to v4] (#...</li>
<li><a
href="7fb29651af"><code>7fb2965</code></a>
fix(browser): wait for orchestrator readiness before resolving browser
sessio...</li>
<li><a
href="a5180190c1"><code>a518019</code></a>
fix: fix <code>importOriginal</code> with optimizer and query import
[backport to v4] (#...</li>
<li>See full diff in <a
href="https://github.com/vitest-dev/vitest/commits/v4.1.10/packages/vitest">compare
view</a></li>
</ul>
</details>
<br />

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gsxdsm <gsxdsm@users.noreply.github.com>
2026-07-27 19:40:08 -07:00
..
2026-07-26 18:11:47 -07:00

Hermes Runtime Plugin

Drives the local hermes CLI (NousResearch/hermes-agent) as a subprocess, so a Fusion agent backed by this runtime delegates each prompt to a real Hermes Agent process running on the same machine.

What it does

For each promptWithFallback(session, prompt) call:

  1. Spawns hermes chat -q <prompt> -Q --source tool (with --resume <id> on subsequent calls in the same session).
  2. Captures the trailing session_id: YYYYMMDD_HHMMSS_xxxxxx line from stdout.
  3. Strips ANSI + TUI chrome (╭─ Hermes ─╮, ↻ Resumed session …, etc.) and forwards the cleaned response body to session.callbacks.onText(...).
  4. Persists the captured session id on the session object so the next call resumes the same Hermes session.

This is fundamentally different from the older "raw-model" approach that bypassed hermes entirely by calling @mariozechner/pi-ai directly. The CLI subprocess is now the source of truth — provider/model selection, auth, skills, and memory are all the responsibility of the user's local hermes install.

Prerequisites

You need the hermes Python CLI on PATH (or set binaryPath / HERMES_BIN). Install instructions:

# Recommended: use the upstream installer
curl -LsSf https://hermes-agent.nousresearch.com/install.sh | sh

# Or via pipx (cross-platform)
pipx install hermes-agent

After install, run hermes login (or hermes auth) to configure a provider. The Fusion plugin does not manage Hermes auth — it inherits whatever the local install has.

Verify with hermes --version.

Fusion skill auto-install

When the Hermes runtime plugin loads, it attempts to auto-install/mirror Fusion's bundled fusion skill into the active Hermes profile skill directory:

  • default profile: ${HERMES_HOME:-~/.hermes}/skills/fusion
  • named profile: ${HERMES_HOME:-~/.hermes}/profiles/<profile>/skills/fusion

The installer is idempotent and self-healing:

  • leaves an already-correct install untouched
  • replaces prior Fusion installs it can positively identify
  • avoids replacing unrelated user-managed directories

If the bundled Fusion skill source is missing or filesystem writes fail, the plugin logs a warning and still starts the Hermes runtime.

Limitations

Because we drive the CLI's chat -q mode:

  • No per-token streaming. Hermes buffers output through prompt_toolkit; the full response arrives once the process exits. onText is called exactly once per turn.
  • No reasoning/thinking deltas. -Q mode suppresses them. If you need streaming + reasoning, switch to Hermes's ACP mode (not yet implemented in this plugin).
  • No tool-call hooks. Hermes runs tools internally; Fusion only sees the final assistant text. Use yolo: true to skip Hermes's interactive approval prompts in non-interactive sessions.
  • No JS tool callbacks. customTools callback functions are still not executable through Hermes CLI mode; Hermes runs its own tool layer and Fusion receives final text.
  • Fusion context is prompt-mediated. The engine forwards requested Fusion skill names into skills, and the adapter prepends Fusion system/runtime context on the first turn of each session so capability expectations (for example messaging/delegation flows) are not silently dropped on non-pi runtimes.
  • AgentRuntimeOptions.cwd / sessionManager are still adapter-noops in CLI mode.

Settings

Key Env var Default Notes
binaryPath HERMES_BIN hermes Path to the hermes binary. Falls back to PATH lookup.
model HERMES_MODEL_ID (Hermes default) -m <model> (e.g. claude-sonnet-4-5, MiniMax-M3).
provider HERMES_PROVIDER (Hermes default) --provider <provider> — one of auto, anthropic, openrouter, gemini, openai-codex, copilot, copilot-acp, huggingface, zai, kimi-coding, minimax, minimax-cn, kilocode, xiaomi, nous.
maxTurns HERMES_MAX_TURNS 12 --max-turns N. Hermes's own default is 90; we cap lower.
yolo HERMES_YOLO false --yolo — skip interactive approval. Required for non-interactive sessions that use shell-style tools.
cliTimeoutMs HERMES_CLI_TIMEOUT_MS 300000 (5 min) Hard kill on the Fusion side.

Settings precedence: plugin settings → env var → default.

Public API

import {
  HermesRuntimeAdapter,
  resolveCliSettings,
  invokeHermesCli,
  buildHermesArgs,
  parseHermesOutput,
  probeHermesBinary,
  type HermesCliSettings,
  type HermesCliResult,
  type HermesBinaryStatus,
} from "@fusion-plugin-examples/hermes-runtime";

probeHermesBinary({ binaryPath?, timeoutMs? }) runs hermes --version and returns { available, version, binaryPath, reason, probeDurationMs }. Used by the dashboard's "Runtimes → Hermes" settings card to power the install-status badge.

Metadata

  • Plugin ID: fusion-plugin-hermes-runtime
  • Runtime ID: hermes
  • Package: @fusion-plugin-examples/hermes-runtime

Development

pnpm --filter @fusion-plugin-examples/hermes-runtime test       # 41 tests
pnpm --filter @fusion-plugin-examples/hermes-runtime build