From f29bce02e3dacd0e101c005361ec2ff72f992fdb Mon Sep 17 00:00:00 2001 From: Ron Amihai Date: Mon, 23 Feb 2026 13:31:30 +0200 Subject: [PATCH] Fix prompt extraction in Stop hook notifications The prompt extraction uses .message.content which returns the raw JSON content blocks array instead of extracting the text values. This applies the same content block parsing pattern already used for response extraction. Co-Authored-By: Claude Opus 4.6 --- plugins/warp/scripts/on-stop.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/warp/scripts/on-stop.sh b/plugins/warp/scripts/on-stop.sh index 2a45dd9..3989e54 100755 --- a/plugins/warp/scripts/on-stop.sh +++ b/plugins/warp/scripts/on-stop.sh @@ -17,7 +17,8 @@ MSG="Task completed" if [ -n "$TRANSCRIPT_PATH" ] && [ -f "$TRANSCRIPT_PATH" ]; then # Get the first user prompt PROMPT=$(jq -rs ' - [.[] | select(.type == "user")] | first | .message.content // empty + [.[] | select(.type == "user")] | first | + [.message.content[] | select(.type == "text") | .text] | join(" ") ' "$TRANSCRIPT_PATH" 2>/dev/null) # Get the last assistant response