Skip to content

Commit e701f90

Browse files
committed
fix(search): remove the extra assistant tools gate
1 parent 465ea3c commit e701f90

15 files changed

Lines changed: 36 additions & 140 deletions

File tree

‎.github/scripts/http-e2e.sh‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ case "$group" in
205205
export COPILOT_TOOL_PERMISSIONS_ENABLED=true
206206
export KNOWLEDGE_MEMBER_ACCESS=true CREDENTIAL_GROUPS=true ACCESS_CONTROL_ENABLED=true
207207
export NEXT_PUBLIC_ACCESS_CONTROL_ENABLED=true NEXT_PUBLIC_ORGANIZATIONS_ENABLED=true
208-
export MSHIP_SEARCH_INTEGRATION_TOOLS=true
209208
bunx --no-install playwright install --with-deps chromium
210209
export INTERNAL_API_SECRET=desktop-inbox-http-ci-local-secret-at-least-32-characters
211210
export DB_TX_TRIPWIRE=throw

‎apps/docs/content/docs/platform/self-hosting/environment-variables.mdx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ Plain JavaScript without imports runs in isolated-vm within Node child workers i
188188
| Variable | Description |
189189
|----------|-------------|
190190
| `COPILOT_API_KEY` | API key for the default Sim service. Required for Chat, the Sim Chat workflow block, and Inbox operations that use that service |
191-
| `MSHIP_SEARCH_INTEGRATION_TOOLS` | Opt in to personal-account reads and reviewed actions in Search Assistant. Off by default. Applies when AppConfig is disabled or no feature-flags document is available; an available AppConfig document takes precedence. Requires organization account setup and configured provider credentials. Tool permissions and source restrictions still apply. See [Connect your account](/search/connect-your-account) |
192191
| `NEXT_PUBLIC_CHAT_DISABLED` | Set to `true` to hide the Chat module: the workspace lands on your first workflow, with no chats list or editor Chat panel. Chat is shown when unset; `bunx sim-setup` sets it for you if you skip the chat key |
193192
| `PII_URL` | Base URL of the Presidio service backing PII detection and redaction. The Helm chart wires it to its own `pii` Service when `pii.enabled`; on Compose point it at the PII service on your network. Local development and the Helm fallback use `http://localhost:5001`; that address works only when the service is reachable there. Point production at a running service to use redaction |
194193
| `ADMIN_API_KEY` | Admin API key for GitOps operations and organization provisioning |

‎apps/docs/content/docs/search/ask-questions.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Copy the reviewed draft into another app, or ask Assistant to create it using yo
125125

126126
## Review actions
127127

128-
When integration actions are enabled, Assistant can answer questions and take supported actions in the same conversation. For example, ask it to draft an email in Gmail or create a Jira issue using your own connected account.
128+
Assistant can answer questions and take supported actions in the same conversation. For example, ask it to draft an email in Gmail or create a Jira issue using your own connected account.
129129

130130
Reads run without a prompt by default. Writes wait for review by default. Each proposal appears inline in the conversation with its app, account, destination, and proposed content. Select **Edit** to change supported fields, then choose **Allow** or **Cancel** for each action. After several proposals, **Allow N shown** or **Cancel N shown** applies your choice to that displayed batch. You can approve individual actions first, then cancel the remaining batch.
131131

‎apps/docs/content/docs/search/connect-your-account.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Creating Jira sprints requires the Jira sprint permission. If your account was c
4646

4747
## Tool permissions
4848

49-
When Assistant integration actions are enabled, open the app in **Integrations** and select your account. Tool permissions appear in its details when the app has supported Assistant tools available to you. Set a preference for each operation or use the **Read-only tools** and **Write tools** group controls:
49+
Open the app in **Integrations** and select your account. Tool permissions appear in its details when the app has supported Assistant tools available to you. Set a preference for each operation or use the **Read-only tools** and **Write tools** group controls:
5050

5151
| Preference | Behavior |
5252
| --- | --- |

