Workflow
Automated GPU jobs need a way to stop a stale or runaway kernel session without deleting the kernel or using the web UI. The public SDK already exposes ApiCancelKernelSessionRequest at POST /api/v1/kernels/cancel-session/{kernel_session_id}, but the official CLI has no corresponding kaggle kernels command.
kaggle kernels push already prints the numeric versionNumber; that value is accepted by the cancellation endpoint as the kernel session id.
Expected CLI
kaggle kernels cancel <SESSION_ID>
The command should issue the existing SDK cancellation request and report that cancellation was requested. It should reject non-positive IDs and surface a backend rejection.
Proposed scope
A small wrapper in KaggleApi, an argparse subcommand, focused unit coverage, and one documentation section. No change to the backend API or existing CLI behavior.
I have a tested implementation ready and can open a PR.
Workflow
Automated GPU jobs need a way to stop a stale or runaway kernel session without deleting the kernel or using the web UI. The public SDK already exposes
ApiCancelKernelSessionRequestatPOST /api/v1/kernels/cancel-session/{kernel_session_id}, but the official CLI has no correspondingkaggle kernelscommand.kaggle kernels pushalready prints the numericversionNumber; that value is accepted by the cancellation endpoint as the kernel session id.Expected CLI
The command should issue the existing SDK cancellation request and report that cancellation was requested. It should reject non-positive IDs and surface a backend rejection.
Proposed scope
A small wrapper in
KaggleApi, an argparse subcommand, focused unit coverage, and one documentation section. No change to the backend API or existing CLI behavior.I have a tested implementation ready and can open a PR.