Moved over from jupyterlab/jupyterlab#4777
TL;DR: Currently the only indication you get that something is wrong is repeated messages Adapting to protocol v5.1 for kernel
in the logs. At a minimum it would be good to log a warning that the websocket was disconnected and if at all possible to log any other relevant debug information to help track down the issue when it occurs.