fix(chat): skip archived agent notifications

This commit is contained in:
Mohamed Boudra
2026-03-24 22:48:40 +07:00
parent 8c49f74fd9
commit 140e0ef965

View File

@@ -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)"