Skip to main content

Module version_check

Module version_check 

Source

Functions§

check_background
Spawn a background thread to fetch latest version from GitHub Releases and write the result to the lean-ctx data dir (latest-version.json). Non-blocking, fire-and-forget. Skips if cache is fresh (<24h). Respects update_check_disabled config and LEAN_CTX_NO_UPDATE_CHECK env var.
get_update_banner
Returns a formatted yellow update banner if a newer version is available. Reads only the local cache file — zero network calls, zero delay.
is_newer
SemVer precedence on MAJOR.MINOR.PATCH[-prerelease]: a prerelease sorts before its release (3.12.1-dogfood.9 < 3.12.1). Splitting the whole string on . read 3.12.1-dogfood.9 as 3.12.9, so dogfood and rc builds never saw their own release as an update.
session_update_hint
Returns a one-line update notification if available, exactly once per session. Safe to call from any tool — returns None after first notification.
version_info_json
Returns version info as JSON for the dashboard /api/version endpoint. Includes the cache age so the UI can be honest about staleness (#563).