hermes-agent/hermes_cli
Teknium 59b56d445c
feat(hooks): add duration_ms to post_tool_call + transform_tool_result (#15429)
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-25 22:13:12 -07:00
..
__init__.py chore: release v0.11.0 (2026.4.23) (#14791) 2026-04-23 15:31:59 -07:00
auth_commands.py Add native Spotify tools with PKCE auth 2026-04-24 05:20:38 -07:00
auth.py feat: Add Azure Foundry provider with OpenAI/Anthropic API mode selection 2026-04-25 18:48:43 -07:00
azure_detect.py feat(azure-foundry): auto-detect transport, models, context length 2026-04-25 18:48:43 -07:00
backup.py
banner.py feat(banner): hyperlink startup banner title to latest GitHub release (#14945) 2026-04-23 23:28:34 -07:00
callbacks.py
claw.py Normalize claw workspace paths for Windows 2026-04-22 18:15:27 -07:00
cli_output.py
clipboard.py
codex_models.py feat(codex): add gpt-5.5 and wire live model discovery into picker (#14720) 2026-04-23 13:32:43 -07:00
colors.py
commands.py fix(tui): bind provider as model alias 2026-04-25 13:58:59 -05:00
completion.py
config.py feat: Add Azure Foundry provider with OpenAI/Anthropic API mode selection 2026-04-25 18:48:43 -07:00
copilot_auth.py fix(copilot): exchange raw GitHub token for Copilot API JWT 2026-04-24 05:09:08 -07:00
cron.py feat(cron): per-job workdir for project-aware cron runs (#15110) 2026-04-24 05:07:01 -07:00
curses_ui.py
debug.py style(debug): add missing blank line between LogSnapshot and helpers 2026-04-22 16:34:05 -05:00
default_soul.py
dingtalk_auth.py
doctor.py fix(doctor): accept bare custom provider 2026-04-25 18:01:36 -07:00
dump.py fix(gemini): fail fast on missing API key + surface it in hermes dump (#15133) 2026-04-24 05:35:17 -07:00
env_loader.py fix(cli): ensure project .env is sanitized before loading 2026-04-22 05:51:44 -07:00
gateway.py fix(gateway): drain-aware hermes update + faster still-working pings (#14736) 2026-04-23 14:01:57 -07:00
hooks.py feat(hooks): add duration_ms to post_tool_call + transform_tool_result (#15429) 2026-04-25 22:13:12 -07:00
logs.py
main.py feat(setup): auto-reconfigure on existing installs (#15879) 2026-04-25 22:02:02 -07:00
mcp_config.py
memory_setup.py
model_normalize.py fix(model-normalize): pass DeepSeek V-series IDs through instead of folding to deepseek-chat 2026-04-24 05:24:54 -07:00
model_switch.py fix(context): honor custom_providers context_length on /model switch + bump probe tier to 256K (#15844) 2026-04-25 18:47:53 -07:00
models.py feat: Add Azure Foundry provider with OpenAI/Anthropic API mode selection 2026-04-25 18:48:43 -07:00
nous_subscription.py fix(fal): extend whitespace-only FAL_KEY handling to all call sites 2026-04-21 02:04:21 -07:00
oneshot.py feat(oneshot): add --model / --provider / HERMES_INFERENCE_MODEL (#15704) 2026-04-25 08:55:36 -07:00
pairing.py fix(pairing): handle null user_name in pairing list display 2026-04-23 02:34:11 -07:00
platforms.py feat(cron): honor hermes tools config for the cron platform (#14798) 2026-04-23 15:48:50 -07:00
plugins_cmd.py feat(plugins): make all plugins opt-in by default 2026-04-20 04:46:45 -07:00
plugins.py docs(plugins): correct pre_gateway_dispatch doc text and add hooks.md section 2026-04-24 03:02:03 -07:00
profiles.py fix(profiles): stage profile imports to prevent directory clobbering 2026-04-23 03:02:34 -07:00
providers.py feat: Add Azure Foundry provider with OpenAI/Anthropic API mode selection 2026-04-25 18:48:43 -07:00
pty_bridge.py fix: mobile chat in new layout 2026-04-24 12:07:46 -04:00
runtime_provider.py feat(azure-foundry): auto-detect transport, models, context length 2026-04-25 18:48:43 -07:00
setup.py feat(setup): auto-reconfigure on existing installs (#15879) 2026-04-25 22:02:02 -07:00
skills_config.py
skills_hub.py
skin_engine.py fix(skins): don't inherit status_bar_* into light-mode skins 2026-04-22 13:20:02 -07:00
status.py fix: validate nous auth status against runtime credentials 2026-04-24 05:20:05 -07:00
timeouts.py
tips.py fix(tests): resolve 17 persistent CI test failures (#15084) 2026-04-24 03:46:46 -07:00
tools_config.py fix(tools): dedupe bundled plugin toolsets with built-in entries (#15634) 2026-04-25 05:53:08 -07:00
uninstall.py
voice.py fix(tui): ignore SIGPIPE so stderr back-pressure can't kill the gateway 2026-04-23 16:18:15 -07:00
web_server.py fix(web_server): hold _oauth_sessions_lock during PKCE session state writes 2026-04-24 15:22:04 -07:00
webhook.py