Skip to content

Commit e27b48d

Browse files
committed
fix(search): retarget unrelated-tool fixtures, type the web citation test, mark chat open-world
1 parent 6da58e5 commit e27b48d

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/home/components/message-content/resolve-citations.test.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { normalizeMessage } from '@/lib/mothership/chat/persisted-message'
44
import { compactRetrievalCitations } from '@/lib/mothership/chat/retrieval-citations'
55
import { collectCitedMessageSources } from '@/app/workspace/[workspaceId]/home/components/message-content/message-sources'
66
import { resolveMessageCitations } from '@/app/workspace/[workspaceId]/home/components/message-content/resolve-citations'
7-
import type { ContentBlock } from '@/app/workspace/[workspaceId]/home/types'
7+
import type { ContentBlock, ToolCallStatus } from '@/app/workspace/[workspaceId]/home/types'
88

99
const output = {
1010
success: true,
@@ -138,7 +138,11 @@ describe('evidence-linked citations', () => {
138138
},
139139
],
140140
}
141-
const webBlocks = (status: string, success: boolean, result: unknown): ContentBlock[] => [
141+
const webBlocks = (
142+
status: ToolCallStatus,
143+
success: boolean,
144+
result: unknown
145+
): ContentBlock[] => [
142146
{
143147
type: 'tool_call',
144148
toolCall: { id: 'web', name: 'web_search', status, result: { success, output: result } },

‎apps/sim/lib/knowledge/application/chat.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ describe('Search Assistant citations', () => {
276276
it.each([
277277
tool({ data: citation }, { status: 'error' }),
278278
tool({ success: false, data: citation }),
279-
tool({ data: citation }, { name: 'web_search' }),
279+
tool({ data: citation }, { name: 'call_integration_tool' }),
280280
tool({ data: { ...citation, citationUrl: 'javascript:alert(1)' } }),
281281
tool({ data: { ...citation, citationUrl: 'https://user:password@docs.example' } }),
282282
])('does not cite failed, unrelated, or unsafe evidence', (result) => {

‎apps/sim/lib/knowledge/mcp/server.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export function createKnowledgeMcpServer(context: KnowledgeMcpContext): McpServe
246246
readOnlyHint: false,
247247
destructiveHint: false,
248248
idempotentHint: false,
249-
openWorldHint: false,
249+
openWorldHint: true,
250250
},
251251
},
252252
async ({ query, ...filters }, extra) =>

‎apps/sim/lib/mothership/chat/citation-evidence.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type RetrievalCitationSource = {
1818
const WEB_TOOLS = new Set(['web_search', 'web_fetch'])
1919
const CITATION_TOOLS = new Set(['search_workspace', 'read_document', ...WEB_TOOLS])
2020

21+
/** Whether a successful result of this tool may supply source destinations. */
2122
export function isCitationTool(toolName: string): boolean {
2223
return CITATION_TOOLS.has(toolName)
2324
}

0 commit comments

Comments
 (0)