Dashboard › cli › Distillation
aaba9587-1e06-4b31-82ee-89e8158aaec7["lore_tm_v1_TBz7fZK6ufMx-dfrIoVstcOPCscjPFu0F2zCmFHHQA4","lore_tm_v1_NmwsGP531UEUtonBiMpQG6emSF4oy7J0CzvI7fZXrf4"]
abortPendingVersionCheck() in packages/cli/src/lib/version-check.ts aborts pendingAbortController via pendingAbortController?.abort() and then sets it to null; it is intended to allow process exit after the main CLI work completes.maybePrefetchPatches(channel, latestVersion, signal, source) in packages/cli/src/lib/version-check.ts is best-effort and returns immediately unless semverCompare(latestVersion, CLI_VERSION) === 1.maybePrefetchPatches() calls prefetchNightlyPatches(latestVersion, signal, source) for the "nightly" channel and prefetchStablePatches(latestVersion, signal, source) otherwise; prefetch errors are silently caught and logged as logger.debug("Delta patch pre-fetch failed (best-effort)", error).maybePrefetchPatches() opportunistically calls cleanupPatchCache(); cleanup failures are caught and logged as logger.debug("Patch cache cleanup failed (best-effort)", error).checkForUpdateInBackgroundImpl() in packages/cli/src/lib/version-check.ts starts a non-blocking background version check and never throws; errors are caught and reported to Sentry.shouldCheckForUpdate() throws because DB access failed, checkForUpdateInBackgroundImpl() calls Sentry.captureException(error) and returns without crashing the CLI.checkForUpdateInBackgroundImpl() creates a new AbortController, stores it in pendingAbortController, obtains its signal, and reads the release channel with getReleaseChannel().Sentry.startSpanManual() with name: "version-check", op: "version.check", and forceTransaction: true.fetchLatestNightlyVersionWithSource(signal) through GHCR, while stable uses fetchLatestFromGitHubWithSource(signal) through GitHub Releases; the returned { version: latestVersion, source } is passed to setVersionCheckInfo(latestVersion) and maybePrefetchPatches(channel, latestVersion, signal, source).{ code: 1 }; failures set it to { code: 2 }.Error instances are recorded on the span as "version_check.error" containing error.message and "version_check.error_type" containing error.constructor.name, rather than through captureException, because network failures, JSON parse errors, GitHub rate limits, and CDN errors are treated as transient infrastructure issues that should remain queryable in Discover without cluttering the Issues feed.finally block sets pendingAbortController = null and calls span.end().isStderrTTY() returns Boolean(process.stderr.isTTY). Non-TTY stderr includes scripts, CI logs, pipes, and editors capturing CLI output; update banners are suppressed there as a human-only signal, matching gh CLI behavior.notifiedThisProcess is initialized to false and prevents one process from counting or emitting the update notification more than once, including cases such as sentry help piped into less.canNotifyAgain(lastNotified) returns true when lastNotified === null; otherwise it requires Date.now() - lastNotified >= NOTIFICATION_INTERVAL_MS.getUpdateNotificationWithCopy(formatNotification) in packages/cli/src/lib/version-check.ts returns null when the CLI is up to date, cached version information is absent, notification is rate-limited, stderr is non-TTY, or an error occurs. It never throwsβerrors are caught and reported to Sentry.getUpdateNotificationWithCopy() returns a non-null message, it persists last_notified = now through markUpdateNotified, causing subsequent invocations within the rate-limit window to return null.getUpdateNotificationWithCopy() are: return null when isStderrTTY() is false, then return null when notifiedThisProcess is true. It subsequently reads { latestVersion, lastNotified } from getVersionCheckInfo() and returns null if latestVersion is absent.customFetch(: customFetch() is exported from packages/cli/src/lib/custom-ca.ts at line 305.