Skip to content

colab stop cannot release a session when colab sessions shows a backend assignment but local metadata has been lost #290

Done

Description

@xu756

Environment

  • Package: google-colab-cli 0.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

  1. 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.json while the backend runtime is still active.
  2. Confirm that the backend assignment still exists:
colab sessions
# Output (example):
# [?] gpu-l4-s-asso1b0-145lm5wm2e2hw | Hardware: L4 | Shape: Standard | Variant: GPU
  1. 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.
  1. 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'.
  1. 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 sessions output should include an actionable hint or a directly usable stop command for assignments that have no corresponding local session entry.

Actual Behavior

  • colab sessions displays 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 stop fails because the CLI believes there are no active sessions locally.
  • colab status agrees 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

  1. sethtroisi commented on Dec 3, 2026

    @sethtroisi
    Collaborator

    This is fixed with #315

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions