Skip to content

fix(hooks): use Codex plugin root - #4

Closed
tgxiii wants to merge 1 commit into
warpdotdev:mainfrom
tgxiii:fix/codex-hook-root
Closed

fix(hooks): use Codex plugin root#4
tgxiii wants to merge 1 commit into
warpdotdev:mainfrom
tgxiii:fix/codex-hook-root

Conversation

@tgxiii

@tgxiii tgxiii commented Aug 31, 2026

Copy link
Copy Markdown

Summary

  • resolve Warp and orchestration hook commands through CLAUDE_PLUGIN_ROOT
  • quote plugin paths so installations under paths with spaces work
  • bump both plugins to 0.4.1
  • execute SessionStart and Stop manifest commands for both plugins in the shell suite

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

  • 51 hook tests passed
  • spaced-path contract tests passed with legacy and capability environment variables removed
  • bundled Codex 0.150.0-alpha.12.2 completed a live turn with five SessionStart and four Stop hooks and no failures
  • independent review: no findings

Resolve both Warp plugin hook manifests through CLAUDE_PLUGIN_ROOT, quote paths safely, and cover SessionStart and Stop outside Warp and Oz.

@warp-factories warp-factories Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread tests/test-hooks.sh
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'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'.

@tgxiii tgxiii closed this Aug 31, 2026
@tgxiii
tgxiii deleted the fix/codex-hook-root branch August 31, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant