Add kernel-session cancellation via --session-id
Problem
kaggle kernels has no command for stopping an accidentally submitted run. The public API already exposes ApiCancelKernelSessionRequest, but the public CLI does not expose it.
Reproduction and API boundary
With kaggle==2.2.4, kaggle kernels --help exposes no cancellation command.
I also validated the existing status endpoint against a real private CPU kernel while it was RUNNING: its raw response contains status and failureMessage, but no kernelSessionId. GetKernel likewise exposes metadata and source but no current session identity. Therefore closed PR #967 cannot reliably implement a kernel-reference form by extracting an ID from the public status response.
The Kaggle editor has a separate internal API that returns run IDs, but the CLI should not depend on that undocumented web API.
Requested behavior
Add the small supported public-API wrapper:
kaggle kernels cancel --session-id SESSION_IDIt should invoke the existing cancel-session endpoint, surface its error message, and not delete the kernel, inputs, or historical outputs.
A future kaggle kernels cancel OWNER/KERNEL-SLUG needs a public API contract that resolves a kernel reference to a cancellable session ID; that is intentionally out of scope here.
Proposed contribution
I will submit a focused CLI command with parser and API-wrapper tests. The implementation will use only the supported generated SDK request, not raw web requests.
Source: Kaggle/kaggle-cli