The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): seed the composer with an exact speed tier from config
kshitijk4poor95cb32ab0ea4
diff --git a/apps/desktop/src/app/session/hooks/use-hermes-config.test.ts b/apps/desktop/src/app/session/hooks/use-hermes-config.test.tsindex d8267cca433..20d1ffbbe47 100644--- a/apps/desktop/src/app/session/hooks/use-hermes-config.test.ts+++ b/apps/desktop/src/app/session/hooks/use-hermes-config.test.ts@@ -10,6 +10,7 @@ import {$currentCwd,$currentFastMode,$currentReasoningEffort,+ $currentServiceTier,$defaultReasoningEffort,markComposerSelectionManual,setCurrentCwd,@@ -202,7 +203,8 @@ describe('useHermesConfig refreshHermesConfig', () => {refreshC = result.current.refreshHermesConfig(true)})- profileC.resolve({ agent: { reasoning_effort: 'low', service_tier: 'normal' } })+ // A raw OpenAI tier word the composer cannot send (create would 4002) seeds Standard.+ profileC.resolve({ agent: { reasoning_effort: 'low', service_tier: 'flex' } })await act(async () => {await refreshC})@@ -213,6 +215,7 @@ describe('useHermesConfig refreshHermesConfig', () => {expect($currentReasoningEffort.get()).toBe('low')expect($currentFastMode.get()).toBe(false)+ expect($currentServiceTier.get()).toBe('normal')})it('does not let an older profile response restore its terminal font', async () => {diff --git a/apps/desktop/src/app/session/hooks/use-hermes-config.ts b/apps/desktop/src/app/session/hooks/use-hermes-config.tsindex 3d51ee0a026..824dce123e8 100644--- a/apps/desktop/src/app/session/hooks/use-hermes-config.ts+++ b/apps/desktop/src/app/session/hooks/use-hermes-config.ts@@ -30,7 +30,18 @@ import {import { setChatFontFamilyFromConfig } from '@/themes/chat-font'const DEFAULT_VOICE_SECONDS = 120-const FAST_TIERS = new Set(['fast', 'priority', 'on', 'ultrafast'])+const FAST_TIERS = new Set(['fast', 'priority', 'on'])++/** `agent.service_tier` is whatever the user wrote (`flex`, `scale`, `auto`, …);+ * the composer only speaks the three exact tiers `session.create` accepts.+ * Unset stays unset (the profile default rides). */+function composerServiceTier(value: unknown): string {+ const tier = String(value ?? '')+ .trim()+ .toLowerCase()++ return !tier ? '' : tier === 'ultrafast' ? 'ultrafast' : FAST_TIERS.has(tier) ? 'priority' : 'normal'+}function recordingLimit(value: unknown) {return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : DEFAULT_VOICE_SECONDS@@ -101,7 +112,7 @@ export function useHermesConfig({ activeSessionIdRef }: HermesConfigOptions) {])const reasoning = normalizeConfigEffort(config.agent?.reasoning_effort)- const tier = String(config.agent?.service_tier || '').trim()+ const tier = composerServiceTier(config.agent?.service_tier)// Publish the profile default regardless of whether the composer is// reseeded below: picker rows and preset application resolve "the@@ -124,7 +135,7 @@ export function useHermesConfig({ activeSessionIdRef }: HermesConfigOptions) {}setCurrentReasoningEffort(reasoning)- setCurrentFastMode(FAST_TIERS.has(tier.toLowerCase()))+ setCurrentFastMode(tier === 'priority' || tier === 'ultrafast')setCurrentServiceTier(tier)}