From f508722a93a363db8885dc8f1df7e9e6384781c6 Mon Sep 17 00:00:00 2001 From: mkorwel Date: Thu, 19 Mar 2026 19:08:55 -0700 Subject: [PATCH] fix(cli): update notification incorrectly suggests @latest for nightly versions The manual update message in the notification box incorrectly suggested '@latest' even when running a nightly build. This is now corrected to suggest '@nightly' for nightly builds and '@' or '@latest' appropriately for others. Additionally, the 'enableAutoUpdateNotification' setting is now exposed in the settings dialog, allowing users who have auto-updates disabled to opt-out of the notification prompts. Fixes #23188 --- packages/cli/src/config/settingsSchema.ts | 2 +- ...tings-list-with-visual-indicators.snap.svg | 12 ++++----- ...bility-settings-enabled-correctly.snap.svg | 12 ++++----- ...olean-settings-disabled-correctly.snap.svg | 12 ++++----- ...ld-render-default-state-correctly.snap.svg | 12 ++++----- ...ing-settings-configured-correctly.snap.svg | 12 ++++----- ...cused-on-scope-selector-correctly.snap.svg | 12 ++++----- ...ean-and-number-settings-correctly.snap.svg | 12 ++++----- ...s-and-security-settings-correctly.snap.svg | 12 ++++----- ...oolean-settings-enabled-correctly.snap.svg | 12 ++++----- .../SettingsDialog.test.tsx.snap | 27 +++++++++++++++++++ packages/cli/src/utils/handleAutoUpdate.ts | 10 ++++--- 12 files changed, 89 insertions(+), 58 deletions(-) diff --git a/packages/cli/src/config/settingsSchema.ts b/packages/cli/src/config/settingsSchema.ts index fcfd604e3a..b0e56a9dc1 100644 --- a/packages/cli/src/config/settingsSchema.ts +++ b/packages/cli/src/config/settingsSchema.ts @@ -252,7 +252,7 @@ const SETTINGS_SCHEMA = { requiresRestart: false, default: true, description: 'Enable update notification prompts.', - showInDialog: false, + showInDialog: true, }, enableNotifications: { type: 'boolean', diff --git a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Initial-Rendering-should-render-settings-list-with-visual-indicators.snap.svg b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Initial-Rendering-should-render-settings-list-with-visual-indicators.snap.svg index a9673bc3b7..402157f44c 100644 --- a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Initial-Rendering-should-render-settings-list-with-visual-indicators.snap.svg +++ b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Initial-Rendering-should-render-settings-list-with-visual-indicators.snap.svg @@ -67,20 +67,20 @@ - Enable Notifications - false + Enable Auto Update Notification + true - Enable run-event notifications for action-required prompts and session completion. + Enable update notification prompts. - Enable Plan Mode - true + Enable Notifications + false - Enable Plan Mode for read-only safety during planning. + Enable run-event notifications for action-required prompts and session completion. … diff --git a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-accessibility-settings-enabled-correctly.snap.svg b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-accessibility-settings-enabled-correctly.snap.svg index 72a11cad81..02c093ebbb 100644 --- a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-accessibility-settings-enabled-correctly.snap.svg +++ b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-accessibility-settings-enabled-correctly.snap.svg @@ -67,20 +67,20 @@ - Enable Notifications - false + Enable Auto Update Notification + true - Enable run-event notifications for action-required prompts and session completion. + Enable update notification prompts. - Enable Plan Mode - true + Enable Notifications + false - Enable Plan Mode for read-only safety during planning. + Enable run-event notifications for action-required prompts and session completion. … diff --git a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-all-boolean-settings-disabled-correctly.snap.svg b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-all-boolean-settings-disabled-correctly.snap.svg index 8f4daa80ae..4a872f3ef5 100644 --- a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-all-boolean-settings-disabled-correctly.snap.svg +++ b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-all-boolean-settings-disabled-correctly.snap.svg @@ -67,20 +67,20 @@ - Enable Notifications - false + Enable Auto Update Notification + true - Enable run-event notifications for action-required prompts and session completion. + Enable update notification prompts. - Enable Plan Mode - true + Enable Notifications + false - Enable Plan Mode for read-only safety during planning. + Enable run-event notifications for action-required prompts and session completion. … diff --git a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-default-state-correctly.snap.svg b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-default-state-correctly.snap.svg index a9673bc3b7..402157f44c 100644 --- a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-default-state-correctly.snap.svg +++ b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-default-state-correctly.snap.svg @@ -67,20 +67,20 @@ - Enable Notifications - false + Enable Auto Update Notification + true - Enable run-event notifications for action-required prompts and session completion. + Enable update notification prompts. - Enable Plan Mode - true + Enable Notifications + false - Enable Plan Mode for read-only safety during planning. + Enable run-event notifications for action-required prompts and session completion. … diff --git a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-file-filtering-settings-configured-correctly.snap.svg b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-file-filtering-settings-configured-correctly.snap.svg index a9673bc3b7..402157f44c 100644 --- a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-file-filtering-settings-configured-correctly.snap.svg +++ b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-file-filtering-settings-configured-correctly.snap.svg @@ -67,20 +67,20 @@ - Enable Notifications - false + Enable Auto Update Notification + true - Enable run-event notifications for action-required prompts and session completion. + Enable update notification prompts. - Enable Plan Mode - true + Enable Notifications + false - Enable Plan Mode for read-only safety during planning. + Enable run-event notifications for action-required prompts and session completion. … diff --git a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-focused-on-scope-selector-correctly.snap.svg b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-focused-on-scope-selector-correctly.snap.svg index 4068847a9c..2e847673ec 100644 --- a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-focused-on-scope-selector-correctly.snap.svg +++ b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-focused-on-scope-selector-correctly.snap.svg @@ -56,20 +56,20 @@ - Enable Notifications - false + Enable Auto Update Notification + true - Enable run-event notifications for action-required prompts and session completion. + Enable update notification prompts. - Enable Plan Mode - true + Enable Notifications + false - Enable Plan Mode for read-only safety during planning. + Enable run-event notifications for action-required prompts and session completion. … diff --git a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-mixed-boolean-and-number-settings-correctly.snap.svg b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-mixed-boolean-and-number-settings-correctly.snap.svg index 93ba308209..6b4ecf9761 100644 --- a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-mixed-boolean-and-number-settings-correctly.snap.svg +++ b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-mixed-boolean-and-number-settings-correctly.snap.svg @@ -67,20 +67,20 @@ - Enable Notifications - false + Enable Auto Update Notification + true - Enable run-event notifications for action-required prompts and session completion. + Enable update notification prompts. - Enable Plan Mode - true + Enable Notifications + false - Enable Plan Mode for read-only safety during planning. + Enable run-event notifications for action-required prompts and session completion. … diff --git a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-tools-and-security-settings-correctly.snap.svg b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-tools-and-security-settings-correctly.snap.svg index a9673bc3b7..402157f44c 100644 --- a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-tools-and-security-settings-correctly.snap.svg +++ b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-tools-and-security-settings-correctly.snap.svg @@ -67,20 +67,20 @@ - Enable Notifications - false + Enable Auto Update Notification + true - Enable run-event notifications for action-required prompts and session completion. + Enable update notification prompts. - Enable Plan Mode - true + Enable Notifications + false - Enable Plan Mode for read-only safety during planning. + Enable run-event notifications for action-required prompts and session completion. … diff --git a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-various-boolean-settings-enabled-correctly.snap.svg b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-various-boolean-settings-enabled-correctly.snap.svg index b49d53d02c..eddf759f1c 100644 --- a/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-various-boolean-settings-enabled-correctly.snap.svg +++ b/packages/cli/src/ui/components/__snapshots__/SettingsDialog-SettingsDialog-Snapshot-Tests-should-render-various-boolean-settings-enabled-correctly.snap.svg @@ -67,20 +67,20 @@ - Enable Notifications - false + Enable Auto Update Notification + true - Enable run-event notifications for action-required prompts and session completion. + Enable update notification prompts. - Enable Plan Mode - true + Enable Notifications + false - Enable Plan Mode for read-only safety during planning. + Enable run-event notifications for action-required prompts and session completion. … diff --git a/packages/cli/src/ui/components/__snapshots__/SettingsDialog.test.tsx.snap b/packages/cli/src/ui/components/__snapshots__/SettingsDialog.test.tsx.snap index d585c9a918..7c5bd816c3 100644 --- a/packages/cli/src/ui/components/__snapshots__/SettingsDialog.test.tsx.snap +++ b/packages/cli/src/ui/components/__snapshots__/SettingsDialog.test.tsx.snap @@ -19,6 +19,9 @@ exports[`SettingsDialog > Initial Rendering > should render settings list with v │ Enable Auto Update true │ │ Enable automatic updates. │ │ │ +│ Enable Auto Update Notification true │ +│ Enable update notification prompts. │ +│ │ │ Enable Notifications false │ │ Enable run-event notifications for action-required prompts and session completion. │ │ │ @@ -65,6 +68,9 @@ exports[`SettingsDialog > Snapshot Tests > should render 'accessibility settings │ Enable Auto Update true │ │ Enable automatic updates. │ │ │ +│ Enable Auto Update Notification true │ +│ Enable update notification prompts. │ +│ │ │ Enable Notifications false │ │ Enable run-event notifications for action-required prompts and session completion. │ │ │ @@ -111,6 +117,9 @@ exports[`SettingsDialog > Snapshot Tests > should render 'all boolean settings d │ Enable Auto Update true* │ │ Enable automatic updates. │ │ │ +│ Enable Auto Update Notification true │ +│ Enable update notification prompts. │ +│ │ │ Enable Notifications false │ │ Enable run-event notifications for action-required prompts and session completion. │ │ │ @@ -157,6 +166,9 @@ exports[`SettingsDialog > Snapshot Tests > should render 'default state' correct │ Enable Auto Update true │ │ Enable automatic updates. │ │ │ +│ Enable Auto Update Notification true │ +│ Enable update notification prompts. │ +│ │ │ Enable Notifications false │ │ Enable run-event notifications for action-required prompts and session completion. │ │ │ @@ -203,6 +215,9 @@ exports[`SettingsDialog > Snapshot Tests > should render 'file filtering setting │ Enable Auto Update true │ │ Enable automatic updates. │ │ │ +│ Enable Auto Update Notification true │ +│ Enable update notification prompts. │ +│ │ │ Enable Notifications false │ │ Enable run-event notifications for action-required prompts and session completion. │ │ │ @@ -249,6 +264,9 @@ exports[`SettingsDialog > Snapshot Tests > should render 'focused on scope selec │ Enable Auto Update true │ │ Enable automatic updates. │ │ │ +│ Enable Auto Update Notification true │ +│ Enable update notification prompts. │ +│ │ │ Enable Notifications false │ │ Enable run-event notifications for action-required prompts and session completion. │ │ │ @@ -295,6 +313,9 @@ exports[`SettingsDialog > Snapshot Tests > should render 'mixed boolean and numb │ Enable Auto Update false* │ │ Enable automatic updates. │ │ │ +│ Enable Auto Update Notification true │ +│ Enable update notification prompts. │ +│ │ │ Enable Notifications false │ │ Enable run-event notifications for action-required prompts and session completion. │ │ │ @@ -341,6 +362,9 @@ exports[`SettingsDialog > Snapshot Tests > should render 'tools and security set │ Enable Auto Update true │ │ Enable automatic updates. │ │ │ +│ Enable Auto Update Notification true │ +│ Enable update notification prompts. │ +│ │ │ Enable Notifications false │ │ Enable run-event notifications for action-required prompts and session completion. │ │ │ @@ -387,6 +411,9 @@ exports[`SettingsDialog > Snapshot Tests > should render 'various boolean settin │ Enable Auto Update false* │ │ Enable automatic updates. │ │ │ +│ Enable Auto Update Notification true │ +│ Enable update notification prompts. │ +│ │ │ Enable Notifications false │ │ Enable run-event notifications for action-required prompts and session completion. │ │ │ diff --git a/packages/cli/src/utils/handleAutoUpdate.ts b/packages/cli/src/utils/handleAutoUpdate.ts index 4f8ca69ed3..9c7ac4dccf 100644 --- a/packages/cli/src/utils/handleAutoUpdate.ts +++ b/packages/cli/src/utils/handleAutoUpdate.ts @@ -97,9 +97,15 @@ export function handleAutoUpdate( return; } + const isNightly = info.update.latest.includes('nightly'); + let combinedMessage = info.message; if (installationInfo.updateMessage) { - combinedMessage += `\n${installationInfo.updateMessage}`; + const updateMessage = installationInfo.updateMessage.replace( + '@latest', + isNightly ? '@nightly' : `@${info.update.latest}`, + ); + combinedMessage += `\n${updateMessage}`; } if ( @@ -122,8 +128,6 @@ export function handleAutoUpdate( return; } - const isNightly = info.update.latest.includes('nightly'); - const updateCommand = installationInfo.updateCommand.replace( '@latest', isNightly ? '@nightly' : `@${info.update.latest}`,