Repository navigation
feat: colab attach uses a web UI runtime as a local session - #20
Merged
Merged
Conversation
A runtime opened in the Colab web UI (or by colab on another computer) is listed by `colab sessions` as `[?]`, but no command could work on it: there was no way to upload a file to a notebook's runtime from the CLI. `colab attach --endpoint ID [-s NAME]` saves it as a local session from the assignment's proxy URL and token, so `colab upload`, `exec`, `ssh` and scp through `colab ssh --proxy-mode` work on it. The CLI runs code in its own kernel; files under /content are shared with the notebook. In the tray, the card of such a runtime gets a Connect button. Tested live: a runtime started in the web UI was attached, files were uploaded with `colab upload`, over `colab ssh -- sh -c 'cat > ...'` and with Windows OpenSSH scp, and all three showed in the notebook's Files panel; the runtime was then stopped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
A runtime opened in the Colab web UI (or by colab on another computer) shows as
[?]incolab sessions, but no command could work on it, so a file could not be uploaded to a notebook's runtime from the CLI.colab attach --endpoint ID [-s NAME]saves it as a local session from the assignment's proxy URL and token (/tun/m/assignments). Thencolab upload,colab exec,colab sshand scp throughcolab ssh --proxy-modework on it. The CLI runs code in its own kernel;/contentis shared with the notebook.colab stop -s NAMEstops it in the web UI too.web-<id>; already a session: says which (exit 0); unknown endpoint: exit 1; name taken: exit 2.colab attach --endpoint), next to Stop.Tests
tests/test_attach.py(saved fields, default name, errors), tray panel/actions tests. Full suite: 1294 passed.colab upload, overcolab ssh -- sh -c 'cat > /content/...'and with Windows OpenSSHscpviaProxyCommand=colab ssh --proxy-mode; all three showed in the notebook's Files panel. Runtime stopped afterwards,colab sessionsempty.🤖 Generated with Claude Code