small gleam coding and (not yet) persistent agent daemon with a detachable cli forked from okami.mom/albedo
albedo robot-docs colab.md
2.1 kB · 51 lines
Markdown
at main

Colab #

The Colab extension depends on remote. It provides account login and the kernel's colab binding. See the kernel for execution context.

Account access #

The extension's colab.account route calls accounts.signed_in and returns an access token and email to the kernel. The kernel does not need to read creds.json, but it does receive the token. accounts.gleam owns account selection and token handling.

Runtimes and connections #

The Python plugin provides instances, status, launch, stop, and connect. connect fetches a current runtime listing, finds an SSH public key, registers an alias, and calls remote.connect. Its websocket proxy URL and public key reach the bridge through environment variables. The alias disables SSH host key checking for that connection.

A failed connection can raise ColabSshSessionError after a probe identifies an occupied SSH session. stop sends an unassign request and removes the alias. It is a runtime-management operation, not a connection retry. Recover needed files before requesting it.

Outbound routing #

The colab outbound route covers control and runtime HTTP calls, downloads, session probes, and the SSH websocket bridge. Each operation asks the daemon for the route; an SSH alias keeps the one connect saw. The proxy must be reachable from the kernel's machine, which for a remote kernel is not the daemon's.

HTTP file access #

The same plugin provides runtime_status, contents, read, and pull independently of SSH. Paths are relative to the Jupyter root. pull can resume a partial download. Resume assumes the remote content has not changed. Use resume=False for mutable content. Plugin tests exercise the client with a fake HTTP layer.