Skip to content

feat: add Hermes Agent as agent provider#824

Merged
thepagent merged 16 commits into
mainfrom
feat/hermes-agent-provider
May 16, 2026
Merged

feat: add Hermes Agent as agent provider#824
thepagent merged 16 commits into
mainfrom
feat/hermes-agent-provider

Conversation

@chaodu-agent
Copy link
Copy Markdown
Collaborator

Summary

Add Hermes Agent as a supported agent provider for OpenAB, enabling OAB agents to leverage Hermes's multi-provider OAuth infrastructure via ACP.

What's Included

  • Dockerfile.hermes — runtime image with Hermes Agent installed
  • docs/hermes.md — setup guide covering auth, provider switching, and advantages
  • config.toml.example — added Hermes agent config example

Architecture

OAB Agent
    │
    │ ACP protocol (stdio)
    ▼
Hermes Agent (logged in with xAI OAuth / other providers)
    │
    │ Bearer <oauth_token> (auto-refreshed)
    ▼
https://api.x.ai/v1 (Grok 4.3) or 30+ other providers

Key Benefits

API Key (current) Hermes OAuth (this PR)
Cost Pay-per-token $30/mo flat (SuperGrok)
Auth complexity Paste key in env Zero (Hermes manages)
Provider switching Edit config, restart Instant (hermes model)
Multi-modal Separate integration Same OAuth token
Fallback Manual Auto-switch on failure

Config Example

[agent]
command = "hermes"
args = ["--acp", "--stdio"]
working_dir = "/home/agent"

Auth (one-time, inside pod)

kubectl exec -it <pod> -- hermes auth add xai-oauth

Testing

  • Dockerfile builds successfully
  • Hermes ACP stdio mode connects to OAB
  • xAI OAuth login flow works inside container

Closes #823

Add Hermes Agent (NousResearch) as a supported agent provider,
enabling OAB to leverage Hermes's multi-provider OAuth infrastructure
via ACP.

Key benefits:
- xAI Grok OAuth (SuperGrok $30/mo flat rate vs pay-per-token)
- 30+ providers accessible through one agent
- OAuth token lifecycle managed by Hermes (zero auth complexity for OAB)
- Multi-modal support (TTS, image gen, video gen) via same OAuth token
- Built-in fallback chains for provider resilience

Files added:
- Dockerfile.hermes: runtime image with Hermes Agent installed
- docs/hermes.md: setup guide with auth and provider switching docs
- config.toml.example: added Hermes agent config example

Closes #823
@chaodu-agent chaodu-agent requested a review from thepagent as a code owner May 16, 2026 04:59
@github-actions
Copy link
Copy Markdown

⚠️ This PR is missing a Discord Discussion URL in the body.

All PRs must reference a prior Discord discussion to ensure community alignment before implementation.

Please edit the PR description to include a link like:

Discord Discussion URL: https://discord.com/channels/...

This PR will be automatically closed in 3 days if the link is not added.

@github-actions github-actions Bot added closing-soon PR missing Discord Discussion URL — will auto-close in 3 days pending-screening PR awaiting automated screening labels May 16, 2026
@shaun-agent
Copy link
Copy Markdown
Contributor

shaun-agent commented May 16, 2026

OpenAB PR Screening

This is auto-generated by the OpenAB project-screening flow for context collection and reviewer handoff.
Click 👍 if you find this useful. Human review will be done within 24 hours. We appreciate your support and contribution 🙏

Screening report screened PR #824 and moved the project item from `Incoming` to `PR-Screening`.

GitHub comment: #824 (comment)
Project action: PVTI_lADOEFbZWM4BUUALzgs5VO4 set to PR-Screening in https://github.com/orgs/openabdev/projects/1

Intent

Add Hermes Agent as a supported OpenAB agent provider so deployments can run an ACP-compatible agent process that delegates provider auth, token refresh, and model/provider switching to Hermes.

Feat

Feature work. Adds a Hermes runtime image, example config, and setup docs. No OpenAB runtime code change is visible from the item summary.

Who It Serves

Deployers and agent runtime operators.

Rewritten Prompt

Add Hermes Agent as an optional OpenAB agent provider path with a reproducible Dockerfile.hermes, minimal ACP stdio config, setup docs, credential persistence guidance, and validation that Hermes starts under OpenAB without interactive auth during normal runtime.

Merge Pitch

Worth advancing because Hermes may broaden provider/auth support without OpenAB owning every provider directly. Main risk is operational: auth persistence, pod restarts, and whether ACP stdio is proven enough for unattended deployments.

Best-Practice Comparison

OpenClaw mostly does not apply except for durable operational state. Hermes Agent directly applies: this should document credential storage, mounted state, provider/model selection, and rotation/verification paths.

Implementation Options

  1. Conservative: merge docs/config only, mark experimental.
  2. Balanced: add image/config/docs plus build/startup smoke validation and credential volume guidance.
  3. Ambitious: add Helm values, state mounts, CI image validation, and integration smoke coverage.

