1 Commits
Author SHA1 Message Date
octo-patchandOctopus 84e117c5c2 fix(hooks): detect grep/read shell commands in Codex exec_command (fixes #1394)
When the Codex client sends shell work via `exec_command`, the tool name is
always `exec_command` and the actual command is under `tool_input.cmd`.  The
previous `is_grep_tool` / `is_read_file_tool` checks inspected only the tool
name and therefore never fired for Codex grep/read workflows.

Add `_GREP_SHELL_COMMANDS` and `_READ_SHELL_COMMANDS` frozensets and a helper
`_get_exec_command_name()` that extracts the basename of the first token in
`cmd`.  Both detection methods now use these to classify `exec_command` calls
when the client is `HookClient.CODEX`, leaving all other client paths unchanged.

Co-Authored-By: Octopus <liyuan851277048@icloud.com>
2026-04-30 11:54:25 +02:00