def _get_socket_keepalive_options(self) -> dict:
        """Get socket keepalive options based on the OS.

        Returns empty dict for macOS to avoid socket option errors.
        Returns proper TCP keepalive settings for Linux.
        """
        if platform.system() == "Darwin":  # macOS
            return {}
        else:  # Linux and others
            # Use the correct Linux TCP keepalive constants
            # TCP_KEEPIDLE = 4
            # TCP_KEEPINTVL = 5
            # TCP_KEEPCNT = 6

            if hasattr(socket, "TCP_KEEPIDLE"):
                return {
                    socket.TCP_KEEPIDLE: 60,  # Start keepalive after 60s idle
                    socket.TCP_KEEPINTVL: 10,  # Interval between keepalive probes
                    socket.TCP_KEEPCNT: 6,  # Number of keepalive probes
                }
            else:
                # Fallback for systems without these constants
                return {}
Get socket keepalive options based on the OS.

        Returns empty dict for macOS to avoid socket option errors.
        Returns proper TCP keepalive settings for Linux.
        
backend/airweave/core/redis_client.py