Skip to content

Do not advertise kernel subshell support - #42603

Open
cxzhong wants to merge 1 commit into
sagemath:developfrom
cxzhong:fix-42567-disable-kernel-subshells
Open

Do not advertise kernel subshell support#42603
cxzhong wants to merge 1 commit into
sagemath:developfrom
cxzhong:fix-42567-disable-kernel-subshells

Conversation

@cxzhong

@cxzhong cxzhong commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Description

Sage now removes kernel subshells from the features advertised in its
kernel_info_reply.

With ipykernel 7, advertising this feature allows JupyterLab to route widget
comm messages to a kernel subshell running in another OS thread. Sage libraries
are not generally safe to enter from arbitrary threads; in particular, the
@interact example in the issue reaches cypari2/PARI from that thread and
segfaults after the initial evaluation.

Filtering the unsupported feature keeps these callbacks on the main kernel
shell while preserving the other features reported by ipykernel.

Fixes #42567.

Validation

  • ./sage -t --force-lib src/sage/repl/ipython_kernel/kernel.py (16 tests passed)
  • Started a temporary Sage kernel and verified that its advertised features
    contain debugger but not kernel subshells
  • git diff --check

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

Documentation is unchanged because this only corrects kernel feature
negotiation.

⌛ Dependencies

None.

@github-actions

Copy link
Copy Markdown

Documentation preview for this PR (built with commit e10c753; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@cxzhong
cxzhong force-pushed the fix-42567-disable-kernel-subshells branch from e10c753 to ed73034 Compare August 5, 2026 02:58
@cxzhong
cxzhong marked this pull request as ready for review August 5, 2026 02:58
@cxzhong
cxzhong requested a review from tobiasdiez August 5, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Segfault when finding polynomial roots in @interact

1 participant