agent: fix gossip encryption detection