The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(desktop): model-menu copy moves to per-locale siblings; limit row state leaves ModelFamilyRow
Brooklyn Nicholsonc838173e43bf
diff --git a/apps/desktop/src/app/shell/model-catalog-menu.tsx b/apps/desktop/src/app/shell/model-catalog-menu.tsxindex 47378e148e8..780768eec33 100644--- a/apps/desktop/src/app/shell/model-catalog-menu.tsx+++ b/apps/desktop/src/app/shell/model-catalog-menu.tsx@@ -1010,12 +1010,7 @@ function ModelFamilyRow({const { name, tag } = modelDisplayParts(family.id)const decoration = useModelMenuRowDecoration({ label: name, model: family.id, provider: provider.slug })const caps = provider.capabilities?.[family.id]- // A limited provider stays pickable: the account-wide case dims every row- // (the group heading says why), the per-model case tags only the rows that- // are cooling down, so a sibling model reads as the way to keep working.- const accountLimited = accountResetMs(provider) !== null- const modelReset = modelResetMs(provider, family.id) ?? (family.fastId ? modelResetMs(provider, family.fastId) : null)- const modelResetLabel = modelReset === null ? null : formatReset(modelReset)+ const limit = familyLimit(provider, family, isCurrent)// Live per-model $/Mtok pricing (Nous Portal and other providers that ship// it). A `-fast` sibling shares the base id's price: the collapsed row@@ -1126,12 +1121,7 @@ function ModelFamilyRow({<Codicon name={favorite ? 'star-full' : 'star-empty'} size="0.75rem" /></button></Tip>- <span- className={cn(- 'flex min-w-0 flex-1 items-center gap-1.5',- (accountLimited || modelResetLabel) && !isCurrent && 'text-(--ui-text-tertiary)'- )}- >+ <span className={cn('flex min-w-0 flex-1 items-center gap-1.5', limit.tone)}>{decoration.icon !== undefined ? <ModelMenuRowIcon icon={decoration.icon} /> : null}<span className="min-w-0 truncate"><HighlightMatches foldSeparators query={search} text={name} />@@ -1143,13 +1133,7 @@ function ModelFamilyRow({</Badge>) : null}</span>- {modelResetLabel ? (- <Tip label={copy.modelLimitedTip(modelResetLabel)}>- <Badge className="shrink-0 tabular-nums" size="xs" variant="warn">- {copy.modelResets(modelResetLabel)}- </Badge>- </Tip>- ) : null}+ <ModelResetBadge time={limit.reset} />{loadProgress ? (<span className="flex shrink-0 items-center gap-1.5" title={copyPicker.loadingIntoMemory}><span className="h-1 w-14 overflow-hidden rounded-full bg-(--ui-bg-tertiary)">@@ -1222,6 +1206,35 @@ function ModelChip({ children, setting = false }: { children: ReactNode; setting)}+/** A limited provider stays pickable: the account-wide case dims every row+ * (the group heading says why), the per-model case dims and tags only the+ * rows cooling down, so a sibling reads as the way to keep working. The+ * current row stays bright so the selection still reads. */+function familyLimit(+ provider: ModelOptionProvider,+ family: ModelFamily,+ isCurrent: boolean+): { reset: null | string; tone?: string } {+ const ms = modelResetMs(provider, family.id) ?? (family.fastId ? modelResetMs(provider, family.fastId) : null)+ const reset = ms === null ? null : formatReset(ms)+ const dim = !isCurrent && (reset !== null || accountResetMs(provider) !== null)++ return { reset, tone: dim ? 'text-(--ui-text-tertiary)' : undefined }+}++function ModelResetBadge({ time }: { time: null | string }): null | ReactElement {+ const { t } = useI18n()+ const copy = t.shell.modelMenu++ return time ? (+ <Tip label={copy.modelLimitedTip(time)}>+ <Badge className="shrink-0 tabular-nums" size="xs" variant="warn">+ {copy.modelResets(time)}+ </Badge>+ </Tip>+ ) : null+}+/** Trailing tag on a provider heading while its whole login is rate-limited.* Per-model cooldowns tag their own rows instead. */function ProviderLimitBadge({ provider }: { provider: ModelOptionProvider }): null | ReactElement {diff --git a/apps/desktop/src/i18n/de.ts b/apps/desktop/src/i18n/de.tsindex 4be48d9e487..6f81923f5d2 100644--- a/apps/desktop/src/i18n/de.ts+++ b/apps/desktop/src/i18n/de.ts@@ -1,5 +1,6 @@import { defineFieldCopy } from '@/app/settings/field-copy'+import { deModelMenu } from './de_model_menu'import { defineLocale, type TranslationOverrides } from './define-locale'import { introDe } from './intro-de'@@ -5049,31 +5050,7 @@ export const deOverrides = {windowControls: 'Fenster-Bedienelemente',paneControls: 'Panele-Bedienelemente',appControls: 'App-Bedienelemente',- modelMenu: {- search: 'Modelle durchsuchen',- noModels: 'Keine Modelle gefunden',- editModels: 'Modelle bearbeiten…',- followDefault: 'Standard aus den Einstellungen verwenden',- refreshModels: 'Modelle aktualisieren',- favorites: 'Favoriten',- addFavorite: 'Zu Favoriten hinzufügen',- removeFavorite: 'Aus Favoriten entfernen',- favoriteShortcut: '⇧ Klick',- fast: 'Schnell',- free: 'kostenlos',- cacheRead: 'Cache-Lesung',- priceTitle: (input: string, output: string, cache: string) =>- `Eingabe ${input}/Mtok · Ausgabe ${output}/Mtok` + (cache ? ` · Cache-Lesung ${cache}/Mtok` : ''),- limited: 'Limitiert',- limitedUntil: (time: string) => `Limitiert bis ${time}`,- limitedTip: (provider: string, time: null | string) =>- time- ? `${provider} hat sein Nutzungslimit erreicht. Es wird um ${time} zurückgesetzt; du kannst schon jetzt ein Modell für danach wählen.`- : `${provider} hat sein Nutzungslimit erreicht. Du kannst schon jetzt ein Modell für die Zeit nach dem Zurücksetzen wählen.`,- modelResets: (time: string) => `wieder ab ${time}`,- modelLimitedTip: (time: string) =>- `Dieses Modell hat sein eigenes Limit erreicht und ist ab ${time} wieder verfügbar. Andere Modelle hier funktionieren weiterhin.`- },+ modelMenu: deModelMenu,modelOptions: {noOptions: 'Keine Optionen für dieses Modell',options: 'Optionen',diff --git a/apps/desktop/src/i18n/de_model_menu.ts b/apps/desktop/src/i18n/de_model_menu.tsnew file mode 100644index 00000000000..f0a4ff7b36a--- /dev/null+++ b/apps/desktop/src/i18n/de_model_menu.ts@@ -0,0 +1,25 @@+export const deModelMenu = {+ search: 'Modelle durchsuchen',+ noModels: 'Keine Modelle gefunden',+ editModels: 'Modelle bearbeiten…',+ followDefault: 'Standard aus den Einstellungen verwenden',+ refreshModels: 'Modelle aktualisieren',+ favorites: 'Favoriten',+ addFavorite: 'Zu Favoriten hinzufügen',+ removeFavorite: 'Aus Favoriten entfernen',+ favoriteShortcut: '⇧ Klick',+ fast: 'Schnell',+ free: 'kostenlos',+ cacheRead: 'Cache-Lesung',+ priceTitle: (input: string, output: string, cache: string) =>+ `Eingabe ${input}/Mtok · Ausgabe ${output}/Mtok` + (cache ? ` · Cache-Lesung ${cache}/Mtok` : ''),+ limited: 'Limitiert',+ limitedUntil: (time: string) => `Limitiert bis ${time}`,+ limitedTip: (provider: string, time: null | string) =>+ time+ ? `${provider} hat sein Nutzungslimit erreicht. Es wird um ${time} zurückgesetzt; du kannst schon jetzt ein Modell für danach wählen.`+ : `${provider} hat sein Nutzungslimit erreicht. Du kannst schon jetzt ein Modell für die Zeit nach dem Zurücksetzen wählen.`,+ modelResets: (time: string) => `wieder ab ${time}`,+ modelLimitedTip: (time: string) =>+ `Dieses Modell hat sein eigenes Limit erreicht und ist ab ${time} wieder verfügbar. Andere Modelle hier funktionieren weiterhin.`+}diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.tsindex f5cd7a262db..d9c25a3c5da 100644--- a/apps/desktop/src/i18n/en.ts+++ b/apps/desktop/src/i18n/en.ts@@ -1,5 +1,6 @@import { FIELD_DESCRIPTIONS, FIELD_LABELS } from '@/app/settings/constants'+import { enModelMenu } from './en_model_menu'import type { Translations } from './types'export const en: Translations = {@@ -4611,31 +4612,7 @@ export const en: Translations = {windowControls: 'Window controls',paneControls: 'Pane controls',appControls: 'App controls',- modelMenu: {- search: 'Search models',- noModels: 'No models found',- editModels: 'Edit models…',- followDefault: 'Use Settings default',- refreshModels: 'Refresh models',- favorites: 'Favorites',- addFavorite: 'Add to favorites',- removeFavorite: 'Remove from favorites',- favoriteShortcut: '⇧ Click',- fast: 'Fast',- free: 'free',- cacheRead: 'cached read',- priceTitle: (input: string, output: string, cache: string) =>- `Input ${input}/Mtok · Output ${output}/Mtok` + (cache ? ` · Cached read ${cache}/Mtok` : ''),- limited: 'Limited',- limitedUntil: (time: string) => `Limited until ${time}`,- limitedTip: (provider: string, time: null | string) =>- time- ? `${provider} hit its usage limit. It resets at ${time}; you can still pick a model for after.`- : `${provider} hit its usage limit. You can still pick a model for after it resets.`,- modelResets: (time: string) => `resets ${time}`,- modelLimitedTip: (time: string) =>- `This model hit its own limit and resets at ${time}. Other models here still work.`- },+ modelMenu: enModelMenu,modelOptions: {noOptions: 'No options for this model',options: 'Options',diff --git a/apps/desktop/src/i18n/en_model_menu.ts b/apps/desktop/src/i18n/en_model_menu.tsnew file mode 100644index 00000000000..bb124c2f4dd--- /dev/null+++ b/apps/desktop/src/i18n/en_model_menu.ts@@ -0,0 +1,26 @@+import type { Translations } from './types'++export const enModelMenu: Translations['shell']['modelMenu'] = {+ search: 'Search models',+ noModels: 'No models found',+ editModels: 'Edit models…',+ followDefault: 'Use Settings default',+ refreshModels: 'Refresh models',+ favorites: 'Favorites',+ addFavorite: 'Add to favorites',+ removeFavorite: 'Remove from favorites',+ favoriteShortcut: '⇧ Click',+ fast: 'Fast',+ free: 'free',+ cacheRead: 'cached read',+ priceTitle: (input: string, output: string, cache: string) =>+ `Input ${input}/Mtok · Output ${output}/Mtok` + (cache ? ` · Cached read ${cache}/Mtok` : ''),+ limited: 'Limited',+ limitedUntil: (time: string) => `Limited until ${time}`,+ limitedTip: (provider: string, time: null | string) =>+ time+ ? `${provider} hit its usage limit. It resets at ${time}; you can still pick a model for after.`+ : `${provider} hit its usage limit. You can still pick a model for after it resets.`,+ modelResets: (time: string) => `resets ${time}`,+ modelLimitedTip: (time: string) => `This model hit its own limit and resets at ${time}. Other models here still work.`+}diff --git a/apps/desktop/src/i18n/es.ts b/apps/desktop/src/i18n/es.tsindex dffb0a670de..5891c704387 100644--- a/apps/desktop/src/i18n/es.ts+++ b/apps/desktop/src/i18n/es.ts@@ -1,6 +1,7 @@import { defineFieldCopy } from '@/app/settings/field-copy'import { defineLocale, type TranslationOverrides } from './define-locale'+import { esModelMenu } from './es_model_menu'import { introEs } from './intro-es'export const esOverrides = {@@ -5041,31 +5042,7 @@ export const esOverrides = {windowControls: 'Controles de ventana',paneControls: 'Controles de panel',appControls: 'Controles de app',- modelMenu: {- search: 'Buscar modelos',- noModels: 'No se encontraron modelos',- editModels: 'Editar modelos…',- followDefault: 'Usar el predeterminado de Ajustes',- refreshModels: 'Actualizar modelos',- favorites: 'Favoritos',- addFavorite: 'Añadir a favoritos',- removeFavorite: 'Quitar de favoritos',- favoriteShortcut: '⇧ Clic',- fast: 'Rápido',- free: 'gratis',- cacheRead: 'lectura en caché',- priceTitle: (input: string, output: string, cache: string) =>- `Entrada ${input}/Mtok · Salida ${output}/Mtok` + (cache ? ` · Lectura en caché ${cache}/Mtok` : ''),- limited: 'Limitado',- limitedUntil: (time: string) => `Limitado hasta las ${time}`,- limitedTip: (provider: string, time: null | string) =>- time- ? `${provider} alcanzó su límite de uso. Se restablece a las ${time}; ya puedes elegir un modelo para después.`- : `${provider} alcanzó su límite de uso. Ya puedes elegir un modelo para cuando se restablezca.`,- modelResets: (time: string) => `vuelve a las ${time}`,- modelLimitedTip: (time: string) =>- `Este modelo alcanzó su propio límite y vuelve a las ${time}. Los demás modelos de aquí siguen funcionando.`- },+ modelMenu: esModelMenu,modelOptions: {noOptions: 'No hay opciones para este modelo',options: 'Opciones',diff --git a/apps/desktop/src/i18n/es_model_menu.ts b/apps/desktop/src/i18n/es_model_menu.tsnew file mode 100644index 00000000000..478d49c2f96--- /dev/null+++ b/apps/desktop/src/i18n/es_model_menu.ts@@ -0,0 +1,25 @@+export const esModelMenu = {+ search: 'Buscar modelos',+ noModels: 'No se encontraron modelos',+ editModels: 'Editar modelos…',+ followDefault: 'Usar el predeterminado de Ajustes',+ refreshModels: 'Actualizar modelos',+ favorites: 'Favoritos',+ addFavorite: 'Añadir a favoritos',+ removeFavorite: 'Quitar de favoritos',+ favoriteShortcut: '⇧ Clic',+ fast: 'Rápido',+ free: 'gratis',+ cacheRead: 'lectura en caché',+ priceTitle: (input: string, output: string, cache: string) =>+ `Entrada ${input}/Mtok · Salida ${output}/Mtok` + (cache ? ` · Lectura en caché ${cache}/Mtok` : ''),+ limited: 'Limitado',+ limitedUntil: (time: string) => `Limitado hasta las ${time}`,+ limitedTip: (provider: string, time: null | string) =>+ time+ ? `${provider} alcanzó su límite de uso. Se restablece a las ${time}; ya puedes elegir un modelo para después.`+ : `${provider} alcanzó su límite de uso. Ya puedes elegir un modelo para cuando se restablezca.`,+ modelResets: (time: string) => `vuelve a las ${time}`,+ modelLimitedTip: (time: string) =>+ `Este modelo alcanzó su propio límite y vuelve a las ${time}. Los demás modelos de aquí siguen funcionando.`+}diff --git a/apps/desktop/src/i18n/fr.ts b/apps/desktop/src/i18n/fr.tsindex ab88cdb7e13..05778e07ebb 100644--- a/apps/desktop/src/i18n/fr.ts+++ b/apps/desktop/src/i18n/fr.ts@@ -1,6 +1,7 @@import { defineFieldCopy } from '@/app/settings/field-copy'import { defineLocale, type TranslationOverrides } from './define-locale'+import { frModelMenu } from './fr_model_menu'import { introFr } from './intro-fr'export const frOverrides = {@@ -5063,31 +5064,7 @@ export const frOverrides = {windowControls: 'Contrôles de fenêtre',paneControls: 'Contrôles de panneau',appControls: "Contrôles d'application",- modelMenu: {- search: 'Rechercher des modèles',- noModels: 'Aucun modèle trouvé',- editModels: 'Modifier les modèles…',- followDefault: 'Utiliser le modèle par défaut des Réglages',- refreshModels: 'Actualiser les modèles',- favorites: 'Favoris',- addFavorite: 'Ajouter aux favoris',- removeFavorite: 'Retirer des favoris',- favoriteShortcut: '⇧ Clic',- fast: 'Rapide',- free: 'gratuit',- cacheRead: 'lecture en cache',- priceTitle: (input: string, output: string, cache: string) =>- `Entrée ${input}/Mtok · Sortie ${output}/Mtok` + (cache ? ` · Lecture en cache ${cache}/Mtok` : ''),- limited: 'Limité',- limitedUntil: (time: string) => `Limité jusqu’à ${time}`,- limitedTip: (provider: string, time: null | string) =>- time- ? `${provider} a atteint sa limite d’utilisation. Elle se réinitialise à ${time} ; vous pouvez déjà choisir un modèle pour après.`- : `${provider} a atteint sa limite d’utilisation. Vous pouvez déjà choisir un modèle pour après sa réinitialisation.`,- modelResets: (time: string) => `de retour à ${time}`,- modelLimitedTip: (time: string) =>- `Ce modèle a atteint sa propre limite et revient à ${time}. Les autres modèles ici fonctionnent toujours.`- },+ modelMenu: frModelMenu,modelOptions: {noOptions: 'Aucune option pour ce modèle',options: 'Options',diff --git a/apps/desktop/src/i18n/fr_model_menu.ts b/apps/desktop/src/i18n/fr_model_menu.tsnew file mode 100644index 00000000000..edb40631699--- /dev/null+++ b/apps/desktop/src/i18n/fr_model_menu.ts@@ -0,0 +1,25 @@+export const frModelMenu = {+ search: 'Rechercher des modèles',+ noModels: 'Aucun modèle trouvé',+ editModels: 'Modifier les modèles…',+ followDefault: 'Utiliser le modèle par défaut des Réglages',+ refreshModels: 'Actualiser les modèles',+ favorites: 'Favoris',+ addFavorite: 'Ajouter aux favoris',+ removeFavorite: 'Retirer des favoris',+ favoriteShortcut: '⇧ Clic',+ fast: 'Rapide',+ free: 'gratuit',+ cacheRead: 'lecture en cache',+ priceTitle: (input: string, output: string, cache: string) =>+ `Entrée ${input}/Mtok · Sortie ${output}/Mtok` + (cache ? ` · Lecture en cache ${cache}/Mtok` : ''),+ limited: 'Limité',+ limitedUntil: (time: string) => `Limité jusqu’à ${time}`,+ limitedTip: (provider: string, time: null | string) =>+ time+ ? `${provider} a atteint sa limite d’utilisation. Elle se réinitialise à ${time} ; vous pouvez déjà choisir un modèle pour après.`+ : `${provider} a atteint sa limite d’utilisation. Vous pouvez déjà choisir un modèle pour après sa réinitialisation.`,+ modelResets: (time: string) => `de retour à ${time}`,+ modelLimitedTip: (time: string) =>+ `Ce modèle a atteint sa propre limite et revient à ${time}. Les autres modèles ici fonctionnent toujours.`+}diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.tsindex 2a0350928f9..8c69e43f627 100644--- a/apps/desktop/src/i18n/ja.ts+++ b/apps/desktop/src/i18n/ja.ts@@ -2,6 +2,7 @@ import { defineFieldCopy } from '@/app/settings/field-copy'import { defineLocale } from './define-locale'import { introJa } from './intro-ja'+import { jaModelMenu } from './ja_model_menu'export const ja = defineLocale({externalOpenFailed: {@@ -3350,31 +3351,7 @@ export const ja = defineLocale({windowControls: 'ウィンドウコントロール',paneControls: 'ペインコントロール',appControls: 'アプリコントロール',- modelMenu: {- search: 'モデルを検索',- noModels: 'モデルが見つかりません',- editModels: 'モデルを編集…',- followDefault: '設定のデフォルトを使用',- refreshModels: 'モデルを更新',- favorites: 'お気に入り',- addFavorite: 'お気に入りに追加',- removeFavorite: 'お気に入りから削除',- favoriteShortcut: '⇧ クリック',- fast: '高速',- free: '無料',- cacheRead: 'キャッシュ読み取り',- priceTitle: (input: string, output: string, cache: string) =>- `入力 ${input}/Mtok · 出力 ${output}/Mtok` + (cache ? ` · キャッシュ読み取り ${cache}/Mtok` : ''),- limited: '制限中',- limitedUntil: (time: string) => `${time} まで制限中`,- limitedTip: (provider: string, time: null | string) =>- time- ? `${provider} が利用上限に達しました。${time} にリセットされます。リセット後に使うモデルは今のうちに選べます。`- : `${provider} が利用上限に達しました。リセット後に使うモデルは今のうちに選べます。`,- modelResets: (time: string) => `${time} に再開`,- modelLimitedTip: (time: string) =>- `このモデルは個別の上限に達しており、${time} に再開します。ここにある他のモデルは引き続き使えます。`- },+ modelMenu: jaModelMenu,modelOptions: {noOptions: 'このモデルにはオプションがありません',options: 'オプション',diff --git a/apps/desktop/src/i18n/ja_model_menu.ts b/apps/desktop/src/i18n/ja_model_menu.tsnew file mode 100644index 00000000000..20ecab5656b--- /dev/null+++ b/apps/desktop/src/i18n/ja_model_menu.ts@@ -0,0 +1,25 @@+export const jaModelMenu = {+ search: 'モデルを検索',+ noModels: 'モデルが見つかりません',+ editModels: 'モデルを編集…',+ followDefault: '設定のデフォルトを使用',+ refreshModels: 'モデルを更新',+ favorites: 'お気に入り',+ addFavorite: 'お気に入りに追加',+ removeFavorite: 'お気に入りから削除',+ favoriteShortcut: '⇧ クリック',+ fast: '高速',+ free: '無料',+ cacheRead: 'キャッシュ読み取り',+ priceTitle: (input: string, output: string, cache: string) =>+ `入力 ${input}/Mtok · 出力 ${output}/Mtok` + (cache ? ` · キャッシュ読み取り ${cache}/Mtok` : ''),+ limited: '制限中',+ limitedUntil: (time: string) => `${time} まで制限中`,+ limitedTip: (provider: string, time: null | string) =>+ time+ ? `${provider} が利用上限に達しました。${time} にリセットされます。リセット後に使うモデルは今のうちに選べます。`+ : `${provider} が利用上限に達しました。リセット後に使うモデルは今のうちに選べます。`,+ modelResets: (time: string) => `${time} に再開`,+ modelLimitedTip: (time: string) =>+ `このモデルは個別の上限に達しており、${time} に再開します。ここにある他のモデルは引き続き使えます。`+}diff --git a/apps/desktop/src/i18n/ru.ts b/apps/desktop/src/i18n/ru.tsindex 1385a085b8c..4d20b63f2e5 100644--- a/apps/desktop/src/i18n/ru.ts+++ b/apps/desktop/src/i18n/ru.ts@@ -1,6 +1,7 @@import { defineFieldCopy } from '@/app/settings/field-copy'import { defineLocale } from './define-locale'+import { ruModelMenu } from './ru_model_menu'// RU_PLURAL: (count, one, few, many) — русские формы сущ. падежа// RU_NOUN: (count, one, few, many) — формы род. множественного@@ -3571,31 +3572,7 @@ export const ru = defineLocale({windowControls: 'Управление окном',paneControls: 'Управление панелями',appControls: 'Управление приложением',- modelMenu: {- search: 'Поиск моделей',- noModels: 'Модели не найдены',- editModels: 'Изменить модели…',- followDefault: 'Использовать модель по умолчанию из настроек',- refreshModels: 'Обновить модели',- favorites: 'Избранное',- addFavorite: 'Добавить в избранное',- removeFavorite: 'Убрать из избранного',- favoriteShortcut: '⇧ Клик',- fast: 'Быстрая',- free: 'бесплатно',- cacheRead: 'чтение из кэша',- priceTitle: (input: string, output: string, cache: string) =>- `Вход ${input}/Mtok · Выход ${output}/Mtok` + (cache ? ` · Чтение из кэша ${cache}/Mtok` : ''),- limited: 'Лимит',- limitedUntil: (time: string) => `Лимит до ${time}`,- limitedTip: (provider: string, time: null | string) =>- time- ? `${provider} исчерпал лимит использования. Он сбросится в ${time}; модель на потом можно выбрать уже сейчас.`- : `${provider} исчерпал лимит использования. Модель на время после сброса можно выбрать уже сейчас.`,- modelResets: (time: string) => `снова в ${time}`,- modelLimitedTip: (time: string) =>- `Эта модель исчерпала собственный лимит и вернётся в ${time}. Остальные модели здесь работают.`- },+ modelMenu: ruModelMenu,modelOptions: {noOptions: 'Для этой модели нет опций',options: 'Опции',diff --git a/apps/desktop/src/i18n/ru_model_menu.ts b/apps/desktop/src/i18n/ru_model_menu.tsnew file mode 100644index 00000000000..1d4db36e92b--- /dev/null+++ b/apps/desktop/src/i18n/ru_model_menu.ts@@ -0,0 +1,25 @@+export const ruModelMenu = {+ search: 'Поиск моделей',+ noModels: 'Модели не найдены',+ editModels: 'Изменить модели…',+ followDefault: 'Использовать модель по умолчанию из настроек',+ refreshModels: 'Обновить модели',+ favorites: 'Избранное',+ addFavorite: 'Добавить в избранное',+ removeFavorite: 'Убрать из избранного',+ favoriteShortcut: '⇧ Клик',+ fast: 'Быстрая',+ free: 'бесплатно',+ cacheRead: 'чтение из кэша',+ priceTitle: (input: string, output: string, cache: string) =>+ `Вход ${input}/Mtok · Выход ${output}/Mtok` + (cache ? ` · Чтение из кэша ${cache}/Mtok` : ''),+ limited: 'Лимит',+ limitedUntil: (time: string) => `Лимит до ${time}`,+ limitedTip: (provider: string, time: null | string) =>+ time+ ? `${provider} исчерпал лимит использования. Он сбросится в ${time}; модель на потом можно выбрать уже сейчас.`+ : `${provider} исчерпал лимит использования. Модель на время после сброса можно выбрать уже сейчас.`,+ modelResets: (time: string) => `снова в ${time}`,+ modelLimitedTip: (time: string) =>+ `Эта модель исчерпала собственный лимит и вернётся в ${time}. Остальные модели здесь работают.`+}diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.tsindex 2151282440a..179711e3ad9 100644--- a/apps/desktop/src/i18n/types.ts+++ b/apps/desktop/src/i18n/types.ts@@ -8,6 +8,8 @@import type { ErrorCodeKey } from '@/lib/error-surface'import type { TipId } from '@/lib/tips/catalog'+import type { ModelMenuTranslations } from './types_model_menu'+/** The locales compiled into the app (`TRANSLATIONS`). */export type BundledLocale = 'en' | 'zh' | 'zh-hant' | 'ja' | 'ar' | 'ru' | 'fr' | 'de' | 'es'@@ -3859,26 +3861,7 @@ export interface Translations {windowControls: stringpaneControls: stringappControls: string- modelMenu: {- search: string- noModels: string- editModels: string- followDefault: string- refreshModels: string- favorites: string- addFavorite: string- removeFavorite: string- favoriteShortcut: string- fast: string- free: string- cacheRead: string- priceTitle: (input: string, output: string, cache: string) => string- limited: string- limitedUntil: (time: string) => string- limitedTip: (provider: string, time: null | string) => string- modelResets: (time: string) => string- modelLimitedTip: (time: string) => string- }+ modelMenu: ModelMenuTranslationsmodelOptions: {noOptions: stringoptions: stringdiff --git a/apps/desktop/src/i18n/types_model_menu.ts b/apps/desktop/src/i18n/types_model_menu.tsnew file mode 100644index 00000000000..c6aadbebabb--- /dev/null+++ b/apps/desktop/src/i18n/types_model_menu.ts@@ -0,0 +1,20 @@+export interface ModelMenuTranslations {+ search: string+ noModels: string+ editModels: string+ followDefault: string+ refreshModels: string+ favorites: string+ addFavorite: string+ removeFavorite: string+ favoriteShortcut: string+ fast: string+ free: string+ cacheRead: string+ priceTitle: (input: string, output: string, cache: string) => string+ limited: string+ limitedUntil: (time: string) => string+ limitedTip: (provider: string, time: null | string) => string+ modelResets: (time: string) => string+ modelLimitedTip: (time: string) => string+}diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.tsindex b6c30eb9680..c50721c5cf5 100644--- a/apps/desktop/src/i18n/zh.ts+++ b/apps/desktop/src/i18n/zh.ts@@ -2,6 +2,7 @@ import { defineFieldCopy } from '@/app/settings/field-copy'import { defineLocale } from './define-locale'import { introZh } from './intro-zh'+import { zhModelMenu } from './zh_model_menu'export const zh = defineLocale({externalOpenFailed: {@@ -4305,30 +4306,7 @@ export const zh = defineLocale({windowControls: '窗口控件',paneControls: '面板控件',appControls: '应用控件',- modelMenu: {- search: '搜索模型',- noModels: '未找到模型',- editModels: '编辑模型…',- followDefault: '使用设置中的默认模型',- refreshModels: '刷新模型',- favorites: '收藏',- addFavorite: '添加到收藏',- removeFavorite: '从收藏中移除',- favoriteShortcut: '⇧ 单击',- fast: '快速',- free: '免费',- cacheRead: '缓存读取',- priceTitle: (input: string, output: string, cache: string) =>- `输入 ${input}/Mtok · 输出 ${output}/Mtok` + (cache ? ` · 缓存读取 ${cache}/Mtok` : ''),- limited: '已限额',- limitedUntil: (time: string) => `限额至 ${time}`,- limitedTip: (provider: string, time: null | string) =>- time- ? `${provider} 已达到用量上限,将于 ${time} 重置;现在就可以先选好之后要用的模型。`- : `${provider} 已达到用量上限;现在就可以先选好重置后要用的模型。`,- modelResets: (time: string) => `${time} 恢复`,- modelLimitedTip: (time: string) => `该模型已达到自身上限,将于 ${time} 恢复。这里的其他模型仍可使用。`- },+ modelMenu: zhModelMenu,modelOptions: {noOptions: '此模型没有可用选项',options: '选项',diff --git a/apps/desktop/src/i18n/zh_model_menu.ts b/apps/desktop/src/i18n/zh_model_menu.tsnew file mode 100644index 00000000000..a58daae80b5--- /dev/null+++ b/apps/desktop/src/i18n/zh_model_menu.ts@@ -0,0 +1,24 @@+export const zhModelMenu = {+ search: '搜索模型',+ noModels: '未找到模型',+ editModels: '编辑模型…',+ followDefault: '使用设置中的默认模型',+ refreshModels: '刷新模型',+ favorites: '收藏',+ addFavorite: '添加到收藏',+ removeFavorite: '从收藏中移除',+ favoriteShortcut: '⇧ 单击',+ fast: '快速',+ free: '免费',+ cacheRead: '缓存读取',+ priceTitle: (input: string, output: string, cache: string) =>+ `输入 ${input}/Mtok · 输出 ${output}/Mtok` + (cache ? ` · 缓存读取 ${cache}/Mtok` : ''),+ limited: '已限额',+ limitedUntil: (time: string) => `限额至 ${time}`,+ limitedTip: (provider: string, time: null | string) =>+ time+ ? `${provider} 已达到用量上限,将于 ${time} 重置;现在就可以先选好之后要用的模型。`+ : `${provider} 已达到用量上限;现在就可以先选好重置后要用的模型。`,+ modelResets: (time: string) => `${time} 恢复`,+ modelLimitedTip: (time: string) => `该模型已达到自身上限,将于 ${time} 恢复。这里的其他模型仍可使用。`+}diff --git a/hermes_cli/inventory.py b/hermes_cli/inventory.pyindex 1e6de63db05..2ad04d8c71c 100644--- a/hermes_cli/inventory.py+++ b/hermes_cli/inventory.py@@ -257,6 +257,7 @@ def _apply_limits(rows: list[dict]) -> None:"""Attach ``limit`` to rows whose credential pool is rate-limited, so a picker can say why and untilwhen instead of the row just looking broken. Only providers with a persisted pool are read (noseeding), and a pool that fails to load says nothing rather than failing the whole catalog."""+ import loggingfrom datetime import datetime, timezonefrom agent.credential_pool import load_pool@@ -272,7 +273,8 @@ def _apply_limits(rows: list[dict]) -> None:continuetry:state = load_pool(slug).limit_state(row.get("models") or [])- except Exception:+ except Exception: # an unreadable pool must not fail the whole catalog+ logging.getLogger(__name__).debug("Pool limit read failed for %s", slug, exc_info=True)continueif state is None:continue