Skip to content

The agent that grows with you

test(desktop): trim the same-named-profile routing coverage to two invariants

teknium1891a2eb573ff
diff --git a/apps/desktop/src/app/contrib/session-rpc-dispatcher.test.ts b/apps/desktop/src/app/contrib/session-rpc-dispatcher.test.ts
index 2a5517e3bc6..7544aeeb115 100644
--- a/apps/desktop/src/app/contrib/session-rpc-dispatcher.test.ts
+++ b/apps/desktop/src/app/contrib/session-rpc-dispatcher.test.ts
@@ -241,53 +241,6 @@ describe('createSessionRpcDispatcher: routes by the session OWNING connection wh
expect(gatewayMocks.requestGatewayForProfile).not.toHaveBeenCalled()
expect(ambientRequest).not.toHaveBeenCalled()
})
-
- it('routes a session that lives on the REMOTE connection to that connection', async () => {
- gatewayMocks.activeConnectionId = 'local'
- twoConnections()
- recordSessionEventScope({ connectionId: 'homelab', profile: 'default', session_id: 'rt-remote' })
- setSessions([makeSessionInfo({ id: 'rt-remote', profile: 'default' })])
- const { ambientRequest, request } = dispatcher()
-
- await expect(request('prompt.submit', { session_id: 'rt-remote', text: 'again' })).resolves.toEqual({
- routed: true
- })
-
- expect(gatewayMocks.requestGatewayForAgent).toHaveBeenCalledWith('homelab', 'default', 'prompt.submit', {
- session_id: 'rt-remote',
- text: 'again'
- })
- expect(gatewayMocks.requestGatewayForProfile).not.toHaveBeenCalled()
- expect(ambientRequest).not.toHaveBeenCalled()
- })
-
- it('keeps a connection-tagged row owner over a conflicting event scope', async () => {
- gatewayMocks.activeConnectionId = 'homelab'
- twoConnections()
- setSessions([makeSessionInfo({ connection_id: 'source-b', id: 'stored-shared', profile: 'default' })])
- recordSessionEventScope({ connectionId: 'local', profile: 'default', session_id: 'stored-shared' })
-
- await expect(dispatcher().request('session.resume', { session_id: 'stored-shared' })).resolves.toEqual({
- routed: true
- })
-
- expect(gatewayMocks.requestGatewayForAgent).toHaveBeenLastCalledWith('source-b', 'default', 'session.resume', {
- session_id: 'stored-shared'
- })
- })
-
- it('leaves a request with NO session context on the ambient socket, ledger or not', async () => {
- gatewayMocks.activeConnectionId = 'homelab'
- twoConnections()
- recordSessionEventScope({ connectionId: 'local', profile: 'default', session_id: 'rt-local' })
- const { ambientRequest, request } = dispatcher()
-
- await expect(request('config.get', {})).resolves.toEqual({ ambient: true })
-
- expect(ambientRequest).toHaveBeenCalledWith('config.get', {})
- expect(gatewayMocks.requestGatewayForAgent).not.toHaveBeenCalled()
- expect(gatewayMocks.requestGatewayForProfile).not.toHaveBeenCalled()
- })
})
describe('createSessionRpcDispatcher: stale runtime recovery', () => {
diff --git a/apps/desktop/src/store/session-states.test.ts b/apps/desktop/src/store/session-states.test.ts
index 2d522bf8103..cd78911b3b0 100644
--- a/apps/desktop/src/store/session-states.test.ts
+++ b/apps/desktop/src/store/session-states.test.ts
@@ -1314,12 +1314,6 @@ describe('knownOwnerForSession / requestForOwnedSession (#91684 client half)', (
expect(knownOwnerForSession('rt-local')).toEqual({ connectionId: 'local', profile: 'default' })
})
- it('still answers with the bare row profile when no event ever named the connection', () => {
- setSessions([{ id: 'rt-unproven', profile: 'default' } as never])
-
- expect(knownOwnerForSession('rt-unproven')).toBe('default')
- })
-
it('returns undefined (ambient) when no owner is known, and for null ids', () => {
expect(knownOwnerForSession('unknown-session')).toBeUndefined()
expect(knownOwnerForSession(null)).toBeUndefined()