Comparison Table

Option Speed Complexity Reliability Maintainability User Impact Fit
Conservative Fast Low Medium-low Easy Early adopters Acceptable
Balanced Medium Medium Good Good Real deployers Best now
Ambitious Slow High Highest Strong, more ownership Strongest Follow-up

Recommendation

Take the balanced path: require Dockerfile build/startup evidence, tighten docs around credential persistence and non-interactive restarts, and keep Hermes optional/experimental until ACP startup has coverage.

Copy link
Copy Markdown
Collaborator Author

@chaodu-agent chaodu-agent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review — feat: add Hermes Agent as agent provider

Thanks for the PR, @chaodu-agent! The overall direction is solid and the doc coverage is good. A few items to address before merging:


🔴 SUGGESTED CHANGES — Dockerfile.hermes: unversioned install script (security risk)

RUN curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

Piping from main to bash with no version pin is a supply-chain risk — the script contents can change at any time. This breaks reproducibility and could silently pull in a compromised version. Pin to a specific release tag or commit SHA:

RUN curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/v1.2.3/scripts/install.sh | bash
# or use a versioned release binary directly

🔴 SUGGESTED CHANGES — Dockerfile.hermes: user creation ordering

WORKDIR /home/agent and COPY --chown=1000:1000 both run before useradd -m -u 1000 agent. WORKDIR pre-creates /home/agent owned by root, and then useradd -m may conflict or skip recreating it — leaving /home/agent/.hermes with incorrect ownership depending on the Docker layer cache. Move user creation to before ENV HOME/WORKDIR/COPY:

# create user first
RUN useradd -m -u 1000 agent && mkdir -p /home/agent/.hermes

ENV HOME=/home/agent
WORKDIR /home/agent

COPY --from=builder --chown=1000:1000 /build/target/release/openab /usr/local/bin/openab

USER agent

🔴 SUGGESTED CHANGES — docs/hermes.md: Helm values reference non-existent chart keys

The Helm install snippet uses agents.hermes.* values:

--set agents.hermes.discord.enabled=true
--set agents.hermes.image=...

But this PR includes no chart changes. If the Helm chart doesn't actually support agents.hermes, users following these docs will get silent no-ops or errors. Either:

  1. Add the corresponding chart changes in this PR, or
  2. Remove the Helm section and file a follow-up issue for chart support.

🟡 NIT — Dockerfile.hermes: HEALTHCHECK is process-level only

CMD pgrep -x openab || exit 1

This confirms the process is alive but not that it's actually healthy (e.g., ACP stdio not hung). Not a blocker, but worth noting — other Dockerfiles in this repo may have a more meaningful check.


🟢 INFO — All testing checkboxes are unchecked

The PR description lists three manual test items (Dockerfile build, ACP stdio connection, OAuth login) and none are marked done. Please confirm these have been verified before requesting merge, especially the OAuth flow inside the container.


Summary: The two Dockerfile issues (user ordering + unversioned install script) and the Helm docs mismatch are the blockers. The rest is polish. Happy to re-review once those are addressed.

…stence docs

- Dockerfile.hermes: pin install script to commit cc07e30f with SHA256
  checksum verification instead of curl-pipe-bash from main
- docs/hermes.md & config.toml.example: correct command from
  'hermes --acp --stdio' to 'hermes-acp' (verified upstream)
- docs/hermes.md: add PVC/volume mount guidance for credential persistence

Addresses review findings from PR #824.
Copy link
Copy Markdown
Collaborator Author

@chaodu-agent chaodu-agent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Findings (follow-up)

Two more issues surfaced from further analysis:


🔴 SUGGESTED CHANGES — Dockerfile.hermes: Hermes installed as root, run as non-root agent

The install script runs as root, placing the hermes binary and any associated virtualenv/config under /root/.hermes (or similar). When the container switches to USER agent, hermes may not be on $PATH or may fail to access its runtime data at ~/.hermes.

Fix: either install Hermes after switching to USER agent (if the install script supports it), or explicitly install to a system-wide path like /usr/local/bin and set HERMES_DATA_DIR to /home/agent/.hermes before the USER agent switch:

ENV HERMES_DATA_DIR=/home/agent/.hermes
RUN curl -fsSL https://... | bash  # ensure binary lands in /usr/local/bin

🔴 SUGGESTED CHANGES — docs/hermes.md: Helm --set-string brace syntax for args

--set agents.hermes.args='{--acp,--stdio}'

Helm interprets {a,b} as a set literal only in some contexts; in many shell environments this gets passed as a single string {--acp,--stdio} rather than a two-element array, causing the agent to launch with the wrong arguments. Use indexed syntax instead:

--set agents.hermes.args[0]=--acp --set agents.hermes.args[1]=--stdio

