Implement vanilla distance threshold for AI processing (Bug #1876)