-
Notifications
You must be signed in to change notification settings - Fork 546
feat: add Hermes ACP driver support #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import { createAcpDriver, type AcpSupport } from "./core.ts"; | ||
| const support: AcpSupport = { driverKind: "hermes", displayName: "Hermes", models: { default: "default", options: [{ id: "default", label: "Hermes default" }] }, defaultCli: "hermes-acp", nativeSource: "hermes.acp", loginNote: "Hermes ACP is not installed or authenticated — install it and complete its provider setup first", spawnArgs: () => [], pickAuthMethod: methods => methods[0]?.id ?? null, authFailure: "continue", isAuthenticated: () => true, buildPromptText: t => t.system ? `${t.system}\n\n${t.text}` : t.text }; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- candidate file ---'
wc -l server/drivers/acp/hermes.ts
cat -n server/drivers/acp/hermes.ts
printf '%s\n' '--- ACP driver files ---'
git ls-files 'server/drivers/acp/*' | sort
printf '%s\n' '--- relevant symbols and references ---'
rg -n --glob '!node_modules' 'hermes-setup|pickAuthMethod|authFailure|loginNote|authenticate' serverRepository: milind-soni/OpenMausBot Length of output: 4410 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- ACP support type and shared call flow ---'
rg -n -C 8 'interface AcpSupport|type AcpSupport|pickAuthMethod|authFailure|loginNote|\.authenticate|authenticate\(' server/drivers server --glob '*.ts' --glob '*.tsx' --glob '*.js'
printf '%s\n' '--- Hermes integration and auth method construction ---'
rg -n -C 12 'hermes|hermes-setup|provider|auth method|authMethods|auth_methods' server --glob '*.ts' --glob '*.tsx' --glob '*.js' --glob '*.json'Repository: milind-soni/OpenMausBot Length of output: 50380 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- relevant source files ---'
git ls-files | rg '(^|/)(acp|hermes|driver)' | head -200
printf '%s\n' '--- all auth-related references ---'
rg -n -C 10 'pickAuthMethod|authFailure|loginNote|authMethods|auth_methods|authenticate' . --glob '!node_modules' --glob '!dist' --glob '!build' --glob '*.ts' --glob '*.tsx' --glob '*.js' --glob '*.json' | head -400Repository: milind-soni/OpenMausBot Length of output: 31183 🌐 Web query:
💡 Result: In the NousResearch Hermes Agent, authentication is managed through a centralized runtime resolver system rather than directly within the Agent Protocol (ACP) adapter [1]. The Citations:
🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- tracked files ---'
git ls-files | sed -n '1,120p'
printf '%s\n' '--- Hermes file ---'
if [ -f server/drivers/acp/hermes.ts ]; then
nl -ba server/drivers/acp/hermes.ts
else
printf '%s\n' 'missing'
fiRepository: milind-soni/OpenMausBot Length of output: 3407 🏁 Script executed: #!/bin/bash
set -eu
python3 - <<'PY'
from urllib.request import urlopen
url = "https://raw.githubusercontent.com/NousResearch/hermes-agent/main/acp_adapter/auth.py"
try:
text = urlopen(url, timeout=10).read().decode()
except Exception as exc:
print(f"FETCH_ERROR: {exc}")
else:
for i, line in enumerate(text.splitlines(), 1):
if any(term in line.lower() for term in ("hermes-setup", "authenticate", "provider", "terminal")):
lo, hi = max(1, i - 8), min(len(text.splitlines()), i + 12)
print(f"--- lines {lo}-{hi} ---")
print("\n".join(f"{n}: {text.splitlines()[n-1]}" for n in range(lo, hi + 1)))
PYRepository: milind-soni/OpenMausBot Length of output: 309 🏁 Script executed: #!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
import re
hermes = Path("server/drivers/acp/hermes.ts").read_text()
core = Path("server/drivers/acp/core.ts").read_text()
# Extract the configured auth policy from the Hermes support record.
pick = re.search(r"pickAuthMethod:\s*methods\s*=>\s*methods\[0\]\?\.id\s*\?\?\s*null", hermes)
continue_policy = 'authFailure: "continue"' in hermes
login_note = re.search(r'loginNote:\s*"([^"]+)"', hermes).group(1)
# Reproduce the shared runtime's deterministic auth decision for the relevant inputs.
def decision(methods):
method_id = methods[0].get("id") if methods else None
if method_id:
request = ("authenticate", method_id)
on_failure = "proceed" if continue_policy else f"error: {login_note}"
else:
request = None
on_failure = "proceed" if continue_policy else f"error: {login_note}"
return method_id, request, on_failure
cases = [
([{"id": "hermes-setup"}], "terminal-only"),
([{"id": "provider"}, {"id": "hermes-setup"}], "provider-first"),
([], "no-methods"),
]
print("Hermes pickAuthMethod uses first advertised method:", bool(pick))
print("Hermes authFailure is continue:", continue_policy)
for methods, label in cases:
print(label, decision(methods))
# Confirm the shared core calls ACP authenticate for a selected method and only
# surfaces loginNote when authFailure is fail.
required = [
'const methodId = support.pickAuthMethod(methods);',
'await request("authenticate", { methodId }, INIT_TIMEOUT);',
'if (support.authFailure === "fail") throw new Error(support.loginNote);',
]
print("core_auth_flow_present:", all(item in core for item in required))
PYRepository: milind-soni/OpenMausBot Length of output: 464 Exclude 🤖 Prompt for AI Agents |
||
| export const HermesDriver = createAcpDriver(support); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: milind-soni/OpenMausBot
Length of output: 497
🏁 Script executed:
Repository: milind-soni/OpenMausBot
Length of output: 1037
🏁 Script executed:
Repository: milind-soni/OpenMausBot
Length of output: 1998
Set the Node.js floor to
>=22.12.0.The lockfile resolves Vite 7.3.6, which supports
^20.19.0 || >=22.12.0. The current range accepts unsupported Node.js 22 releases below 22.12.0 for the Vite commands.🤖 Prompt for AI Agents