Skip to content

Commit 9f3d3e1

Browse files
authored
fix(search): remove the extra assistant tools gate (#9468)
Remove the redundant Assistant tool rollout gate while retaining organization access, account ownership, source restrictions, and action approval policies. Keep Search editing and submission disabled until hydration is ready, then autofocus the field. Cover early edits and draft restoration with a held-script browser regression.
1 parent 465ea3c commit 9f3d3e1

19 files changed

Lines changed: 78 additions & 154 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/app/o/[organizationId]/components/search-input-bar.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { InputToolbar } from '@/app/workspace/[workspaceId]/home/components/user
1616
interface SearchInputBarProps {
1717
inputRef: RefObject<HTMLTextAreaElement | null>
1818
value: string
19+
disabled?: boolean
1920
onChange: (value: string) => void
2021
onSubmit: () => void
2122
onPaste?: ClipboardEventHandler<HTMLTextAreaElement>
@@ -36,6 +37,7 @@ export function SearchInputBar({
3637
attachments,
3738
inputRef,
3839
value,
40+
disabled = false,
3941
onChange,
4042
onSubmit,
4143
onPaste,
@@ -106,6 +108,7 @@ export function SearchInputBar({
106108
inputRef={inputRef}
107109
scrollerRef={scrollerRef}
108110
value={value}
111+
disabled={disabled}
109112
compact={!hasAttachments && !expanded}
110113
className={hasAttachments ? 'min-h-[56px]' : undefined}
111114
maxHeight={200}

‎apps/sim/app/o/[organizationId]/search/search.tsx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { MicButton } from '@/app/workspace/[workspaceId]/home/components/user-in
2626
import { MicrophonePermissionHelp } from '@/app/workspace/[workspaceId]/home/components/user-input/components/microphone-permission-help/microphone-permission-help'
2727
import { HomeFallback } from '@/app/workspace/[workspaceId]/home/home-fallback'
2828
import { knowledgeKeys } from '@/hooks/queries/utils/knowledge-keys'
29+
import { useHydrated } from '@/hooks/use-hydrated'
2930
import { useVoiceInput } from '@/hooks/use-voice-input'
3031
import { useMothershipDraftsStore } from '@/stores/mothership-drafts/store'
3132

@@ -54,6 +55,7 @@ interface SearchFieldProps {
5455
/** Search commits a query on submit while retaining an independent editable draft. */
5556
function SearchField({ userId, initialValue, onSubmit }: SearchFieldProps) {
5657
const inputRef = useRef<HTMLTextAreaElement>(null)
58+
const hydrated = useHydrated()
5759
const { organization } = useOrganizationContext()
5860
const queryClient = useQueryClient()
5961
const queryKey = knowledgeKeys.searchQuery(
@@ -90,14 +92,17 @@ function SearchField({ userId, initialValue, onSubmit }: SearchFieldProps) {
9092
getValue: () => value,
9193
onChange: setValue,
9294
})
93-
const canSubmit = value.trim().length > 0
95+
const canSubmit = hydrated && value.trim().length > 0
9496

95-
useEffect(() => inputRef.current?.focus(), [])
97+
useEffect(() => {
98+
if (hydrated) inputRef.current?.focus()
99+
}, [hydrated])
96100

97101
const field = (
98102
<SearchInputBar
99103
inputRef={inputRef}
100104
value={value}
105+
disabled={!hydrated}
101106
onChange={setValue}
102107
onSubmit={() => submit()}
103108
floating={!initialValue.trim()}

‎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.',

0 commit comments

Comments
 (0)