mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-11 12:29:04 +00:00
Codex's documented hook wiring only routes `serena-hooks remind` through PreToolUse on the `Bash` matcher, so `ToolUseCounter.update()`'s reset-on-Serena-tool-use branch is never reached there: it only fires when `remind` itself is invoked for a `mcp__serena__*` tool name, which the Bash-only matcher excludes. Reminder counters therefore never clear after a successful Serena call, and an unrelated grep/read burst afterwards can trip the deny threshold on state that should have been reset. Add a `serena-hooks reset` command, wired to PostToolUse on Serena's own tools, that resets the counters after a successful call. Gated on the call having succeeded (`tool_response` carrying no `isError: true`, the MCP `tools/call` result shape) so a failed Serena call does not mask a real grep/read streak, per the issue's own acceptance criteria. The symbolic-tool classification is shared with the existing PreToolUse hook via a small extracted helper so both agree on what counts as a Serena tool. Fixes #1852