Skip to content

Handle absent target name in comm info request#1072

Open
lionel- wants to merge 1 commit intomainfrom
feature/comm-info-all-comms
Open

Handle absent target name in comm info request#1072
lionel- wants to merge 1 commit intomainfrom
feature/comm-info-all-comms

Conversation

@lionel-
Copy link
Contributor

@lionel- lionel- commented Mar 2, 2026

Progress towards #1069.

The target_name field of comm_info_request is optional in the Jupyter protocol. When absent, the server should provide info for all comms.

Currently we're treating "" as the all comm sentinel, but the protocol really specifies the field as optional (can be absent). To fix this, the field is now an Option<String> instead of a String.

@lionel- lionel- requested a review from DavisVaughan March 2, 2026 13:50
#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct CommInfoRequest {
pub target_name: String,
#[serde(default)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed to make the field truly optional, so it can be absent from the json.

In the other PR, even though the fields are technically required within each variant type, the protocol also notes:

Most of the history messaging options are not used by Jupyter frontends, and many kernels do not implement them. If you’re implementing these messages in a kernel, the ‘tail’ request is the most useful; this is used by the Qt console, for example. The notebook interface does not use history messages at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants