diff --git a/apps/desktop/src/sdk/index.ts b/apps/desktop/src/sdk/index.ts index 9b2b80e6f3..1c9cf344aa 100644 --- a/apps/desktop/src/sdk/index.ts +++ b/apps/desktop/src/sdk/index.ts @@ -71,8 +71,8 @@ import { rememberedSessionProfile, requestSessionResume, sessionMatchesStoredId, - setSessionOwnerHint, - setResumeExhaustedSessionId + setResumeExhaustedSessionId, + setSessionOwnerHint } from '@/store/session' import { $focusedRuntimeId, @@ -135,6 +135,7 @@ const $focusedSessionOwner = computed( const activeConnectionId = String( connection?.connectionId || (connection?.mode === 'local' ? 'local' : '') ).trim() + const fallback = { connectionId: activeConnectionId, profile: normalizeProfileKey(activeProfile) @@ -158,6 +159,7 @@ const $focusedSessionOwner = computed( } const owners = new Map() + for (const row of sessions.filter(session => sessionMatchesStoredId(session, focused))) { const connectionId = String(row.connection_id || '').trim() const profile = normalizeProfileKey(row.profile) @@ -543,6 +545,7 @@ export const host = { profile: String(profile.profile || '').trim(), targetProfile: String(profile.targetProfile || '').trim() } + const name = typeof profile === 'string' ? profile.trim() : route?.profile || '' if (route && (!route.connectionId || !route.profile || !route.targetProfile)) { diff --git a/apps/desktop/src/store/session.ts b/apps/desktop/src/store/session.ts index 421e63e23b..330d9c57cc 100644 --- a/apps/desktop/src/store/session.ts +++ b/apps/desktop/src/store/session.ts @@ -9,8 +9,8 @@ import { activeConnectionScopeSuffix, rescopeConnectionScopedStores } from '@/li import { persistBoolean, persistString, storedBoolean, storedString } from '@/lib/storage' import { syncCronModelImpactConnection } from '@/store/cron-model-impact-scope' import type { SessionInfo, UsageStats } from '@/types/hermes' -import type { SessionProfileRoute } from './session-request-router' +import type { SessionProfileRoute } from './session-request-router' import { clearUnreadOnOpen } from './session-unread-remote' type Updater = T | ((current: T) => T) @@ -615,6 +615,7 @@ function sessionOwnerHintKey(sessionId: string, route: Pick = profile === undefined ? matchingTailEntries(storedSessionId) : [[transcriptTailKey(storedSessionId, profile), current[transcriptTailKey(storedSessionId, profile)]]] @@ -166,6 +167,7 @@ export function transcriptTailState( export function clearTranscriptTail(storedSessionId: string, profile?: TranscriptProfileScope): void { const current = $transcriptTailBySessionId.get() + const keys = profile === undefined ? matchingTailEntries(storedSessionId).map(([key]) => key) : [transcriptTailKey(storedSessionId, profile)]