I discovered the issue during
JENKINS-37566. `Channel#current()` uses thread-local storage to determine the current channel. It returns null if the channel does not exist Some writeReplace/readObject/etc. serialization logic retrieves the channel in order to export the object via ExportTable. Obviously, such operations will fail if we try to serialize the object without Remoting context.
I propose to add a new interface to verify that serialization logic is being invoked for the remoting context and hence to avoid undesired NPEs