#!/bin/bash # stop: log agent completion/abort/error HOOKS_DIR="$(cd "$(dirname "$0")" && pwd)" # shellcheck source=lib.sh . "${HOOKS_DIR}/lib.sh" input=$(cat) status=$(echo "$input" | jq -r '.status // "?"') loop_count=$(echo "$input" | jq -r '.loop_count // 0') conversation_id=$(echo "$input" | jq -r '.conversation_id // "?"') log_event "stop" "conversation_id=$conversation_id status=$status loop_count=$loop_count" echo '{}' exit 0