Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [6.8.2] - 2026-09-04

### Fixed

- **Update check now invalidates stale cache when the running version is newer than the cached `latest`.** Previously, a cached `latest` older than the running version (e.g. after `npm install -g` from another terminal) would hide a genuinely newer release until the 1-hour TTL expired. The cache is now treated as stale whenever `cached.latest < current`, forcing an immediate re-fetch.

## [6.8.1] - 2026-09-04

### Added
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@matterailab/orbcode",
"version": "6.8.1",
"version": "6.8.2",
"description": "OrbCode CLI — agentic coding in your terminal, by MatterAI",
"type": "module",
"bin": {
Expand Down
10 changes: 9 additions & 1 deletion src/utils/updateCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,15 @@ export async function getUpdateInfo(
current: string,
): Promise<UpdateInfo> {
const cached = readCache();
if (cached && Date.now() - cached.checkedAt < CACHE_TTL_MS) {
const cacheValid =
cached &&
Date.now() - cached.checkedAt < CACHE_TTL_MS &&
// A cached `latest` older than the running version is stale by
// definition — the user updated through some path that didn't clear
// the cache (e.g. `npm install -g` from another terminal). Trusting it
// would hide the *real* newer version on npm.
(cached.latest === null || compareVersions(cached.latest, current) >= 0);
if (cacheValid) {
return makeResult(current, cached.latest);
}
const latest = await fetchLatestNpmVersion(pkg);
Expand Down