hermes-agent/website/docs
Teknium 30307a9802
feat(plugins): add pre_approval_request / post_approval_response hooks (#16776)
Plugins can now observe dangerous-command approval events in real time,
on both the CLI-interactive path and the async gateway path. This is the
missing hook surface external tools need to build approval notifiers
(macOS menu-bar allow/deny, Slack alerts, audit logs, etc.) without
forking Hermes or running a parallel gateway adapter.

Changes:
- hermes_cli/plugins.py: add two entries to VALID_HOOKS
- tools/approval.py: fire both hooks from check_all_command_guards --
  around prompt_dangerous_approval (CLI surface) and around the
  notify_cb + blocking event.wait loop (gateway surface)
- website/docs/user-guide/features/hooks.md: document both hooks with
  a macOS-notification example
- tests/tools/test_approval_plugin_hooks.py: 5 tests covering CLI once,
  CLI deny, plugin-crash resilience, gateway approve, gateway timeout

Hooks are observer-only: return values are ignored, so plugins cannot
veto or pre-answer an approval (use pre_tool_call for that). A crashing
plugin cannot break the approval flow -- invoke_hook swallows per-
callback errors, and the wrapper logs and swallows dispatch-layer
errors too.

Surface kwarg distinguishes "cli" from "gateway"; post hook reports
choice as one of once/session/always/deny/timeout.
2026-04-27 20:08:33 -07:00
..
developer-guide fix(agent): preserve Codex message items for replay 2026-04-25 18:22:06 -07:00
getting-started feat(nix): declarative plugin installation for NixOS module (#15953) 2026-04-28 00:18:32 +05:30
guides feat(nix): declarative plugin installation for NixOS module (#15953) 2026-04-28 00:18:32 +05:30
integrations fix(providers/gmi): post-salvage review fixes 2026-04-27 11:17:59 -07:00
reference feat(skills): bundle touchdesigner-mcp by default 2026-04-27 18:22:58 -07:00
user-guide feat(plugins): add pre_approval_request / post_approval_response hooks (#16776) 2026-04-27 20:08:33 -07:00
index.md fix(docs): show sidebar on docs homepage 2026-04-16 04:24:45 -07:00