Widgets only work after restarting custom kernel

The widgets.ipnyb notebook has examples of widgets using a custom lisp kernel with a widget interface to the python widgets:

When evaluating a cell with a call to widget there is an error:

Error displaying widget: model not found

However, restarting the kernel and running all cells then works fine, eg. the widgets are rendered and are interactive.

Is there something to include in the setup and launch of the docker image after installing the widget lab extension to ‘activate’. Currently, we use jupyter-console to add the kernel. Perhaps something is missing there.

Any hints of feedback appreciated, -Andreas

I will have to change the title here if possible since I could narrow down the issue. Widgets actually start to work after the first invocation of a widget in a notebook. The first one fails with error. Subsequent ones then work unless Run All is used to execute. There is some timing issue.

Well, it is not possible not change to title of a post after a few days.
The issue was fixed with updating the widget support in the kernel: https://github.com/yitzchak/common-lisp-jupyter/commit/92e593da34c04cb84206b4053101d1835be8e7c2