The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): confirm when the main model is applied
Adolan42592179ed94
diff --git a/apps/desktop/src/app/settings/model-settings.test.tsx b/apps/desktop/src/app/settings/model-settings.test.tsxindex 12dc52f85d0..5a53812bf0a 100644--- a/apps/desktop/src/app/settings/model-settings.test.tsx+++ b/apps/desktop/src/app/settings/model-settings.test.tsx@@ -5,6 +5,7 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'viteimport type * as ConfigApi from '@/api/config'import { I18nProvider, TRANSLATIONS } from '@/i18n'+import { $notifications, clearNotifications } from '@/store/notifications'import { ModelSettings } from './model-settings'@@ -412,6 +413,32 @@ describe('ModelSettings', () => {)})+ it('confirms a main model apply with a success notification', async () => {+ clearNotifications()+ setModelAssignment.mockResolvedValueOnce({+ ok: true,+ provider: 'nous',+ model: 'hermes-4',+ gateway_tools: [],+ stale_aux: []+ })++ renderModelSettings()+ await waitFor(() => expect(getGlobalModelInfo).toHaveBeenCalled())++ fireEvent.click(await screen.findByRole('button', { name: 'Apply' }))++ await waitFor(() =>+ expect($notifications.get()).toContainEqual(+ expect.objectContaining({+ kind: 'success',+ title: 'Main model updated',+ message: 'New sessions will use hermes-4.'+ })+ )+ )+ })+it('warns when a main switch leaves auxiliary tasks pinned to another provider', async () => {setModelAssignment.mockResolvedValueOnce({ok: true,diff --git a/apps/desktop/src/app/settings/model-settings.tsx b/apps/desktop/src/app/settings/model-settings.tsxindex 6aae8ebca23..a38272feb95 100644--- a/apps/desktop/src/app/settings/model-settings.tsx+++ b/apps/desktop/src/app/settings/model-settings.tsx@@ -33,7 +33,7 @@ import { isSubmitEnter } from '@/lib/ime'import { cn } from '@/lib/utils'import { $customModels, withCustomModels } from '@/store/custom-models'import { setMainModelAssignment } from '@/store/model-assignment'-import { notifyError, readableError } from '@/store/notifications'+import { notify, notifyError, readableError } from '@/store/notifications'import { startManualLocalEndpoint, startManualOnboarding, startManualProviderOAuth } from '@/store/onboarding'import { hermesConfigCacheWriter, invalidateHermesConfig, useHermesConfigRecord } from '../hooks/use-config-record'@@ -729,6 +729,7 @@ export function ModelSettings({ onMainModelChanged, scopeProfile, subpage }: Modconst model = result.model || selectedModelsetMainModel({ provider, model })setSwitchStaleAux(result.stale_aux ?? [])+ notify({ kind: 'success', title: m.mainAppliedTitle, message: m.mainAppliedMessage(model) })// Live UI stores mirror the ACTIVE profile's model; a scoped apply// changed a different profile and must not repaint them.@@ -743,7 +744,7 @@ export function ModelSettings({ onMainModelChanged, scopeProfile, subpage }: ModsetApplying(false)}}, [- m.loadFailed,+ m,onMainModelChanged,refresh,scopeProfile,diff --git a/apps/desktop/src/i18n/de.ts b/apps/desktop/src/i18n/de.tsindex 2b1d077b05d..a8742a4e4de 100644--- a/apps/desktop/src/i18n/de.ts+++ b/apps/desktop/src/i18n/de.ts@@ -2053,6 +2053,8 @@ export const deOverrides = {provider: 'Anbieter',model: 'Modell',applying: 'Wird angewendet…',+ mainAppliedTitle: 'Hauptmodell aktualisiert',+ mainAppliedMessage: model => `Neue Sitzungen verwenden ${model}.`,defaultsLabel: 'Voreinstellungen',reasoning: 'Denken',reasoningOff: 'Aus',diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.tsindex d3ef5c10a21..a49c5bced16 100644--- a/apps/desktop/src/i18n/en.ts+++ b/apps/desktop/src/i18n/en.ts@@ -1787,6 +1787,8 @@ export const en: Translations = {provider: 'Provider',model: 'Model',applying: 'Applying...',+ mainAppliedTitle: 'Main model updated',+ mainAppliedMessage: model => `New sessions will use ${model}.`,defaultsLabel: 'Defaults',reasoning: 'Reasoning',reasoningOff: 'Off',diff --git a/apps/desktop/src/i18n/es.ts b/apps/desktop/src/i18n/es.tsindex 01fa3683976..ab39affbb24 100644--- a/apps/desktop/src/i18n/es.ts+++ b/apps/desktop/src/i18n/es.ts@@ -2045,6 +2045,8 @@ export const esOverrides = {provider: 'Proveedor',model: 'Modelo',applying: 'Aplicando...',+ mainAppliedTitle: 'Modelo principal actualizado',+ mainAppliedMessage: model => `Las sesiones nuevas usarán ${model}.`,defaultsLabel: 'Valores predeterminados',reasoning: 'Razonamiento',reasoningOff: 'Desactivado',diff --git a/apps/desktop/src/i18n/fr.ts b/apps/desktop/src/i18n/fr.tsindex 6de8b8b41cf..ef17b0d73dd 100644--- a/apps/desktop/src/i18n/fr.ts+++ b/apps/desktop/src/i18n/fr.ts@@ -2057,6 +2057,8 @@ export const frOverrides = {provider: 'Fournisseur',model: 'Modèle',applying: 'Application...',+ mainAppliedTitle: 'Modèle principal mis à jour',+ mainAppliedMessage: model => `Les nouvelles sessions utiliseront ${model}.`,defaultsLabel: 'Par défaut',reasoning: 'Raisonnement',reasoningOff: 'Désactivé',diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.tsindex 2ea07d5250b..f3eea8dfa23 100644--- a/apps/desktop/src/i18n/types.ts+++ b/apps/desktop/src/i18n/types.ts@@ -1514,6 +1514,8 @@ export interface Translations {provider: stringmodel: stringapplying: string+ mainAppliedTitle: string+ mainAppliedMessage: (model: string) => stringdefaultsLabel: stringreasoning: stringreasoningOff: string