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
34 changes: 0 additions & 34 deletions src/cli/__tests__/update-check.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,37 +252,3 @@ test('a failed check after a channel switch records the new channel and drops th
assert.equal(cache.latestVersion, undefined);
assert.equal(cache.checkedAt, '2026-03-31T10:00:00.000Z');
});

test('a 0.22 nightly follows its own dist-tag and ignores cached main-nightly updates', async () => {
const stateDir = makeTempStateDir();
cleanupPaths.push(stateDir);
const currentVersion = '0.22.0-nightly-0-22.20261113.7';
writeCache(stateDir, { latestVersion: '0.23.0-nightly.20261114.8', distTag: 'nightly' });
assert.equal(
withCapturedStderr(
() => maybeRunUpgradeNotifier({ command: 'devices', currentVersion, stateDir, flags: {} }),
{ interactive: true },
),
'',
);
const fetchMock = vi.fn().mockResolvedValue({
ok: true,
json: async () => ({ version: '0.22.0-nightly-0-22.20261114.8' }),
});
vi.stubGlobal('fetch', fetchMock);
await runUpdateCheckWorker({
cachePath: path.join(stateDir, 'update-check.json'),
currentVersion,
});
assert.equal(
fetchMock.mock.calls[0]?.[0],
'https://registry.npmjs.org/agent-device/nightly-0.22',
);
assert.match(
withCapturedStderr(
() => maybeRunUpgradeNotifier({ command: 'devices', currentVersion, stateDir, flags: {} }),
{ interactive: true },
),
/npm install -g agent-device@nightly-0\.22/,
);
});
4 changes: 1 addition & 3 deletions src/cli/update-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ function cachedDistTag(cache: UpdateCheckCache): string {
return cache.distTag ?? 'latest';
}

/** Each nightly follows its source channel; other builds follow `latest`. */
function distTagFor(version: string): 'latest' | 'nightly' | 'nightly-0.22' {
if (version.includes('-nightly-0-22.')) return 'nightly-0.22';
function distTagFor(version: string): 'latest' | 'nightly' {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This removes the nightly-0.22 routing, but the public install docs still tell 0.22 nightly users that the update notice follows nightly-0.22. Update website/docs/docs/installation.md in this PR to remove that statement and the @nightly-0.22 install instruction, or explain the intended path for those users.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/cli/update-check.ts, line 173:

<comment>This removes the `nightly-0.22` routing, but the public install docs still tell 0.22 nightly users that the update notice follows `nightly-0.22`. Update `website/docs/docs/installation.md` in this PR to remove that statement and the `@nightly-0.22` install instruction, or explain the intended path for those users.</comment>

<file context>
@@ -169,9 +169,8 @@ function cachedDistTag(cache: UpdateCheckCache): string {
-function distTagFor(version: string): 'latest' | 'nightly' | 'nightly-0.22' {
-  if (version.includes('-nightly-0-22.')) return 'nightly-0.22';
+/** A nightly build follows the `nightly` dist-tag; every other build follows `latest`. */
+function distTagFor(version: string): 'latest' | 'nightly' {
   return version.includes('-nightly.') ? 'nightly' : 'latest';
 }
</file context>

return version.includes('-nightly.') ? 'nightly' : 'latest';
}

Expand Down
Loading