fix(hooks): use Codex plugin root - #4
Conversation
Resolve both Warp plugin hook manifests through CLAUDE_PLUGIN_ROOT, quote paths safely, and cover SessionStart and Stop outside Warp and Oz.
There was a problem hiding this comment.
Overview
Swaps hook manifests from the unset ${PLUGIN_ROOT} to ${CLAUDE_PLUGIN_ROOT} (quoting the path for spaces), bumps both plugin versions to 0.4.1, and adds contract tests. Net position: no blocking issues found.
Concerns
- The hooks now reference only
${CLAUDE_PLUGIN_ROOT}, dropping${PLUGIN_ROOT}entirely. If a Codex release sets only the latter (as some third-party plugin docs suggest for "native" Codex behavior), the same exit-127 failure could recur. A fallback such as"${CLAUDE_PLUGIN_ROOT:-$PLUGIN_ROOT}"would be more resilient across Codex versions, though the PR's live verification against the bundled Codex build mitigates this for now.
Verdict
Checks: build n/a (shell/JSON only), tests pass (51/51 via bash tests/test-hooks.sh, verified locally including a reproduction that the new contract test fails with exit 127 against the pre-fix hooks.json), CI pending/not reported on the fork PR, visual proof n/a (no UI change)
Found: 0 critical, 0 important, 1 suggestion, 1 nit
| assert_contains "warp hooks use CLAUDE_PLUGIN_ROOT" "$(cat "$REPO_ROOT/plugins/warp/hooks/hooks.json")" '${CLAUDE_PLUGIN_ROOT}/scripts/on-session-start.sh' | ||
| assert_contains "warp hooks include prompt submit" "$(cat "$REPO_ROOT/plugins/warp/hooks/hooks.json")" '${CLAUDE_PLUGIN_ROOT}/scripts/on-prompt-submit.sh' | ||
| assert_contains "warp hooks include post tool use" "$(cat "$REPO_ROOT/plugins/warp/hooks/hooks.json")" '${CLAUDE_PLUGIN_ROOT}/scripts/on-post-tool-use.sh' | ||
| assert_contains "oz hooks use CLAUDE_PLUGIN_ROOT" "$(cat "$REPO_ROOT/plugins/orchestration/hooks/hooks.json")" '${CLAUDE_PLUGIN_ROOT}/scripts/drain-mailbox.sh' |
There was a problem hiding this comment.
nit: this assertion dropped the trailing UserPromptSubmit argument that the old "oz hooks use PLUGIN_ROOT" check verified, so it no longer confirms the argument survived the switch to a quoted path. Consider asserting the full string, e.g. '\"${CLAUDE_PLUGIN_ROOT}/scripts/drain-mailbox.sh\" UserPromptSubmit'.
Summary
Reproduction
Codex supplies CLAUDE_PLUGIN_ROOT. Version 0.4.0 expands PLUGIN_ROOT to an empty string, tries /scripts/on-session-start.sh and /scripts/on-stop.sh, and exits 127.
Verification