The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): localize auxiliary-model warnings and setup action
brooklyn!520fead0943b
diff --git a/apps/desktop/src/app/settings/model-settings.test.tsx b/apps/desktop/src/app/settings/model-settings.test.tsxindex ce5d5a5dd25..653ae735853 100644--- a/apps/desktop/src/app/settings/model-settings.test.tsx+++ b/apps/desktop/src/app/settings/model-settings.test.tsx@@ -413,6 +413,36 @@ describe('ModelSettings', () => {expect(screen.getByText('nous')).toBeTruthy()})+ it.each(['zh', 'zh-hant'] as const)(+ 'localizes stale auxiliary warnings in %s without resetting assignments',+ async locale => {+ getAuxiliaryModels.mockResolvedValueOnce({+ main: { provider: 'nous', model: 'hermes-4' },+ tasks: [{ task: 'curator', provider: 'openrouter', model: 'fixture-model', base_url: '' }]+ })+ const { ModelSettings } = await import('./model-settings')+ const { I18nProvider, TRANSLATIONS } = await import('@/i18n')+ const client = new QueryClient({ defaultOptions: { queries: { retry: false } } })+ render(+ <MemoryRouter>+ <I18nProvider configClient={null} initialLocale={locale}>+ <QueryClientProvider client={client}>+ <ModelSettings />+ </QueryClientProvider>+ </I18nProvider>+ </MemoryRouter>+ )+ expect(await screen.findByText(/仍由/)).toBeTruthy()+ expect(screen.getByText('openrouter')).toBeTruthy()+ expect(+ screen.getAllByRole('button', { name: TRANSLATIONS[locale].settings.model.resetAllToMain }).length+ ).toBeGreaterThan(0)+ expect(screen.queryByText(/still run on/)).toBeNull()+ expect(setModelAssignment).not.toHaveBeenCalled()+ client.clear()+ }+ )+it('shows a persistent banner when a loaded aux slot mismatches the main provider', async () => {getAuxiliaryModels.mockResolvedValueOnce({main: { provider: 'nous', model: 'hermes-4' },diff --git a/apps/desktop/src/app/settings/model-settings.tsx b/apps/desktop/src/app/settings/model-settings.tsxindex a4d1f5eb39a..4f588a53a11 100644--- a/apps/desktop/src/app/settings/model-settings.tsx+++ b/apps/desktop/src/app/settings/model-settings.tsx@@ -195,6 +195,9 @@ interface StaleAuxWarningProps {// $0-balance provider after switching main away from it) and offers the// existing one-click reset rather than auto-clearing legitimate pins.function StaleAuxWarning({ applying, onReset, slots, taskLabel }: StaleAuxWarningProps) {+ const { t } = useI18n()+ const m = t.settings.model+if (!slots.length) {return null}@@ -207,11 +210,12 @@ function StaleAuxWarning({ applying, onReset, slots, taskLabel }: StaleAuxWarnin<div className="flex flex-wrap items-center gap-2 rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-xs text-amber-200"><AlertTriangle className="size-3.5 shrink-0" /><span className="grow">- {slots.length} auxiliary task{slots.length === 1 ? '' : 's'} ({names}) still run on{' '}- <span className="font-mono">{allSameProvider ? provider : 'other providers'}</span>, not your main model.+ {m.staleAuxBefore(slots.length, names)}+ <span className="font-mono">{allSameProvider ? provider : m.staleAuxOtherProviders}</span>+ {m.staleAuxAfter}</span><Button disabled={applying} onClick={onReset} size="sm" variant="textStrong">- Reset all to main+ {m.resetAllToMain}</Button></div>)@@ -927,7 +931,7 @@ export function ModelSettings({ onMainModelChanged, scopeProfile, subpage }: Mod</>) : (<Button onClick={startProviderSetup} size="sm" variant="textStrong">- Set up {selectedProviderRow?.name ?? 'provider'}+ {m.setUpProvider(selectedProviderRow?.name ?? m.setupProviderFallback)}</Button>)) : (diff --git a/apps/desktop/src/i18n/ar.ts b/apps/desktop/src/i18n/ar.tsindex 52b717e3163..ab83b7e6b65 100644--- a/apps/desktop/src/i18n/ar.ts+++ b/apps/desktop/src/i18n/ar.ts@@ -1077,6 +1077,11 @@ export const ar = defineLocale({moaAggregator: 'نموذج التجميع',moaAggregatorBilled: 'النموذج المنفّذ · تُحتسب عليه تكلفة التشغيل',moaReferenceHint: 'يقدّم المشورة مرة واحدة لكل رسالة افتراضياً',+ setupProviderFallback: "الموفّر",+ setUpProvider: name => `إعداد ${name}`,+ staleAuxBefore: (count, names) => `المهام المساعدة (${count}: ${names}) ما زالت تعمل لدى `,+ staleAuxAfter: '، وليس على النموذج الرئيسي.',+ staleAuxOtherProviders: 'موفّرين آخرين',moaEnabled: 'مُفعّل',moaSetDefault: 'تعيين الافتراضي',moaNewPresetPlaceholder: 'إعداد جديد',diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.tsindex 6f5294e3740..44b616f38f0 100644--- a/apps/desktop/src/i18n/en.ts+++ b/apps/desktop/src/i18n/en.ts@@ -1665,6 +1665,11 @@ export const en: Translations = {deepLinkErrorTooLarge: 'The config payload exceeds the 32KB limit.'},model: {+ setupProviderFallback: "provider",+ setUpProvider: name => `Set up ${name}`,+ staleAuxBefore: (count, names) => `${count} auxiliary task${count === 1 ? '' : 's'} (${names}) still run on `,+ staleAuxAfter: ', not your main model.',+ staleAuxOtherProviders: 'other providers',moaEnabled: 'Enabled',moaSetDefault: 'Set default',moaNewPresetPlaceholder: 'new preset',diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.tsindex 6b701f119a3..5cfddd5369b 100644--- a/apps/desktop/src/i18n/ja.ts+++ b/apps/desktop/src/i18n/ja.ts@@ -1237,6 +1237,11 @@ export const ja = defineLocale({moaAggregator: '集約モデル',moaAggregatorBilled: '実行モデル · 実行費用の請求先',moaReferenceHint: '既定では各ターンに一度だけ助言',+ setupProviderFallback: "プロバイダー",+ setUpProvider: name => `${name} を設定`,+ staleAuxBefore: (count, names) => `${count} 件の補助タスク(${names})は引き続き `,+ staleAuxAfter: ' で実行され、メインモデルは使用されません。',+ staleAuxOtherProviders: '別のプロバイダー',moaEnabled: '有効',moaSetDefault: 'デフォルトに設定',moaNewPresetPlaceholder: '新しいプリセット',diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.tsindex 5d003b83c2a..85449681475 100644--- a/apps/desktop/src/i18n/ru.ts+++ b/apps/desktop/src/i18n/ru.ts@@ -1430,6 +1430,11 @@ export const ru = defineLocale({moaAggregator: 'Модель-агрегатор',moaAggregatorBilled: 'исполняющая модель · на неё приходится стоимость запуска',moaReferenceHint: 'по умолчанию советует один раз за ход',+ setupProviderFallback: "провайдер",+ setUpProvider: name => `Настроить ${name}`,+ staleAuxBefore: (count, names) => `Вспомогательные задачи (${count}: ${names}) по-прежнему используют `,+ staleAuxAfter: ', а не основную модель.',+ staleAuxOtherProviders: 'других провайдеров',moaEnabled: 'Включено',moaSetDefault: 'Сделать основным',moaNewPresetPlaceholder: 'новый пресет',diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.tsindex 716bb47ffcb..9a5fee2dcc7 100644--- a/apps/desktop/src/i18n/types.ts+++ b/apps/desktop/src/i18n/types.ts@@ -1421,6 +1421,11 @@ export interface Translations {deepLinkErrorTooLarge: string}model: {+ setupProviderFallback: string+ setUpProvider: (name: string) => string+ staleAuxBefore: (count: number, names: string) => string+ staleAuxAfter: string+ staleAuxOtherProviders: stringmoaEnabled: stringmoaSetDefault: stringmoaNewPresetPlaceholder: stringdiff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.tsindex 74f37d7280a..716a546aa31 100644--- a/apps/desktop/src/i18n/zh-hant.ts+++ b/apps/desktop/src/i18n/zh-hant.ts@@ -1279,6 +1279,11 @@ export const zhHant = defineLocale({deepLinkErrorTooLarge: '設定內容超過 32KB 上限。'},model: {+ setupProviderFallback: "提供方",+ setUpProvider: name => `設定 ${name}`,+ staleAuxBefore: (count, names) => `${count} 個輔助任務(${names})仍由 `,+ staleAuxAfter: ' 執行,而非主要模型。',+ staleAuxOtherProviders: '其他提供方',moaEnabled: '啟用',moaSetDefault: '設為預設',moaNewPresetPlaceholder: '新預設',diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.tsindex 8c361ae721e..8444fdb1ac0 100644--- a/apps/desktop/src/i18n/zh.ts+++ b/apps/desktop/src/i18n/zh.ts@@ -1617,6 +1617,11 @@ export const zh = defineLocale({deepLinkErrorTooLarge: '配置负载超过 32KB 上限。'},model: {+ setupProviderFallback: "提供方",+ setUpProvider: name => `设置 ${name}`,+ staleAuxBefore: (count, names) => `${count} 个辅助任务(${names})仍由 `,+ staleAuxAfter: ' 运行,而不是主模型。',+ staleAuxOtherProviders: '其他提供方',moaEnabled: '启用',moaSetDefault: '设为默认',moaNewPresetPlaceholder: '新预设',