hermes-agent/website/docs/user-guide
Teknium 0f82c757e0
feat(hooks): add duration_ms to post_tool_call + transform_tool_result
Plugin hooks fired after a tool dispatch now receive an integer
duration_ms kwarg measuring how long the tool's registry.dispatch()
call took (time.monotonic() before/after). Inspired by Claude Code
2.1.119 which added the same field to PostToolUse hook inputs.

Wire points:
- model_tools.py: measure dispatch latency, pass duration_ms to
  invoke_hook("post_tool_call", ...) and invoke_hook("transform_tool_result", ...)
- hermes_cli/hooks.py: include duration_ms in the synthetic payload
  used by 'hermes hooks test' and 'hermes hooks doctor' so shell-hook
  authors see the same shape at development time as runtime
- shell hooks (agent/shell_hooks.py): no code change needed;
  _serialize_payload already surfaces non-top-level kwargs under
  payload['extra'], so duration_ms lands at extra.duration_ms for
  shell-hook scripts

Plugin authors can now build latency dashboards, per-tool SLO alerts,
and regression canaries without having to wrap every tool manually.

Test: tests/test_model_tools.py::test_post_tool_call_receives_non_negative_integer_duration_ms
E2E: real PluginManager + dispatch monkey-patched with a 50ms sleep,
hook callback observes duration_ms=50 (int).

Refs: https://code.claude.com/docs/en/changelog (2.1.119, Apr 23 2026)
2026-04-24 17:08:06 -07:00
..
features feat(hooks): add duration_ms to post_tool_call + transform_tool_result 2026-04-24 17:08:06 -07:00
messaging refactor(commands): drop /provider, /plan handler, and clean up slash registry (#15047) 2026-04-24 03:10:52 -07:00
skills chore: fix lint 2026-04-24 12:32:10 -04:00
_category_.json feat: add documentation website (Docusaurus) 2026-03-05 05:24:55 -08:00
checkpoints-and-rollback.md docs: restructure site navigation — promote features and platforms to top-level (#4116) 2026-03-30 18:39:51 -07:00
cli.md feat: add slash command for busy input mode 2026-04-24 15:15:26 -07:00
configuration.md feat(browser): CDP supervisor — dialog detection + response + cross-origin iframe eval (#14540) 2026-04-23 22:23:37 -07:00
docker.md Update Docker guide with terminal command 2026-04-23 02:02:49 -07:00
git-worktrees.md docs: restructure site navigation — promote features and platforms to top-level (#4116) 2026-03-30 18:39:51 -07:00
profiles.md docs: clarify profiles vs workspaces 2026-04-19 02:00:46 -07:00
security.md docs: comprehensive docs audit — cover 13 features from last week's PRs (#5815) 2026-04-07 10:21:03 -07:00
sessions.md fix(gateway): canonicalize WhatsApp identity in session keys 2026-04-24 07:55:55 -07:00
tui.md feat(tui): stream thinking + tools expanded by default 2026-04-24 02:53:44 -05:00