Repository navigation
feat(session): allow stopping untracked backend assignments via --endpoint - #317
Closed
Milabo-HRH wants to merge 1 commit into
Closed
Milabo-HRH wants to merge 1 commit into
Milabo-HRH wants to merge 1 commit into
Conversation
sethtroisi
approved these changes
Dec 3, 2026
Collaborator
|
You can stop untracked backends with I do like isn't doing anything and this is already possible. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #290 (and provides the direct orphan-termination fallback requested in #263).
Problem
When local session metadata is missing (e.g.,
sessions.jsonwas removed orcolab newtimed out after server-side provisioning),colab sessionsdisplays the active runtime as[?] <endpoint>, butcolab stoponly resolves locally tracked session names and has no way to terminate that backend assignment.Fix
--endpoint <endpoint>tocolab stop(mutually exclusive with-s/--sessionand--all).<endpoint>belongs to a locally tracked session, terminates it via_stopOne(keeping local state in sync).<endpoint>matches an untracked[?]backend assignment, attempts best-effort kernel shutdown, callsclient.unassign(endpoint), and logs the termination event.<endpoint>is not found among active backend assignments, prints an actionable error and exits 1 without callingunassign.colab stop --allremains scoped to locally tracked CLI sessions so untracked browser runtimes are never terminated unexpectedly.Testing
tests/test_cli.pycovering untracked backend assignment termination, tracked session lookup by endpoint, missing endpoint error, and mutual-exclusion checks with-s/--all.ruff format --check src/colab_cli/commands/session.py tests/test_cli.py-> clean.pytest -q tests-> 683 passed, 27 skipped (includingtest_cli_help_commands_sorted_alphabetically).