Repository navigation
Description
Environment
- Package:
google-colab-cli0.8.0 - Platform: Linux (Ubuntu)
- Account: Pro
- Commands involved:
colab sessions,colab stop,colab status
Description
The CLI does not provide a way to stop a Colab runtime that is still visible in colab sessions when the local session name is no longer known or the local metadata has been lost. This can happen if the session was created without -s NAME, or if ~/.config/colab-cli/sessions.json was pruned or deleted.
colab sessions lists backend assignments (per official documentation: “List all active sessions currently active on the backend”), but colab stop -s NAME expects the local session name. When the local name is unavailable, there is no documented fallback to stop the backend assignment directly.
Steps to Reproduce
- Start a session on a GPU runtime in a way that leaves no recoverable local session name—for example, create a session without
-s, or remove/prune~/.config/colab-cli/sessions.jsonwhile the backend runtime is still active. - Confirm that the backend assignment still exists:
colab sessions
# Output (example):
# [?] gpu-l4-s-asso1b0-145lm5wm2e2hw | Hardware: L4 | Shape: Standard | Variant: GPU- Attempt to stop the session using the backend assignment identifier shown by
colab sessions:
colab stop -s gpu-l4-s-asso1b0-145lm5wm2e2hw
# Output:
# [colab] Session 'gpu-l4-s-asso1b0-145lm5wm2e2hw' not found.- Attempt to stop without a session name, relying on the “only one active session” fallback:
colab stop
# Output:
# [colab] Error: No active sessions found. Create one with 'colab new'.- Confirm the CLI does not consider the session “active” locally:
colab status
# Output:
# [colab] No active sessions.Expected Behavior
One of the following should be possible when a backend assignment exists but no local session name is available:
- A way to stop a session by the backend assignment ID listed in
colab sessions(e.g.,colab stop --assignment <id>). colab stop(without-s) should recognize backend-only assignments and either stop the single remaining one or list them for user selection.- At minimum,
colab sessionsoutput should include an actionable hint or a directly usable stop command for assignments that have no corresponding local session entry.
Actual Behavior
colab sessionsdisplays the backend assignment, confirming that compute resources are still allocated and potentially billing.colab stop -s <backend-id>fails because the backend ID is not a local session name.colab stopfails because the CLI believes there are no active sessions locally.colab statusagrees with the local view and shows “No active sessions.”- The user has no supported CLI path to release the runtime shown by
colab sessions.
Additional Context
The documentation states that colab sessions lists sessions “currently active on the backend,” while colab stop expects a local -s NAME and only offers an implicit fallback “when only one session is active” (presumably meaning active locally). This creates a gap when local metadata is incomplete or lost. A user may be paying for a GPU runtime they can see but cannot stop.
If stopping by backend assignment ID is not feasible, a clear diagnostic message from colab stop (e.g., “1 backend assignment exists without local metadata; use colab sessions to inspect, then stop via the Colab web UI or recreate the local session”) would at least make the situation recoverable.
Activity
sethtroisi commentedon Dec 3, 2026
This is fixed with #315