mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
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)
|
||
|---|---|---|
| .. | ||
| _category_.json | ||
| automate-with-cron.md | ||
| automation-templates.md | ||
| aws-bedrock.md | ||
| build-a-hermes-plugin.md | ||
| cron-troubleshooting.md | ||
| daily-briefing-bot.md | ||
| delegation-patterns.md | ||
| github-pr-review-agent.md | ||
| local-llm-on-mac.md | ||
| migrate-from-openclaw.md | ||
| python-library.md | ||
| team-telegram-assistant.md | ||
| tips.md | ||
| use-mcp-with-hermes.md | ||
| use-soul-with-hermes.md | ||
| use-voice-mode-with-hermes.md | ||
| webhook-github-pr-review.md | ||
| work-with-skills.md | ||