Environment: notebook-intelligence 6.1.0, nb_conda_kernels installed in the same conda env (default configuration), JupyterHub single-user server.
Problem
nb_conda_kernels lists kernelspecs from conda environments under its own names and removes the original names from the server's kernel list. chatbook becomes conda-base-chatbook ("Chatbook [conda env:base] *"), and python3 becomes conda-base-py. Chatbook fails with these names:
- Running any cell in a Chatbook notebook fails with
Chatbook backend kernel 'conda-base-py' is not installed. Choose an installed kernelspec in Settings → Chatbook. Yet conda-base-py is what Settings → Chatbook offers. python3 isn't offered at all, because the server doesn't list it.
- When the backend does resolve (for example, the setting is empty and the kernel falls back to the plain
python3 spec on disk), cells never finish. They stay at [*] with no output and no Run confirmation.
Cause
- The Chatbook kernel lists and starts backend kernels with a plain
jupyter_client.kernelspec.KernelSpecManager() (chatbook_kernel/backend.py: load_kernel_specs(), ChatbookBackend.start()). The Settings UI lists kernels from the server's configured kernelspec manager (nb_conda_kernels.CondaKernelSpecManager), so the two sides use different names.
- The frontend and server extension recognize Chatbook only by the exact kernelspec name
chatbook. In the frontend this covers session detection (the execute wrapper, IOPub handling, toolbar), the "New Chatbook" command (which requests kernel chatbook) and the backend dropdown filter. In the server extension it covers the execution-mode cap and NBI_CHATBOOK_POLICY=force-off. None of these apply to conda-base-chatbook.
What needs to be fixed
- Resolve and start backend kernels with the same kernelspec manager (class and config) as the Jupyter server, so backend names match the ones the UI offers.
- Identify Chatbook kernels by kernelspec language (
chatbook) instead of by name, in both the frontend and the server extension. Create new Chatbooks by language, and exclude Chatbook kernels from the backend list.
I have a working patch for both and can open a PR.
Environment: notebook-intelligence 6.1.0, nb_conda_kernels installed in the same conda env (default configuration), JupyterHub single-user server.
Problem
nb_conda_kernels lists kernelspecs from conda environments under its own names and removes the original names from the server's kernel list.
chatbookbecomesconda-base-chatbook("Chatbook [conda env:base] *"), andpython3becomesconda-base-py. Chatbook fails with these names:Chatbook backend kernel 'conda-base-py' is not installed. Choose an installed kernelspec in Settings → Chatbook.Yetconda-base-pyis what Settings → Chatbook offers.python3isn't offered at all, because the server doesn't list it.python3spec on disk), cells never finish. They stay at[*]with no output and no Run confirmation.Cause
jupyter_client.kernelspec.KernelSpecManager()(chatbook_kernel/backend.py:load_kernel_specs(),ChatbookBackend.start()). The Settings UI lists kernels from the server's configured kernelspec manager (nb_conda_kernels.CondaKernelSpecManager), so the two sides use different names.chatbook. In the frontend this covers session detection (the execute wrapper, IOPub handling, toolbar), the "New Chatbook" command (which requests kernelchatbook) and the backend dropdown filter. In the server extension it covers the execution-mode cap andNBI_CHATBOOK_POLICY=force-off. None of these apply toconda-base-chatbook.What needs to be fixed
chatbook) instead of by name, in both the frontend and the server extension. Create new Chatbooks by language, and exclude Chatbook kernels from the backend list.I have a working patch for both and can open a PR.