Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions apps/desktop/src/main/lib/agent-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down