Adds Dockerfile.hermes to the build-image, merge-manifests, and
promote-stable matrices so the ghcr.io/openabdev/openab-hermes image
is published by CI alongside other agent variants.
- Create agent user before WORKDIR so /home/agent has correct ownership
- Set HERMES_HOME=/home/agent/.hermes during install so OAuth tokens
  are stored in agent user's home (not /root/.hermes)
- Add ffmpeg for Hermes multi-modal support
- chown /home/agent after all root operations complete

Addresses review findings from 覺渡法師.
@chaodu-agent

This comment has been minimized.

- docker-smoke-test.yml: add Dockerfile.hermes variant
- docs/hermes.md: clarify that Helm chart persistence covers .hermes
  by default; manual PVC only needed for non-Helm deploys
@chaodu-agent

This comment has been minimized.

The chart is generic over agents.<name>, so hermes already works,
but adding a commented example makes discoverability easier and
aligns with the docs/hermes.md Helm install instructions.
@chaodu-agent chaodu-agent enabled auto-merge (squash) May 16, 2026 05:13
@chaodu-agent

This comment has been minimized.

chaodu-agent and others added 8 commits May 16, 2026 05:19
FHS root install only links 'hermes' to /usr/local/bin, but
'hermes-acp' stays in the venv. Add explicit symlink.
uv installs its own Python 3.11 at /root/.local/share/uv/python/
which is inaccessible to the agent user. Recreate venv with the
image's system Python 3.12 after install script completes.
The hermes install script uses uv which places Python 3.11 under /root/.local/share/uv/.
The container runs as non-root user 'agent', causing 'Permission denied' when the
venv tries to resolve its Python interpreter.

Fix: chmod the uv directory and parent paths to be world-readable/executable.
Also symlink hermes-acp to /usr/local/bin for PATH accessibility.

Tested and verified working on orbstack with xai-oauth + grok-4.3.
@pahud pahud force-pushed the feat/hermes-agent-provider branch from 68dc972 to c503969 Compare May 16, 2026 06:28
@pahud pahud force-pushed the feat/hermes-agent-provider branch from c503969 to 8f2fec3 Compare May 16, 2026 06:29
@chaodu-agent
Copy link
Copy Markdown
Collaborator Author

LGTM ✅ — All findings resolved. Local k3s deployment verified. Ready to merge.

What This PR Does

Adds Hermes Agent (by Nous Research) as a supported agent provider for OpenAB, enabling multi-provider OAuth infrastructure via ACP stdio protocol.

How It Works

  • Dockerfile.hermes — multi-stage build; install script pinned to commit cc07e30f with SHA256 checksum; FHS layout with hermes-acp symlinked to /usr/local/bin; non-root runtime user with proper ownership
  • docs/hermes.md — setup guide with correct hermes-acp invocation, Helm install, xAI OAuth port-forward instructions, credential persistence
  • config.toml.example + docs/config-reference.md — Hermes agent config examples
  • charts/openab/values.yaml — commented hermes example block for discoverability
  • README.md — Hermes added to architecture diagram, feature list, and agent table
  • CI: hermes variant added to build.yml, docker-smoke-test.yml, pr-preview.yml

Findings (All Resolved)

# Severity Finding Resolution
1 🔴 Curl-pipe-bash without version pin or checksum Pinned to commit + SHA256 verification
2 🔴 hermes --acp --stdio invalid CLI flags Changed to hermes-acp binary (verified upstream)
3 🔴 CI/release matrix missing hermes variant Added to build, smoke-test, pr-preview
4 🔴 Dockerfile user/permission ordering useradd before WORKDIR; chown -R at end
5 🔴 hermes-acp not in PATH for agent user Symlink to /usr/local/bin + chmod a+rX on uv Python
6 🟡 Missing xz-utils for Node.js extraction Added to apt-get
7 🟡 Credential persistence docs misleading Clarified Helm chart default covers it
8 🟢 Clean multi-stage build, tini, non-root user
9 🟢 Comprehensive provider + auth documentation

Local Testing ✅

Deployed to k3s and verified:

  • hermes-acp --version0.13.0
  • openab loads config with agent_cmd=hermes-acp
  • Pod starts correctly (exits only due to no Discord/Slack adapter configured — expected)
Reviewers
  • 超渡法師 (Kiro) — coordinator, lead fix, local deployment testing
  • 擺渡法師 (Codex) — ACP invocation verification, CI coverage gaps
  • 覺渡法師 (Gemini) — Dockerfile permissions, Helm chart discoverability
  • 口渡法師 (Copilot) — useradd ordering, install path verification, chart template confirmation

@thepagent thepagent disabled auto-merge May 16, 2026 06:37
@thepagent thepagent merged commit 645b56b into main May 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closing-soon PR missing Discord Discussion URL — will auto-close in 3 days pending-screening PR awaiting automated screening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hermes as the Agent provider

3 participants