diff --git a/skills/paseo-chat/bin/chat.sh b/skills/paseo-chat/bin/chat.sh index 6ccb81bb0..5fe54655a 100755 --- a/skills/paseo-chat/bin/chat.sh +++ b/skills/paseo-chat/bin/chat.sh @@ -211,6 +211,14 @@ room_participant_ids() { awk 'NF && $0 != "manual" && !seen[$0]++' } +agent_is_archived() { + local target_agent_id="$1" + local archived_at + + archived_at="$("$paseo_bin" inspect "$target_agent_id" --json 2>/dev/null | jq -r '.ArchivedAt // empty' 2>/dev/null)" || archived_at="" + [[ -n "$archived_at" ]] +} + notify_agent() { local target_agent_id="$1" local room="$2" @@ -224,6 +232,10 @@ notify_agent() { return fi + if agent_is_archived "$target_agent_id"; then + return + fi + local sender_label if [[ -n "$sender_agent_name" ]]; then sender_label="$sender_agent_name ($sender_agent_id)"