‎apps/sim/lib/assistant-actions/catalog.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { projectIntegrationToolsForViewer } from '@/lib/integrations/tool-projec
77
import { requireOrganizationSearchApproval } from '@/lib/knowledge/search/integration-policy'
88
import { projectAssistantConnectedAccountTool } from '@/lib/mothership/assistant/connected-account-tool'
99
import { isAssistantIntegrationTool } from '@/lib/mothership/assistant/tool-policy'
10-
import { isSearchIntegrationToolsEnabled } from '@/lib/mothership/feature-flags'
1110
import { getUserPermissionConfigForOrganization } from '@/lib/permission-groups/resolve.server'
1211
import { requiresScopedRetrieval } from '@/lib/sim-search/live/policy-schema'
1312
import { livePolicyFor, loadLiveSearchPolicies } from '@/lib/sim-search/live/policy-store'
@@ -17,17 +16,16 @@ export async function loadAssistantIntegrationTools(
1716
scope: { organizationId: string; userId: string },
1817
executor?: DbOrTx
1918
) {
20-
const [visibility, config, enabled] = await Promise.all([
19+
const [visibility, config] = await Promise.all([
2120
getBlockVisibility({ userId: scope.userId, orgId: scope.organizationId }),
2221
getUserPermissionConfigForOrganization(scope.organizationId, executor),
23-
isSearchIntegrationToolsEnabled(),
2422
])
2523
const tools = projectIntegrationToolsForViewer(visibility, config)
2624
.tools.map((entry) => ({
2725
...entry,
2826
config: projectAssistantConnectedAccountTool(entry.config),
2927
}))
30-
.filter(({ config: tool }) => enabled && isAssistantIntegrationTool(tool) && tool.oauth)
28+
.filter(({ config: tool }) => isAssistantIntegrationTool(tool) && tool.oauth)
3129
const providers = [
3230
...new Set(
3331
tools.flatMap(({ config: tool }) => {

‎apps/sim/lib/assistant-actions/tool-permissions.integration.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ import { getToolMetadata } from '@/tools/metadata'
7474

7575
vi.hoisted(() => {
7676
Object.assign(process.env, {
77-
MSHIP_SEARCH_INTEGRATION_TOOLS: 'true',
7877
JIRA_CLIENT_ID: 'assistant-fixture-client',
7978
JIRA_CLIENT_SECRET: 'assistant-fixture-client-secret',
8079
GOOGLE_CLIENT_ID: 'assistant-google-fixture-client',

‎apps/sim/lib/core/config/env.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,6 @@ export const env = createEnv({
606606
DASHBOARDS: z.boolean().optional(),
607607
PROJECTS: z.boolean().optional(), // Fallback for the `projects` feature flag off AppConfig
608608
MSHIP_COMPUTER_USE: z.boolean().optional(),
609-
MSHIP_SEARCH_INTEGRATION_TOOLS: z.boolean().optional(),
610609
WORKFLOW_TESTS: z.boolean().optional(), // Fallback for the `workflow-tests` feature flag off AppConfig
611610
CHANGELOG: z.boolean().optional(), // Fallback for the `changelog` feature flag off AppConfig
612611
MSHIP_MODEL_SELECTOR: z.boolean().optional(),

‎apps/sim/lib/core/config/feature-flags.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ const FEATURE_FLAGS = {
5757
'personal workspaces follow the global switch. Each device must also opt in.',
5858
fallback: 'MSHIP_COMPUTER_USE',
5959
},
60-
'mothership-search-integration-tools': {
61-
description:
62-
'Enable personal-account integration reads and reviewed actions in Search Assistant. Global rollout with MSHIP_SEARCH_INTEGRATION_TOOLS fallback when AppConfig is unavailable; disabled by default.',
63-
fallback: 'MSHIP_SEARCH_INTEGRATION_TOOLS',
64-
},
6560
'workflow-tests': {
6661
description:
6762
'Enable workflow tests: the workspace Tests page, tests/<name>.test.js files, and the Sim tests tool. Supports global and organization rollout; disabled by default.',

‎apps/sim/lib/mothership/chat/payload.test.ts‎

Lines changed: 27 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,17 @@ const {
4444
mockDashboardAvailability,
4545
mockSecretNames,
4646
mockComputerUseAvailable,
47-
mockSearchIntegrationToolsEnabled,
4847
} = vi.hoisted(() => ({
4948
mockDashboardAvailability: vi.fn(async () => false),
5049
mockComputerUseAvailable: vi.fn(async () => false),
5150
mockCreateUserToolSchema: vi.fn(() => ({ type: 'object', properties: {} })),
5251
mockSecretNames: vi.fn(async () => ({ names: [] as string[] })),
53-
mockSearchIntegrationToolsEnabled: vi.fn(async () => true),
5452
}))
5553

5654
vi.mock('@/lib/computer-use/application/availability', () => ({
5755
isComputerUseAvailableFor: mockComputerUseAvailable,
5856
}))
5957

60-
vi.mock('@/lib/mothership/feature-flags', () => ({
61-
isSearchIntegrationToolsEnabled: mockSearchIntegrationToolsEnabled,
62-
}))
63-
64-
beforeEach(() => mockSearchIntegrationToolsEnabled.mockResolvedValue(true))
65-
6658
// The inventory reads nine application worlds; these suites exercise the request shape, not the reads.
6759
vi.mock('@/lib/mothership/application/execute-organization-secret-use-case', () => ({
6860
executeOrganizationSecretUseCase: mockSecretNames,
@@ -948,49 +940,32 @@ describe('desktop request capabilities', () => {
948940
})
949941
})
950942

951-
it('carries only enabled MCP IDs without eager catalog discovery while preserving desktop capabilities', async () => {
952-
const { getBlockVisibilityForCopilot } = await import('@/lib/mothership/block-visibility')
953-
vi.mocked(getBlockVisibilityForCopilot).mockClear()
954-
const principal = createSessionPrincipal({ userId: 'user-org' })
955-
const payload = await buildCopilotRequestPayload({
956-
message: 'Use my tools',
957-
userId: 'user-org',
958-
userMessageId: 'message-org',
959-
organizationId: 'org-catalog',
960-
chatId: 'chat-org',
961-
principal,
962-
mode: 'agent',
963-
model: '',
964-
mcpServerIds: ['server-a', 'server-b'],
965-
browser: true,
966-
terminalCapable: true,
967-
})
968-
expect(getBlockVisibilityForCopilot).not.toHaveBeenCalled()
969-
expect(payload.integrationCatalog).toEqual({ mcpServerIds: ['server-a', 'server-b'] })
970-
expect(payload).not.toHaveProperty('integrationTools')
971-
expect(payload).not.toHaveProperty('mothershipTools')
972-
expect(payload.desktop).toMatchObject({ browser: true, terminal: true })
973-
})
974-
975-
/** The worker derives both its gateway tools and prompt instructions from this capability. */
976-
it.each([{ organizationId: 'org-1' }, { workspaceId: 'ws-1' }])(
977-
'switches Search integration capability per turn while preserving Build for %j',
978-
async (scope) => {
979-
for (const enabled of [true, false, true]) {
980-
mockSearchIntegrationToolsEnabled.mockResolvedValue(enabled)
981-
for (const mode of ['assistant', 'agent', 'plan']) {
982-
const payload = await buildCopilotRequestPayload({
983-
message: 'Find a person',
984-
userId: 'person',
985-
userMessageId: 'message',
986-
mode,
987-
model: '',
988-
...scope,
989-
})
990-
expect(payload.integrationCatalog).toEqual(
991-
mode === 'assistant' && !enabled ? undefined : { mcpServerIds: [] }
992-
)
993-
}
994-
}
943+
it.each(['assistant', 'agent', 'plan'] as const)(
944+
'advertises the integration gateway while isolating MCP and desktop capabilities in %s mode',
945+
async (mode) => {
946+
const { getBlockVisibilityForCopilot } = await import('@/lib/mothership/block-visibility')
947+
vi.mocked(getBlockVisibilityForCopilot).mockClear()
948+
const principal = createSessionPrincipal({ userId: 'user-org' })
949+
const payload = await buildCopilotRequestPayload({
950+
message: 'Use my tools',
951+
userId: 'user-org',
952+
userMessageId: 'message-org',
953+
organizationId: 'org-catalog',
954+
chatId: 'chat-org',
955+
principal,
956+
mode,
957+
model: '',
958+
mcpServerIds: ['server-a', 'server-b'],
959+
browser: true,
960+
terminalCapable: true,
961+
})
962+
expect(getBlockVisibilityForCopilot).not.toHaveBeenCalled()
963+
expect(payload.integrationCatalog).toEqual({
964+
mcpServerIds: mode === 'assistant' ? [] : ['server-a', 'server-b'],
965+
})
966+
expect(payload).not.toHaveProperty('integrationTools')
967+
expect(payload).not.toHaveProperty('mothershipTools')
968+
if (mode === 'assistant') expect(payload.desktop).toBeUndefined()
969+
else expect(payload.desktop).toMatchObject({ browser: true, terminal: true })
995970
}
996971
)

‎apps/sim/lib/mothership/chat/payload.ts‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import type { AssistantImageContent } from '@/lib/mothership/chat/assistant-imag
3232
import { buildUploadedFileContext } from '@/lib/mothership/chat/upload-context'
3333
import { buildWorkspaceInventory } from '@/lib/mothership/chat/workspace-inventory'
3434
import { computeEntitlements } from '@/lib/mothership/entitlements'
35-
import { isSearchIntegrationToolsEnabled } from '@/lib/mothership/feature-flags'
3635
import type { AssistantSearchLevel } from '@/lib/mothership/generated/assistant'
3736
import {
3837
type ChatRequest,
@@ -388,7 +387,6 @@ export async function buildCopilotRequestPayload(params: BuildPayloadParams): Pr
388387
params.principal !== undefined &&
389388
computerUseOwner !== null &&
390389
(await isComputerUseAvailableFor(params.principal, computerUseOwner))
391-
const integrationGateway = !isAssistant || (await isSearchIntegrationToolsEnabled())
392390

393391
// Track uploaded files in the DB and build context tags instead of base64 inlining.
394392
// Tracking writes `workspace_files` rows, so it needs the same write grant the
@@ -539,13 +537,9 @@ export async function buildCopilotRequestPayload(params: BuildPayloadParams): Pr
539537
messageId: userMessageId,
540538
...(chatId ? { chatId } : {}),
541539
...(allContexts.length > 0 ? { context: allContexts } : {}),
542-
...(integrationGateway
543-
? {
544-
integrationCatalog: {
545-
mcpServerIds: isAssistant ? [] : [...new Set(params.mcpServerIds ?? [])],
546-
},
547-
}
548-
: {}),
540+
integrationCatalog: {
541+
mcpServerIds: isAssistant ? [] : [...new Set(params.mcpServerIds ?? [])],
542+
},
549543
...(params.userTimezone ? { userTimezone: params.userTimezone } : {}),
550544
...(params.effort ? { effort: params.effort } : {}),
551545
...(params.modelSelection ? { modelSelection: params.modelSelection } : {}),

0 commit comments

Comments
 (0)