Skip to content

Add kaggle kernels cancel CLI command#967

Open
kaggle-agent wants to merge 1 commit intomainfrom
agent/bovard-20260410183538-881cb118
Open

Add kaggle kernels cancel CLI command#967
kaggle-agent wants to merge 1 commit intomainfrom
agent/bovard-20260410183538-881cb118

Conversation

@kaggle-agent
Copy link
Copy Markdown
Collaborator

Users need to cancel accidentally submitted notebook runs from the
command line. The SDK already has cancel_kernel_session() but it
wasn't exposed in the CLI. This wires up the cancel flow by first
fetching the session ID from the status endpoint, then calling the
SDK's cancel method.

Co-authored-by: kaggle-agent kaggle-agent@users.noreply.github.com


Task: bovard-20260410183538-881cb118
Context: https://chat.kaggle.net/kaggle/pl/5nsf9u1kptrydpokxnrmijxeow

Users need to cancel accidentally submitted notebook runs from the
command line. The SDK already has `cancel_kernel_session()` but it
wasn't exposed in the CLI. This wires up the cancel flow by first
fetching the session ID from the status endpoint, then calling the
SDK's cancel method.

Co-authored-by: kaggle-agent <kaggle-agent@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@stevemessick stevemessick left a comment

Choose a reason for hiding this comment

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

Since the tests don't hit the server, they don't really test kernelSessionId. So, I'm checking with others to see if this really works. If you already tested it @bovard , let me know and I'll approve.

http_response.raise_for_status()
response_data = http_response.json()

kernel_session_id = response_data.get("kernelSessionId")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@rosbo @jplotts Can either of you confirm that we actually have "kernelSessionId" in the Http Response object? It doesn't show up in VERBOSE output from kaggle k status ..., but that might not print everything.

@Kaggle Kaggle deleted a comment from pa1818e-lang Apr 17, 2026
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.

3 participants