fix: salvage remaining stale queue fixes (#1754)

This commit is contained in:
Affaan Mustafa
2026-05-11 16:41:08 -04:00
committed by GitHub
parent 4e88912a58
commit c45aeee57f
12 changed files with 267 additions and 83 deletions

View File

@@ -12,8 +12,20 @@
set -e
# Hook phase from CLI argument: "pre" (PreToolUse) or "post" (PostToolUse)
HOOK_PHASE="${1:-post}"
# Hook phase from CLI argument: "pre" (PreToolUse) or "post" (PostToolUse).
# Manual settings.json installs can call this script without the plugin
# wrapper's positional phase argument, but Claude Code still exposes the hook
# event name in CLAUDE_HOOK_EVENT_NAME. Fall back to that env var before
# defaulting to post so manually registered PreToolUse hooks are recorded as
# tool_start instead of being silently misclassified as tool_complete.
HOOK_PHASE="${1:-}"
if [ -z "$HOOK_PHASE" ]; then
case "${CLAUDE_HOOK_EVENT_NAME:-}" in
PreToolUse|pretooluse|pre_tool_use|pre) HOOK_PHASE="pre" ;;
PostToolUse|posttooluse|post_tool_use|post) HOOK_PHASE="post" ;;
*) HOOK_PHASE="post" ;;
esac
fi
# ─────────────────────────────────────────────
# Read stdin first (before project detection)