Skip to content

Commit e6916a8

Browse files
committed
fix(search): preserve transcript details and account search
1 parent cd14067 commit e6916a8

5 files changed

Lines changed: 69 additions & 10 deletions

File tree

‎apps/sim/app/o/[organizationId]/integrations/live-member-integrations.tsx‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ export function LiveMemberIntegrations({ organizationId, search }: LiveMemberInt
6666
(data.viewerMcpAccounts ?? []).filter(
6767
(account) => mcpProviders.get(account.mcpServerId) === provider
6868
)
69+
const accountsForProvider = (provider: string) =>
70+
liveSearchMcpConnector(provider)
71+
? mcpAccounts(provider)
72+
: (data.viewerAccounts ?? []).filter(
73+
(account) => liveSearchProviderForCredential(account.providerId) === provider
74+
)
6975
const available = LIVE_SEARCH_SOURCE_TYPES.filter(
7076
([provider]) =>
7177
LIVE_SEARCH_SCOPE_FIELDS[provider] &&
@@ -77,8 +83,7 @@ export function LiveMemberIntegrations({ organizationId, search }: LiveMemberInt
7783
)
7884
const query = search.trim().toLowerCase()
7985
const visible = available.filter(([provider, meta]) =>
80-
`${provider} ${meta.name} ${(data.viewerAccounts ?? [])
81-
.filter((account) => liveSearchProviderForCredential(account.providerId) === provider)
86+
`${provider} ${meta.name} ${accountsForProvider(provider)
8287
.map((account) => account.displayName)
8388
.join(' ')}`
8489
.toLowerCase()
@@ -120,11 +125,7 @@ export function LiveMemberIntegrations({ organizationId, search }: LiveMemberInt
120125
(server) => server.managedConnectorId === provider && server.enabled
121126
)
122127
: undefined
123-
const accounts = liveSearchMcpConnector(provider)
124-
? mcpAccounts(provider)
125-
: (data.viewerAccounts ?? []).filter(
126-
(account) => liveSearchProviderForCredential(account.providerId) === provider
127-
)
128+
const accounts = accountsForProvider(provider)
128129
const ready =
129130
group?.status === 'active' &&
130131
Boolean(option || server) &&

‎apps/sim/app/o/[organizationId]/settings/components/integrations/live-search-settings.test.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ describe('live search administration', () => {
250250
mockAccounts.mockReturnValue({
251251
data: {
252252
credentialGroup: {
253+
status: 'active',
253254
options: [{ provider: 'jira', status: 'active', configurationStatus: 'ready' }],
254255
},
255256
},

‎apps/sim/lib/sim-search/live/granola-mcp.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { toArray, toRecord } from '@sim/utils/object'
1+
import { isRecordLike, toArray, toRecord } from '@sim/utils/object'
22
import { load } from 'cheerio'
33
import { nativeText } from '@/lib/sim-search/live/dates'
44
import { NativeSearchError, string } from '@/lib/sim-search/live/http'
@@ -305,7 +305,13 @@ export async function readGranolaMcp(
305305
'unavailable',
306306
'Granola returned a different meeting transcript.'
307307
)
308-
const content = plainText(payload.transcript ?? payload.text ?? result)
308+
const value = payload.transcript ?? payload.text ?? result
309+
const content =
310+
typeof value === 'string'
311+
? value
312+
: Array.isArray(value) || isRecordLike(value)
313+
? JSON.stringify(value)
314+
: ''
309315
if (content) transcript = `Transcript\n${content}`
310316
} catch (error) {
311317
if (!(error instanceof NativeSearchError) || error.status === 'reconnect') throw error

‎apps/sim/lib/sim-search/live/meeting-mcp.test.ts‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,54 @@ describe('meeting MCP provider wire contracts', () => {
100100
expect(document.content.length).toBeLessThanOrEqual(200_000)
101101
})
102102

103+
it.each(['segments', 'record'] as const)(
104+
'preserves supplied Granola %s speaker, audio source, and transcript details',
105+
async (shape) => {
106+
const segments = [
107+
{ speaker: 'Speaker A', source: 'System audio', text: 'The rollout needs approval.' },
108+
{ source: 'Microphone', text: 'I will check the rollback procedure.' },
109+
]
110+
const transcript =
111+
shape === 'segments' ? segments : { segments, recorder: 'Recorder Example' }
112+
const client: ManagedSearchMcpClient = {
113+
async call(name) {
114+
if (name === 'get_meetings')
115+
return {
116+
meetings: [
117+
{ id: meetingId, title: 'Synthetic planning', notes: 'Approval is pending.' },
118+
],
119+
}
120+
return { meeting_id: meetingId, transcript }
121+
},
122+
}
123+
const document = await readGranolaMcp(client, meetingId)
124+
expect(document.content).toContain('Speaker A')
125+
expect(document.content).toContain('System audio')
126+
expect(document.content).toContain('Microphone')
127+
expect(document.content).toContain('The rollout needs approval.')
128+
expect(document.content).toContain('I will check the rollback procedure.')
129+
if (shape === 'record') expect(document.content).toContain('Recorder Example')
130+
}
131+
)
132+
133+
it('keeps legacy Granola transcript labels and wording unchanged', async () => {
134+
const transcript =
135+
'[00:01] Speaker A (System audio): The rollout needs approval.\n[00:03] Microphone: I will check.'
136+
const client: ManagedSearchMcpClient = {
137+
async call(name) {
138+
if (name === 'get_meetings')
139+
return {
140+
meetings: [
141+
{ id: meetingId, title: 'Synthetic planning', notes: 'Approval is pending.' },
142+
],
143+
}
144+
return { meeting_id: meetingId, transcript }
145+
},
146+
}
147+
const document = await readGranolaMcp(client, meetingId)
148+
expect(document.content).toContain(transcript)
149+
})
150+
103151
it('fails on unknown Fireflies list formats rather than claiming zero matches', async () => {
104152
const client = {
105153
async call() {

‎apps/sim/scripts/test-search-discussions-live.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,10 @@ async function runQuery(test: QueryCase) {
287287
const expected = page.documents.find((document) => document.id === test.expectedId)
288288
assert.ok(expected, 'Expected discussion result missing')
289289
const oracle = oracleRows.find((row) => string(row.number) === test.expectedId)
290-
const matches = array(oracle?.text_matches).filter((match) => string(match.fragment))
290+
const matches = array(oracle?.text_matches).filter((match) => {
291+
const type = string(match.object_type)
292+
return (type === 'IssueComment' || type === 'ReviewComment') && string(match.fragment)
293+
})
291294
assert.ok(matches.length, 'Oracle did not supply a matched discussion fragment')
292295
for (const match of matches) {
293296
assert.ok(

0 commit comments

Comments
 (0)