Skip to content

feat(hermesagent): track Hermes Agent v0.21.3 hook events and MCP per-server keys - #3105

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-issue-2414-hermes-hooks-and-mcp-keys
Sep 17, 2026
Merged

dyoshikawa merged 2 commits into
mainfrom
resolve-issue-2414-hermes-hooks-and-mcp-keys

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Refs #2414

Re-validates the hermesagent target against Hermes Agent v0.21.3 (tag v2026.9.14) and closes the mechanical gaps found:

  • Hooks: hermes_cli/plugins.py's VALID_HOOKS now holds 39 entries. The two events added in v0.21 — agent_loop_stopped and on_room_member_activity — are added to HERMESAGENT_NATIVE_HOOK_EVENTS, so authoring them under hermesagent.hooks no longer warns as undocumented. The compatibility pin in the warning message, doc comments (@see links) and docs/reference/{supported-tools,file-formats}.md moves from v0.20.2 to v0.21.3.
  • MCP per-server keys (both directions, via copyHermesAdvancedFields): protocol (auto / stateless / legacy, mcp-config-reference), lazy (read in tools/mcp_tool_discovery.py) and the lifecycle: mapping form of the stdio recycle timeouts (read in tools/mcp_tool_common.py). The opaque-mapping copies (sampling, elicitation, identity_header, lifecycle) are now one loop to stay under the complexity cap.
  • MCP oauth keys: copyHermesOauth keeps the keys tools/mcp_oauth.py / tools/mcp_oauth_device.py read — client_name, client_metadata_url, cimd, token_endpoint_auth_method, application_type, user_agent, flow, timeout, scope — in addition to the existing callback/client-id keys.
  • scopes → scope: Hermes reads only a single space-separated scope string (cfg.get("scope")); the scopes list rulesync wrote before was never read. A scopes list is now folded into scope when no scope is given, on generate and on import, so an authored scope reaches the authorization server and an old config.yaml imports cleanly.

Left open on the issue as design decisions: project-scope skills/commands (root choice, trust gate) and the .hermes.md chain.

Test plan

  • pnpm cicheck (12,368 tests)
  • New/updated tests in hermesagent-hooks.test.ts and hermesagent-mcp.test.ts fail against the previous implementation (6 failures) and pass with this change

🤖 Generated with Claude Code

https://claude.ai/code/session_019yLN6CVqeZ8HCrjRb9o7mK

dyoshikawa and others added 2 commits September 16, 2026 21:54
…-server keys

Re-validate the `hermesagent` target against Hermes Agent v0.21.3 (tag
`v2026.9.14`):

- `VALID_HOOKS` grew to 39 entries; add the two new shell-hook events
  `agent_loop_stopped` and `on_room_member_activity` so they no longer warn
  as undocumented, and move the compatibility pin in the warning, the doc
  comments and the docs from v0.20.2 to v0.21.3.
- MCP: carry the per-server `protocol` (`auto` / `stateless` / `legacy`),
  `lazy` and the `lifecycle:` mapping, and the `oauth` keys Hermes actually
  reads (`client_name`, `client_metadata_url`, `cimd`,
  `token_endpoint_auth_method`, `application_type`, `user_agent`, `flow`,
  `timeout`, `scope`) in both directions.
- Hermes reads a single space-separated `scope` string and never the
  `scopes` list earlier versions wrote; a `scopes` list is now folded into
  `scope` on generate and import so an authored scope finally reaches the
  authorization server.

Refs #2414

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019yLN6CVqeZ8HCrjRb9o7mK
…and follow the scope fold in E2E

The new lifecycle fixture wrote `__proto__` as an object-literal key, which
JSON.stringify drops, so the assertion never exercised the pollution filter;
it now uses the raw-JSON pattern the sibling test already relies on. The
Hermes MCP E2E import test still expected the legacy `oauth.scopes` list,
which is now folded into the `scope` string Hermes reads.

Refs #2414

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019yLN6CVqeZ8HCrjRb9o7mK
@dyoshikawa
dyoshikawa merged commit 951a0ab into main Sep 17, 2026
9 checks passed
@dyoshikawa

Copy link
Copy Markdown
Owner Author

@dyoshikawa Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant