The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(desktop): cover unverified active transcript owner boundaries
yoniebans9397101dd532
diff --git a/apps/desktop/src/app/contrib/hooks/use-background-sync.owner-boundary.test.ts b/apps/desktop/src/app/contrib/hooks/use-background-sync.owner-boundary.test.tsnew file mode 100644index 00000000000..a9272a12136--- /dev/null+++ b/apps/desktop/src/app/contrib/hooks/use-background-sync.owner-boundary.test.ts@@ -0,0 +1,31 @@+import { afterEach, expect, it } from 'vitest'++import { $activeSessionId, _resetSessionOwnerHintsForTests, setSessionOwnerHint, setSessions } from '@/store/session'+import { $sessionTiles } from '@/store/session-states'++import { resolveActiveTranscriptSession } from './use-background-sync'++afterEach(() => {+ $activeSessionId.set(null)+ $sessionTiles.set([])+ setSessions([])+ _resetSessionOwnerHintsForTests()+})++it('does not promote a different runtime tile into the active transcript owner', () => {+ const ownerRoute = { connectionId: 'local', profile: 'other-profile', mode: 'local' as const }+ $activeSessionId.set('active-runtime')+ setSessions([{ id: 'shared', profile: 'default', source: 'desktop' } as never])+ $sessionTiles.set([{ storedSessionId: 'shared', runtimeId: 'other-runtime', ownerRoute }])++ expect(resolveActiveTranscriptSession('shared', 'active-runtime')).toEqual({ profile: 'default' })+})++it('does not treat an ownerless active tile as corroboration for a stale hint', () => {+ $activeSessionId.set('active-runtime')+ setSessions([{ id: 'shared', profile: 'default', source: 'desktop' } as never])+ setSessionOwnerHint('shared', { connectionId: 'stale-connection', profile: 'stale-profile', mode: 'remote' })+ $sessionTiles.set([{ storedSessionId: 'shared', runtimeId: 'active-runtime' }])++ expect(resolveActiveTranscriptSession('shared', 'active-runtime')).toEqual({ profile: 'default' })+})