From 8200c1bda478bb04a80b1769d9e6576b4ea9c0b0 Mon Sep 17 00:00:00 2001 From: Satya Patel Date: Mon, 1 Dec 2025 11:59:20 -0800 Subject: [PATCH] Fix Codex notifications not triggering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Codex passes notification JSON as a command-line argument while Claude pipes it to stdin. The notify script was only reading from stdin, causing Codex notifications to never fire. - Check for $1 argument first (Codex), fall back to stdin (Claude) - Handle Codex's "type": "agent-turn-complete" event format - Map Codex event type to "Stop" for consistent handling 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- apps/desktop/src/main/lib/agent-setup.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/main/lib/agent-setup.ts b/apps/desktop/src/main/lib/agent-setup.ts index d9c436daa8b..e4b5b131c65 100644 --- a/apps/desktop/src/main/lib/agent-setup.ts +++ b/apps/desktop/src/main/lib/agent-setup.ts @@ -41,9 +41,22 @@ function createNotifyScript(): void { # Only run if inside a Superset terminal [ -z "$SUPERSET_TAB_ID" ] && exit 0 -# Read JSON from stdin and extract hook_event_name -INPUT=$(cat) +# Get JSON input - Codex passes as argument, Claude pipes to stdin +if [ -n "$1" ]; then + INPUT="$1" +else + INPUT=$(cat) +fi + +# Extract event type - Claude uses "hook_event_name", Codex uses "type" EVENT_TYPE=$(echo "$INPUT" | grep -o '"hook_event_name":"[^"]*"' | cut -d'"' -f4) +if [ -z "$EVENT_TYPE" ]; then + # Check for Codex "type" field (e.g., "agent-turn-complete") + CODEX_TYPE=$(echo "$INPUT" | grep -o '"type":"[^"]*"' | cut -d'"' -f4) + if [ "$CODEX_TYPE" = "agent-turn-complete" ]; then + EVENT_TYPE="Stop" + fi +fi # Default to "Stop" if not found [ -z "$EVENT_TYPE" ] && EVENT_TYPE="Stop"