Hermes Agent plugin

Delegate one task.
Keep the reasoning.

A Node runner that connects to your already-running OpenCode server through @opencode/client, loads a harness root, executes a single delegated session in the background, and leaves you a durable result artifact.

Hermes Agent v0.22+ OpenCode v2 client Node 20+ MIT
hermes · process log
$ opencode-delegate --root ./repo --instructions .hermes/tasks/review.md
RUN_DIR=~/.hermes/plugin-data/opencode-delegate/runs/ocd_...
SESSION_ID=ses_...
 
--- reasoning ---
Inspecting the auth client and its tests...
 
[opencode-delegate] tool called read path=src/auth/client.ts
[opencode-delegate] tool ok
 
--- output ---
Added retry-with-backoff for 429 and 5xx.
Tests: 14 passed. Files: src/auth/client.ts, test/auth.test.ts
 
[opencode-delegate] execution succeeded
=== RESULT ===

Quick start

Install once. Dispatch from Hermes.

The server stays yours: the runner only discovers it, opens a session, and streams the work back.

1. Install the plugin

Clone into the Hermes plugins directory, install the one runtime dependency, validate, and enable.

cd "${HERMES_HOME:-$HOME/.hermes}/plugins"
git clone https://github.com/jpolvora/opencode-delegate.git
cd opencode-delegate
npm install --omit=dev
hermes plugins validate .
hermes plugins enable opencode-delegate

2. Dispatch a task

Write the brief inside the harness root, then start the runner as a Hermes background process.

mkdir -p ./repo/.hermes/tasks
cat > ./repo/.hermes/tasks/review.md <<'EOF'
Review the current diff. Report bugs, missing tests,
and security risks. Do not edit files.
EOF

# In Hermes:
terminal(
  command='"$PLUGIN/bin/opencode-delegate" \
    --root ./repo \
    --instructions .hermes/tasks/review.md \
    --model review --agent plan',
  workdir="./repo",
  background=true,
  notify_on_complete=true
)
Already authenticated. The runner never installs, starts, or logs in to OpenCode. It discovers the registered local service, or connects to --server <url>.

Why this shape

A delegate with an evidence trail.

Built for long tasks that should outlive the chat turn that started them.

01

Harness-aware

--root is the OpenCode session location. AGENTS.md, opencode.json(c), .opencode/, and project skills load from it.

02

Background by design

Launched with Hermes terminal(background=true, notify_on_complete=true). Poll the process log or wait for the completion turn.

03

Live reasoning

Reasoning, text, tool calls, retries, and permission decisions are streamed as they happen — in text or NDJSON.

04

Durable result

Every run leaves result.json, events.jsonl, run.log, and meta.json under a profile-scoped run directory.

05

Resumable sessions

Pass --session ses_... to continue an OpenCode session. The run artifact records the session, model, and usage.

06

Permission-aware

Non-interactive runs reject prompts by default and record them. --auto is explicit and intended for trusted harnesses only.

Flow

Five moves, one session.

The runner starts event subscription before prompting, so no reasoning is missed.

Validate rootResolve the harness and reject instruction files that escape it.
ConnectDiscover the local service or use an explicit server URL.
CreateOpen or resume a session with the configured model and agent.
StreamSubscribe to events, then prompt. Reasoning and tools print live.
PersistFetch final messages, write result.json, exit by outcome.

Dispatcher contract

What the agent sees.

The skill teaches Hermes the exact background dispatch, log parsing, and result-reading loop.

Skill

The plugin ships opencode-delegate and registers opencode-delegate:dispatch.

# Hermes sees it in the local skill list
opencode-delegate

# Or load the namespaced plugin skill
skill_view("opencode-delegate:dispatch")

It covers model aliases, resume, cancellation, permission rejection, timeout handling, and artifact review.

Run directory

Everything needed to audit or replay the turn is colocated.

~/.hermes/plugin-data/opencode-delegate/runs/<run_id>/
├── meta.json       plan, root, instructions, pid
├── events.jsonl    app + raw OpenCode events
├── run.log         human-readable mirror
└── result.json     ok, outcome, text, tools, usage

Configuration

OpenCode semantics, one config file.

Defaults live in config.json; per-profile overrides live in plugin data.

Model and runtime

{
  "provider": "opencode-go",
  "model": "deepseek-v4.1-flash",
  "models": {
    "fast": "opencode-go/minimax-m3.1-flash",
    "review": "opencode-go/deepseek-v4-pro"
  },
  "agent": "build",
  "timeout_seconds": 3600,
  "heartbeat_seconds": 30,
  "auto_approve": false
}

Server and environment

# Empty URL = discover the registered service
OPENCODE_SERVER_URL=

# Optional overrides
OPENCODE_DELEGATE_MODEL=opencode-go/deepseek-v4.1-flash
OPENCODE_DELEGATE_AGENT=build
OPENCODE_DELEGATE_TIMEOUT=3600

# Or pass explicitly
opencode-delegate --server http://host:4096 ...

--model fast uses the alias; provider/model#variant selects a variant such as #max.

Boundaries

Explicit by default.

No hidden server management, no credential scraping, no surprise approvals.

↳

No auth handling

The server is already running and authenticated. The runner only reads the service registration for its connection details.

⌁

Root-contained briefs

Instructions are resolved inside --root. Absolute paths and symlink escapes are rejected before the prompt is sent.

!

Prompts are visible

Permission asks are rejected in non-interactive runs and recorded in result.permissions. Use --auto only when the harness is trusted.