mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
Live Tier-3 testing (CLI agent -> a2a tools -> live peer gateway -> model) surfaced two bugs the kwarg-style unit tests masked: 1. registry.dispatch calls handlers as handler(args, **kwargs) — args is the whole dict positional. The handlers used keyword params (url=, agent=), so the dict bound to the first param and .strip() raised 'dict object has no attribute strip'. Rewrote all three handlers to take args: dict (matching the spotify/google_meet convention). Added a registry-dispatch regression test that exercises the real call path the direct-kwarg tests never hit. 2. The model repeatedly reached for agent_name= instead of agent= (6 retries before success). Accept agent_name/name and message/text/task aliases so a reasonable guess succeeds first try. Verified live: client agent discovers the peer's Agent Card, calls it, and gets the reply back (PONG round-trip confirmed on both client audit log and peer conversation log). 39 plugin tests pass. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| adapter.py | ||
| DESIGN.md | ||
| plugin.yaml | ||
| protocol.py | ||
| README.md | ||
| security.py | ||
| tools.py | ||
A2A — Agent-to-Agent protocol for Hermes
Talk to other agents, and let other agents talk to you, over the open
A2A protocol. Works with any A2A-compliant peer
(another Hermes, LangChain, CrewAI, Google ADK, OpenClaw, …). Stdlib only — no
a2a-sdk dependency.
Enable
hermes gateway setup # pick A2A, or:
# ~/.hermes/config.yaml
gateway:
platforms:
a2a:
enabled: true
extra:
port: 9900
# peers you want to call (outbound):
a2a_agents:
researcher:
url: "http://localhost:9999"
auth: { type: bearer, token: "sk-..." }
timeout: 120
Outbound — call other agents
The agent gets three tools:
a2a_discover(url)— what can this agent do?a2a_call(agent, message, context_id?)— send it a task, get the reply.a2a_list()— configured peers + saved conversations.
Inbound — be callable
When the a2a platform is enabled, Hermes serves an Agent Card at
http://<host>:<port>/.well-known/agent.json and accepts JSON-RPC
message/send tasks. Incoming tasks are injected into your live agent
session — the same agent that's talking to you, with full memory — and the
reply is returned over A2A.
Security
- No bearer token ⇒ localhost only. The server binds
127.0.0.1and refuses to widen unless you set bothA2A_BEARER_TOKENandA2A_HOST. - Inbound text is run through prompt-injection filters and framed as untrusted peer input.
- Outbound text is scrubbed of credential-shaped strings.
- Every exchange is logged to
~/.hermes/a2a_audit.jsonl. - Conversations persist to
~/.hermes/a2a_conversations/— they survive context compaction and restarts.
Env vars
| Var | Default | Meaning |
|---|---|---|
A2A_BEARER_TOKEN |
(unset) | Required on inbound calls. Unset ⇒ localhost-only. |
A2A_HOST |
127.0.0.1 |
Bind host. Only widens with a token set. |
A2A_PORT |
9900 |
Inbound port. |
A2A_AGENT_NAME |
hostname-derived | Name on the Agent Card. |
A2A_ALLOW_ALL_USERS |
false |
Allow any authed peer (dev only). |
See DESIGN.md for architecture and the requirement-tracing table.