Skip to content

Automatically refresh runtime tokens - #149

Merged
sethtroisi merged 3 commits into
mainfrom
refresh-proxy-token
Sep 25, 2026
Merged

sethtroisi merged 3 commits into
mainfrom
refresh-proxy-token

Conversation

@EvanWiederspan

Copy link
Copy Markdown
Contributor

Store the expiration of the runtime token in the session, and before making any calls to the backend, check whether it's nearly expired, and fetch a fresh one if so.

Fixes #147, #140, #106

Inspired by PRs #136, #123, #109

The runtime proxy token expires after an hour, so any command run against a
session older than that failed. Persist the token's absolute expiry and, when
loading a session for VM access, re-fetch the token from /tun/m/assignments
if it is missing or within 5 minutes of expiring.
A script can run longer than the proxy token lives, so the kernel shutdown at
the end of colab run would fail with the token captured at creation.
Nearly every get_session caller repeated the same not-found echo and exit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants