Replies: 2 comments
-
|
yea we have |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
@sethtroisi and @spencersgoogle fyi |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I’d like to propose adding a CLI command that lets users adopt an already-active Colab backend session into local
google-colab-clistate.Proposed command:
After adoption, the existing backend session could be used with the normal CLI workflow:
colab status -s browser-session colab exec -s browser-session -f train.py colab console -s browser-session colab url -s browser-session --openProblem
Right now,
colab sessionscan show active backend assignments, including sessions that were not originally created by the CLI on the current machine/config.However, if a backend session is not present in local
sessions.json, there does not appear to be a supported way to assign it a local session name and continue using it through the CLI.That means a user can have an active Colab runtime, see it from the CLI, but not cleanly run:
colab exec -s my-existing-session -f script.pyunless the CLI created that session originally.
Why this matters
The new Colab CLI is especially useful for terminal-based, scripted, and agentic workflows.
In real workflows, though, users and agents do not always start from a clean
colab new.Common cases:
Being able to adopt an existing backend session would make this handoff much smoother.
Proposed behavior
Adopt by endpoint
This would write a local
SessionStateentry for the selected backend assignment.Adopt automatically when only one untracked backend exists
If exactly one untracked backend assignment exists, the CLI can adopt it without requiring
--endpoint.Require endpoint when multiple untracked backends exist
If multiple untracked backend sessions exist, the command should fail with guidance:
Conflict handling
If the endpoint is already tracked under another local session name, the command should fail unless
--forceis provided.If the same name already points to the same endpoint, the command should be idempotent and exit successfully without side effects.
Keep-alive
By default, adoption should start the same keep-alive behavior used by CLI-created sessions.
Users should also be able to skip that:
Prototype
I implemented this in a fork to validate the behavior:
https://github.com/Formatted/google-colab-cli/tree/adopt-existing-session
The prototype includes:
colab adopt -s NAME--endpoint--force--no-keep-aliveStateStoretest provingstatusworks after adoptionLocal test suite result:
I know this repo is not currently accepting external PRs, so I’m posting this here as a feature request / design discussion rather than opening a PR.
Open questions
Would maintainers expect this command to be named
adopt,attach, or something else?Should adoption start keep-alive by default, or should it only persist local state?
Should
colab sessionsinclude a hint when it displays an untracked session, such as:Request
Would this be useful as a supported CLI workflow?
I’d love feedback from maintainers and Colab CLI users on whether adopting existing backend sessions should be first-class behavior.
Beta Was this translation helpful? Give feedback.
All reactions