Dashboard › cli › Distillation
66ade2d2-c29b-48be-8fe6-17425bc3cf8d["lore_tm_v1_153awhAj9xJ_OsLJmRRCScYt31GpFGM4iR5IKHrcKl8","lore_tm_v1_omshsW1efft-xicwZitXnKNIW-GA9TVQaXLz_DopAbk","lore_tm_v1_vS5AaDdrK35VbBlQN6NlpIk5SRhRixy40q7TwkPdbjM"]
Date: September 10, 2026
packages/cli/src/lib/upgrade.ts expanded from 124 to 222 lines in the shown opening section and added prerelease as semverPrerelease and valid as semverValid imports from semver, plus source-aware upgrade machinery including compareVersions.packages/cli/src/lib/upgrade.ts added source-aware pinned-version validation paths, including validatePinnedGitHubRelease(response, version, source), OCI-manifest handling with manifest: OciManifest, and expected tag construction as `${source.tagPrefix}${version}`.packages/cli/src/lib/upgrade.ts now follows pagination in a while (true) loop and returns nextPage.href when advancing to another page.isNightlyVersion(version) and can report "No version found in GitHub release" when release metadata lacks a version.packages/cli/src/lib/version-check.ts expanded from 391 to 396 lines and added the type-only import UpgradeSource from ./binary.js.fetchLatestFromGitHub and fetchLatestNightlyVersion with fetchLatestFromGitHubWithSource and fetchLatestNightlyVersionWithSource. Both now return { version: latestVersion, source }, preserving the selected source after discovery.maybePrefetchPatches(channel, latestVersion, signal, source) now requires source: UpgradeSource; nightly calls prefetchNightlyPatches(latestVersion, signal, source) and stable calls prefetchStablePatches(latestVersion, signal, source).semverCompare(latestVersion, CLI_VERSION) === 1, catches failures, logs logger.debug("Delta patch pre-fetch failed (best-effort)", error), and then opportunistically cleans stale cached patches.checkForUpdateInBackgroundImpl() never throws: βNever throws - errors are caught and reported to Sentry.βcheckForUpdateInBackgroundImpl() catches failures from shouldCheckForUpdate(), calls Sentry.captureException(error), and returns so database-access failures do not crash the CLI."version-check" with operation "version.check" and forceTransaction: true.latestVersion through setVersionCheckInfo(latestVersion), prefetches source-affine delta patches, and marks the span OK with span.setStatus({ code: 1 }).AbortErrors. Other Error instances are recorded as span attributes version_check.error and version_check.error_type, rather than via captureException, because network failures, JSON parse failures, GitHub rate limits, and CDN errors are treated as transient infrastructure issues that should remain queryable in Discover without cluttering the Issues feed.span.setStatus({ code: 2 }); cleanup always sets pendingAbortController = null and calls span.end().getUpdateNotificationWithCopy() βNever throws β errors are caught and reported to Sentry.βgetUpdateNotificationWithCopy(formatNotification) returns null when the CLI is up to date, cached version information is unavailable, notification is rate-limited, stderr is not a TTY, or an error occurs.getUpdateNotificationWithCopy() first gates on isStderrTTY() so scripts, CI runs, and pipes receive no update notification.getUpdateNotificationWithCopy() returns a non-null notification, it persists last_notified = now through markUpdateNotified; notifiedThisProcess ensures a process that reads the notification through multiple code paths counts as notified only once.