Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

perf(posthog-ai): stop mounting max on every page (#126788)

Paul D'Ambraffc17c0f0e7a
diff --git a/frontend/bin/layer-baseline.txt b/frontend/bin/layer-baseline.txt
index 7ac745aa8f11..a2b83280e0f6 100644
--- a/frontend/bin/layer-baseline.txt
+++ b/frontend/bin/layer-baseline.txt
@@ -17,7 +17,6 @@ frontend/src/layout/GlobalModals.tsx -> products/conversations/frontend/componen
frontend/src/layout/GlobalModals.tsx -> products/logs/frontend/components/LogsViewer/LogsViewerModal/logsViewerModalLogic.ts
frontend/src/layout/InternalFeedback/InternalFeedbackWidget.tsx -> frontend/src/toolbar/shared/product-tours/ElementHighlight.tsx
frontend/src/layout/InternalFeedback/internalFeedbackLogic.ts -> frontend/src/toolbar/shared/utils.ts
-frontend/src/layout/navigation-3000/Navigation.tsx -> frontend/src/scenes/max/maxGlobalLogic.tsx
frontend/src/layout/navigation-3000/sidepanel/panels/activity/quill/QuillActivitySubscribeMenu.tsx -> frontend/src/scenes/hog-functions/sub-templates/sub-templates.ts
frontend/src/layout/navigation-3000/sidepanel/panels/activity/sidePanelNotificationsLogic.tsx -> products/notifications/frontend/resourceEditedLogic.ts
frontend/src/layout/navigation-3000/sidepanel/panels/max/SidePanelMax.tsx -> frontend/src/scenes/max/maxLogic.tsx
@@ -53,7 +52,6 @@ frontend/src/layout/panel-layout/navbar/tabs/NavTabChat.tsx -> products/posthog_
frontend/src/layout/panel-layout/navbar/tabs/NavTabChat.tsx -> products/posthog_ai/frontend/api/primitives.ts
frontend/src/layout/panel-layout/navbar/tabs/navProductItems.ts -> frontend/src/scenes/data-management/definitionsSceneTabsLogic.tsx
frontend/src/layout/panel-layout/navbar/tabs/navProductItems.ts -> frontend/src/scenes/onboarding/welcome/welcomeNavItem.ts
-frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.ts -> frontend/src/scenes/settings/organization/aiConsentLogic.ts
frontend/src/layout/scenes/components/SceneTitlePanelButton.tsx -> frontend/src/scenes/max/useMaxTool.ts
frontend/src/layout/scenes/components/SceneTitleSection.tsx -> frontend/src/scenes/max/components/AnimatedSparkles.tsx
frontend/src/layout/today/TodayAiPanel.tsx -> frontend/src/scenes/max/components/PhaiSidePanelChat.tsx
@@ -239,7 +237,6 @@ frontend/src/lib/components/Cards/InsightCard/dashboardVisualizationOptions.tsx
frontend/src/lib/components/Cards/InsightCard/dashboardVisualizationOptions.tsx -> products/product_analytics/frontend/insights/retention/filters/RetentionChartPicker.tsx
frontend/src/lib/components/Cards/InsightCard/dashboardWidgetMenusLogic.ts -> frontend/src/scenes/dashboard/liveDashboardIds.ts
frontend/src/lib/components/Cards/InsightCard/visualizationShape.ts -> frontend/src/queries/utils.ts
-frontend/src/lib/components/Cards/TextCard/TextCardModal.tsx -> frontend/src/scenes/settings/organization/aiConsentLogic.ts
frontend/src/lib/components/Cards/TextCard/textCardMarkdown.ts -> products/dashboards/frontend/components/ImageTile/imageTileMarkdown.ts
frontend/src/lib/components/Cards/TextCard/textCardModalLogic.ts -> products/dashboards/frontend/components/ImageTile/imageTileUtils.ts
frontend/src/lib/components/ChartFilter/ChartFilter.tsx -> frontend/src/scenes/insights/insightLogic.tsx
diff --git a/frontend/src/scenes/settings/organization/aiConsentLogic.test.ts b/frontend/src/layout/ai/aiConsentLogic.test.ts
similarity index 100%
rename from frontend/src/scenes/settings/organization/aiConsentLogic.test.ts
rename to frontend/src/layout/ai/aiConsentLogic.test.ts
diff --git a/frontend/src/scenes/settings/organization/aiConsentLogic.ts b/frontend/src/layout/ai/aiConsentLogic.ts
similarity index 98%
rename from frontend/src/scenes/settings/organization/aiConsentLogic.ts
rename to frontend/src/layout/ai/aiConsentLogic.ts
index 2cd7d29af30a..1f8a54c84d57 100644
--- a/frontend/src/scenes/settings/organization/aiConsentLogic.ts
+++ b/frontend/src/layout/ai/aiConsentLogic.ts
@@ -9,9 +9,9 @@ import { lemonToast } from 'lib/lemon-ui/LemonToast'
import { organizationLogic } from 'scenes/organizationLogic'
import { userLogic } from 'scenes/userLogic'
-import { requestAiAccessCreate } from 'products/platform_features/frontend/generated/api'
+import type { OrganizationType, UserType } from '~/types'
-import type { OrganizationType, UserType } from '../../../types'
+import { requestAiAccessCreate } from 'products/platform_features/frontend/generated/api'
// Keep this stored across all projects, only display this once per month
const AI_DATA_PROCESSING_DISMISSED_STORAGE_KEY = `posthog_ai_data_processing_dismissed_${dayjs().format('YYYY-MM')}`
@@ -91,7 +91,7 @@ export type aiConsentLogicType = MakeLogicType<
>
export const aiConsentLogic = kea<aiConsentLogicType>([
- path(['scenes', 'settings', 'organization', 'aiConsentLogic']),
+ path(['layout', 'ai', 'aiConsentLogic']),
connect(() => ({
values: [organizationLogic, ['currentOrganization'], userLogic, ['user']],
})),
diff --git a/frontend/src/layout/ai/aiShellLogic.ts b/frontend/src/layout/ai/aiShellLogic.ts
index e87e19bbb3ed..4bf0f92527a0 100644
--- a/frontend/src/layout/ai/aiShellLogic.ts
+++ b/frontend/src/layout/ai/aiShellLogic.ts
@@ -1,10 +1,12 @@
-import { MakeLogicType, actions, connect, kea, path, reducers, selectors } from 'kea'
+import { MakeLogicType, actions, connect, kea, listeners, path, reducers, selectors } from 'kea'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import type { FeatureFlagsSet } from 'lib/logic/featureFlagLogic'
import { preflightLogic } from 'lib/logic/preflightLogic'
+import { newInternalTab } from 'lib/utils/newInternalTab'
import type { ToolRegistration } from 'scenes/max/max-constants'
+import { urls } from 'scenes/urls'
import type { PhaiViewMode } from '~/layout/ai/aiPanelIds'
import type { PreflightStatus } from '~/types'
@@ -26,6 +28,9 @@ export interface aiShellLogicValues {
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface aiShellLogicActions {
+ askSidePanelMax: (prompt: string) => {
+ prompt: string
+ }
deregisterTool: (key: string) => {
key: string
}
@@ -64,6 +69,7 @@ export const aiShellLogic = kea<aiShellLogicType>([
})),
actions({
setPhaiViewMode: (mode: PhaiViewMode) => ({ mode }),
+ askSidePanelMax: (prompt: string) => ({ prompt }),
registerTool: (tool: ToolRegistration) => ({ tool }),
deregisterTool: (key: string) => ({ key }),
}),
@@ -118,4 +124,9 @@ export const aiShellLogic = kea<aiShellLogicType>([
isPhaiSandboxFlagOn ? phaiViewMode : 'legacy',
],
}),
+ listeners({
+ askSidePanelMax: ({ prompt }) => {
+ newInternalTab(urls.ai(undefined, prompt))
+ },
+ }),
])
diff --git a/frontend/src/layout/navigation-3000/Navigation.tsx b/frontend/src/layout/navigation-3000/Navigation.tsx
index 39112e72f596..237ec548e1dc 100644
--- a/frontend/src/layout/navigation-3000/Navigation.tsx
+++ b/frontend/src/layout/navigation-3000/Navigation.tsx
@@ -4,9 +4,9 @@ import { useMountedLogic, useValues } from 'kea'
import { ReactNode, useLayoutEffect } from 'react'
import { mcpHintLogic } from 'lib/components/MCPHint/mcpHintLogic'
-import { maxGlobalLogic } from 'scenes/max/maxGlobalLogic'
import { SceneConfig } from 'scenes/sceneTypes'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { todayPanelChatSessionLogic } from '~/layout/today/todayPanelChatSessionLogic'
import { todayShellLogic } from '~/layout/today/todayShellLogic'
@@ -26,8 +26,9 @@ export function Navigation({
children: ReactNode
sceneConfig: SceneConfig | null
}): JSX.Element {
- useMountedLogic(maxGlobalLogic)
useMountedLogic(mcpHintLogic)
+ // Its mount resumes an AI approval that an SSO re-login interrupted, on whichever page the user lands.
+ useMountedLogic(aiConsentLogic)
const { mode } = useValues(navigation3000Logic)
const { todayRailEnabled: todayRail, phoneLayout } = useValues(todayShellLogic)
diff --git a/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.ts b/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.ts
index 71fa2d332a1a..cbb52ecba947 100644
--- a/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.ts
+++ b/frontend/src/layout/panel-layout/navbar/tabs/navProductsTabLogic.ts
@@ -12,10 +12,10 @@ import { preflightLogic } from 'lib/logic/preflightLogic'
import { getProductAccessDisabledReason } from 'lib/utils/accessControlUtils'
import { withTimeout } from 'lib/utils/async'
import { inStorybook, inStorybookTestRunner } from 'lib/utils/dom'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { teamLogic } from 'scenes/teamLogic'
import { fileSystemShortcutBulkUpdateCreate } from '~/generated/core/api'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { FileSystemEntry, FileSystemImport } from '~/queries/schema/schema-general'
import type { PreflightStatus, TeamPublicType, TeamType } from '~/types'
diff --git a/frontend/src/lib/components/Cards/TextCard/TextCardModal.tsx b/frontend/src/lib/components/Cards/TextCard/TextCardModal.tsx
index 846234ab5878..8012637120b0 100644
--- a/frontend/src/lib/components/Cards/TextCard/TextCardModal.tsx
+++ b/frontend/src/lib/components/Cards/TextCard/TextCardModal.tsx
@@ -12,8 +12,8 @@ import { LemonSwitch } from 'lib/lemon-ui/LemonSwitch'
import { LemonTextArea } from 'lib/lemon-ui/LemonTextArea/LemonTextArea'
import { DialogClose, DialogPrimitive, DialogPrimitiveTitle } from 'lib/ui/DialogPrimitive/DialogPrimitive'
import { cn } from 'lib/utils/css-classes'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { DashboardTileIdOrNew, DashboardType } from '~/types'
export function TextCardModal({
diff --git a/frontend/src/scenes/experiments/ExperimentWizard/experimentWizardLogic.test.tsx b/frontend/src/scenes/experiments/ExperimentWizard/experimentWizardLogic.test.tsx
index dc2b132a719b..1362b5de592b 100644
--- a/frontend/src/scenes/experiments/ExperimentWizard/experimentWizardLogic.test.tsx
+++ b/frontend/src/scenes/experiments/ExperimentWizard/experimentWizardLogic.test.tsx
@@ -40,7 +40,7 @@ jest.mock('scenes/feature-flags/JSONEditorInput', () => ({
// The consent gate reads a single selector; stubbing the logic lets each case pick the org's
// consent state without standing up organizationLogic's loaders.
-jest.mock('scenes/settings/organization/aiConsentLogic', () => {
+jest.mock('~/layout/ai/aiConsentLogic', () => {
const { kea, selectors } = jest.requireActual('kea')
return {
aiConsentLogic: kea([
diff --git a/frontend/src/scenes/experiments/ExperimentWizard/steps/ReplayVisionScannerOption.tsx b/frontend/src/scenes/experiments/ExperimentWizard/steps/ReplayVisionScannerOption.tsx
index 634094645e05..022c1c618bf8 100644
--- a/frontend/src/scenes/experiments/ExperimentWizard/steps/ReplayVisionScannerOption.tsx
+++ b/frontend/src/scenes/experiments/ExperimentWizard/steps/ReplayVisionScannerOption.tsx
@@ -3,9 +3,10 @@ import { useState } from 'react'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { AIConsentPopoverWrapper } from 'scenes/settings/organization/AIConsentPopoverWrapper'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
+
import { DEFAULT_MODEL, OBSERVATION_CREDITS_BY_MODEL } from 'products/replay_vision/frontend/replay_scanners/types'
import { getReplayVisionEditDisabledReason } from 'products/replay_vision/frontend/utils/accessControl'
import { formatCredits } from 'products/replay_vision/frontend/utils/credits'
diff --git a/frontend/src/scenes/max/components/MaybePhaiOnboarding.tsx b/frontend/src/scenes/max/components/MaybePhaiOnboarding.tsx
index b163582723a1..87f386ad9d9d 100644
--- a/frontend/src/scenes/max/components/MaybePhaiOnboarding.tsx
+++ b/frontend/src/scenes/max/components/MaybePhaiOnboarding.tsx
@@ -4,11 +4,11 @@ import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { sceneLogic } from 'scenes/sceneLogic'
import { MAX_SIDE_PANEL_ID } from '~/layout/ai/aiPanelIds'
+import { aiShellLogic } from '~/layout/ai/aiShellLogic'
import { sidePanelStateLogic } from '~/layout/navigation-3000/sidepanel/sidePanelStateLogic'
import { AiOnboarding } from 'products/posthog_ai/frontend/api/onboarding'
-import { maxGlobalLogic } from '../maxGlobalLogic'
import { resolvePhaiOnboardingMounts } from './phaiOnboardingHost'
/**
@@ -23,7 +23,7 @@ import { resolvePhaiOnboardingMounts } from './phaiOnboardingHost'
export function MaybePhaiOnboarding(): JSX.Element | null {
const { sceneId } = useValues(sceneLogic)
const { receivedFeatureFlags } = useValues(featureFlagLogic)
- const { effectivePhaiView } = useValues(maxGlobalLogic)
+ const { effectivePhaiView } = useValues(aiShellLogic)
const { sidePanelOpen, selectedTab } = useValues(sidePanelStateLogic)
const mounts = resolvePhaiOnboardingMounts({
diff --git a/frontend/src/scenes/max/maxGlobalLogic.test.ts b/frontend/src/scenes/max/maxGlobalLogic.test.ts
index d951afac5a75..c711064823bc 100644
--- a/frontend/src/scenes/max/maxGlobalLogic.test.ts
+++ b/frontend/src/scenes/max/maxGlobalLogic.test.ts
@@ -2,8 +2,8 @@ import { router } from 'kea-router'
import { expectLogic } from 'kea-test-utils'
import api from 'lib/api'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { SIDE_PANEL_PANEL_ID } from '~/layout/ai/aiPanelIds'
import { aiShellLogic } from '~/layout/ai/aiShellLogic'
import { useMocks } from '~/mocks/jest'
@@ -52,7 +52,7 @@ describe('maxGlobalLogic', () => {
jest.restoreAllMocks()
})
- // GlobalModals mounts this logic on every page. Mounting it alone must not mount the task list,
+ // Every PostHog AI surface mounts this logic. Mounting it alone must not mount the task list,
// or every boot fetches tasks, and a boot where the task list cannot build crashes the app.
it('mounts without mounting the task list', () => {
expect(logic.isMounted()).toBe(true)
diff --git a/frontend/src/scenes/max/maxGlobalLogic.tsx b/frontend/src/scenes/max/maxGlobalLogic.tsx
index 1f29ffede06d..f6147e3544f2 100644
--- a/frontend/src/scenes/max/maxGlobalLogic.tsx
+++ b/frontend/src/scenes/max/maxGlobalLogic.tsx
@@ -7,13 +7,12 @@ import api from 'lib/api'
import { dayjs } from 'lib/dayjs'
import { lemonToast } from 'lib/lemon-ui/LemonToast'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import { newInternalTab } from 'lib/utils/newInternalTab'
import { organizationLogic } from 'scenes/organizationLogic'
import { sceneLogic } from 'scenes/sceneLogic'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import type { PhaiViewMode } from '~/layout/ai/aiPanelIds'
import { aiShellLogic } from '~/layout/ai/aiShellLogic'
import { sidePanelStateLogic } from '~/layout/navigation-3000/sidepanel/sidePanelStateLogic'
@@ -130,6 +129,9 @@ export interface maxGlobalLogicActions {
requestAiAccess: () => {
value: true
} // aiConsentLogic
+ askSidePanelMax: (prompt: string) => {
+ prompt: string
+ } // aiShellLogic
deregisterTool: (key: string) => {
key: string
} // aiShellLogic
@@ -167,9 +169,6 @@ export interface maxGlobalLogicActions {
options: string | undefined
tab: SidePanelTab
} // sidePanelStateLogic
- askSidePanelMax: (prompt: string) => {
- prompt: string
- }
deleteConversation: (id: string) => {
id: string
}
@@ -288,13 +287,12 @@ export const maxGlobalLogic = kea<maxGlobalLogicType>([
aiConsentLogic,
['acceptDataProcessing', 'dismissDataProcessing', 'requestAiAccess'],
aiShellLogic,
- ['setPhaiViewMode', 'registerTool', 'deregisterTool'],
+ ['setPhaiViewMode', 'askSidePanelMax', 'registerTool', 'deregisterTool'],
],
})),
actions({
openSidePanelMax: (conversationId?: string) => ({ conversationId }),
openSidePanelMaxWithTaskBind: (taskId: string) => ({ taskId }),
- askSidePanelMax: (prompt: string) => ({ prompt }),
prependOrReplaceConversation: (conversation: ConversationDetail | Conversation) => ({ conversation }),
deleteConversation: (id: string) => ({ id }),
dismissLiabilityNotice: true,
@@ -361,9 +359,6 @@ export const maxGlobalLogic = kea<maxGlobalLogicType>([
[taskEventsLogic.actionTypes.taskDeleted]: () => {
actions.loadConversationHistory()
},
- askSidePanelMax: ({ prompt }) => {
- newInternalTab(urls.ai(undefined, prompt))
- },
openSidePanelMax: ({ conversationId }) => {
if (!values.sidePanelOpen || values.selectedTab !== SidePanelTab.Max) {
actions.openSidePanel(SidePanelTab.Max)
diff --git a/frontend/src/scenes/notebooks/Notebook/MarkdownNotebookV2Renderer.tsx b/frontend/src/scenes/notebooks/Notebook/MarkdownNotebookV2Renderer.tsx
index 77226d397505..45ae7c845709 100644
--- a/frontend/src/scenes/notebooks/Notebook/MarkdownNotebookV2Renderer.tsx
+++ b/frontend/src/scenes/notebooks/Notebook/MarkdownNotebookV2Renderer.tsx
@@ -30,9 +30,9 @@ import { getInlineText } from 'lib/components/MarkdownNotebook/utils'
import { uploadFile } from 'lib/hooks/useUploadFiles'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { uuid } from 'lib/utils/dom'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { userLogic } from 'scenes/userLogic'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import type { NotebookArtifactContent } from '~/queries/schema/schema-assistant-messages'
import { NotebookBtwLayout } from 'products/notebooks/frontend/NotebookBtwLayout'
diff --git a/frontend/src/scenes/project-homepage/ai-first/HomepageInput.tsx b/frontend/src/scenes/project-homepage/ai-first/HomepageInput.tsx
index e36839fb46c6..6ef2feb31bd0 100644
--- a/frontend/src/scenes/project-homepage/ai-first/HomepageInput.tsx
+++ b/frontend/src/scenes/project-homepage/ai-first/HomepageInput.tsx
@@ -23,9 +23,9 @@ import { MaxThreadLogicProps, maxThreadLogic } from 'scenes/max/maxThreadLogic'
import { HOMEPAGE_SUGGESTION_TOPICS } from 'scenes/max/suggestionTopics'
import { AIAccessRequest } from 'scenes/settings/organization/AIAccessRequest'
import { openAIConsentLegalDialog } from 'scenes/settings/organization/aiConsentCopy'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { userLogic } from 'scenes/userLogic'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { ProductIconWrapper, iconForType } from '~/layout/panel-layout/ProjectTree/defaultTree'
import { FileSystemIconType } from '~/queries/schema/schema-general'
diff --git a/frontend/src/scenes/session-recordings/components/InternalSurvey/InternalMultipleChoiceSurvey.tsx b/frontend/src/scenes/session-recordings/components/InternalSurvey/InternalMultipleChoiceSurvey.tsx
index f5c55f8c6799..b6bb700bae79 100644
--- a/frontend/src/scenes/session-recordings/components/InternalSurvey/InternalMultipleChoiceSurvey.tsx
+++ b/frontend/src/scenes/session-recordings/components/InternalSurvey/InternalMultipleChoiceSurvey.tsx
@@ -7,8 +7,8 @@ import { LemonButton, LemonCheckbox, LemonTextArea, Link } from '@posthog/lemon-
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import { maxGlobalLogic } from 'scenes/max/maxGlobalLogic'
+import { aiShellLogic } from '~/layout/ai/aiShellLogic'
import { todayShellLogic } from '~/layout/today/todayShellLogic'
import { SurveyQuestion, SurveyQuestionType } from '~/types'
@@ -169,7 +169,7 @@ export function InternalMultipleChoiceSurvey({ surveyId }: InternalSurveyProps):
const { survey, surveyResponse, showThankYouMessage, thankYouMessage, openChoice } = useValues(logic)
const { handleChoiceChange, handleSurveyResponse, setOpenChoice } = useActions(logic)
- const { askSidePanelMax } = useActions(maxGlobalLogic)
+ const { askSidePanelMax } = useActions(aiShellLogic)
const { todayRailEnabled } = useValues(todayShellLogic)
const { featureFlags } = useValues(featureFlagLogic)
diff --git a/frontend/src/scenes/session-recordings/player/watch/WatchPanel.tsx b/frontend/src/scenes/session-recordings/player/watch/WatchPanel.tsx
index 72e2630365b1..3589f6e6f79a 100644
--- a/frontend/src/scenes/session-recordings/player/watch/WatchPanel.tsx
+++ b/frontend/src/scenes/session-recordings/player/watch/WatchPanel.tsx
@@ -1,7 +1,8 @@
import { useValues } from 'kea'
import { playerSettingsLogic } from 'scenes/session-recordings/player/playerSettingsLogic'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
+
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { SummarizeRecordingBar } from 'products/replay_vision/frontend/components/SummarizeRecordingBar'
import { visionSurfaceShown } from 'products/replay_vision/frontend/utils/visionSurface'
diff --git a/frontend/src/scenes/session-recordings/sessionReplaySceneLogic.ts b/frontend/src/scenes/session-recordings/sessionReplaySceneLogic.ts
index 85153455f1ea..e14dd115ca26 100644
--- a/frontend/src/scenes/session-recordings/sessionReplaySceneLogic.ts
+++ b/frontend/src/scenes/session-recordings/sessionReplaySceneLogic.ts
@@ -9,9 +9,9 @@ import {
SessionRecordingPlaylistLogicProps,
sessionRecordingsPlaylistLogic,
} from 'scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { urls } from 'scenes/urls'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { SIDE_PANEL_CONTEXT_KEY, SidePanelSceneContext } from '~/layout/navigation-3000/sidepanel/types'
import { ActivityScope, Breadcrumb, ReplayTabs } from '~/types'
diff --git a/frontend/src/scenes/settings/organization/AIAccessRequest.tsx b/frontend/src/scenes/settings/organization/AIAccessRequest.tsx
index 85b35de21849..efbc0a23aee6 100644
--- a/frontend/src/scenes/settings/organization/AIAccessRequest.tsx
+++ b/frontend/src/scenes/settings/organization/AIAccessRequest.tsx
@@ -3,7 +3,7 @@ import { useActions, useValues } from 'kea'
import { IconArrowRight, IconCheck } from '@posthog/icons'
import { LemonButton } from '@posthog/lemon-ui'
-import { aiConsentLogic } from './aiConsentLogic'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
/**
* The path forward for a member who cannot approve AI data processing themselves: ask an
diff --git a/frontend/src/scenes/settings/organization/AIConsentPopoverWrapper.tsx b/frontend/src/scenes/settings/organization/AIConsentPopoverWrapper.tsx
index 7fae83f4bc7c..b99c2dc75ca4 100644
--- a/frontend/src/scenes/settings/organization/AIConsentPopoverWrapper.tsx
+++ b/frontend/src/scenes/settings/organization/AIConsentPopoverWrapper.tsx
@@ -6,9 +6,10 @@ import { LemonButton, Popover, PopoverProps, Tooltip } from '@posthog/lemon-ui'
import { organizationLogic } from 'scenes/organizationLogic'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
+
import { AIAccessRequest } from './AIAccessRequest'
import { getExternalAIProvidersTooltipTitle, openAIConsentLegalDialog } from './aiConsentCopy'
-import { aiConsentLogic } from './aiConsentLogic'
export function AIConsentPopoverContent({
onApprove,
diff --git a/products/ai_observability/frontend/redesign/trace/adapter/traceViewAdapterLogic.ts b/products/ai_observability/frontend/redesign/trace/adapter/traceViewAdapterLogic.ts
index 49cfd9b48b64..81195fa3a841 100644
--- a/products/ai_observability/frontend/redesign/trace/adapter/traceViewAdapterLogic.ts
+++ b/products/ai_observability/frontend/redesign/trace/adapter/traceViewAdapterLogic.ts
@@ -6,10 +6,11 @@ import posthog from 'posthog-js'
import { FEATURE_FLAGS } from 'lib/constants'
import { FeatureFlagsSet, featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { tryDecodeURIComponent } from 'lib/utils/url'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
+
import { aiObservabilityTraceLogic } from '../../../aiObservabilityTraceLogic'
import type { SaveToDatasetButtonProps } from '../../../datasets/SaveToDatasetButton'
import type {
diff --git a/products/ai_observability/frontend/redesign/trace/traceSummaryLogic.ts b/products/ai_observability/frontend/redesign/trace/traceSummaryLogic.ts
index 2af80649b0fb..19e69122f822 100644
--- a/products/ai_observability/frontend/redesign/trace/traceSummaryLogic.ts
+++ b/products/ai_observability/frontend/redesign/trace/traceSummaryLogic.ts
@@ -4,8 +4,8 @@ import posthog from 'posthog-js'
import { ApiConfig, ApiError } from 'lib/api'
import { userHasAccess } from 'lib/utils/accessControlUtils'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { AccessControlLevel, AccessControlResourceType } from '~/types'
import { aiObservabilityTracesSummaryCreate, aiObservabilityTracesSummaryRetrieve } from '../../generated/api'
diff --git a/products/data_catalog/frontend/components/RunMetricWithAIButton.tsx b/products/data_catalog/frontend/components/RunMetricWithAIButton.tsx
index 82fb2a22b695..206576016c15 100644
--- a/products/data_catalog/frontend/components/RunMetricWithAIButton.tsx
+++ b/products/data_catalog/frontend/components/RunMetricWithAIButton.tsx
@@ -3,9 +3,10 @@ import { useValues } from 'kea'
import { IconSparkles } from '@posthog/icons'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { AIConsentPopoverWrapper } from 'scenes/settings/organization/AIConsentPopoverWrapper'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
+
/**
* Point the agent at the catalog rather than pasting the definition into the prompt. The definition
* is project data an agent must treat as untrusted, and attached context only reaches the sandbox
diff --git a/products/data_catalog/frontend/components/runMetricWithAI.test.tsx b/products/data_catalog/frontend/components/runMetricWithAI.test.tsx
index d86275fb864a..cb03443bffca 100644
--- a/products/data_catalog/frontend/components/runMetricWithAI.test.tsx
+++ b/products/data_catalog/frontend/components/runMetricWithAI.test.tsx
@@ -2,13 +2,12 @@ import '@testing-library/jest-dom'
import { cleanup, fireEvent, render, screen } from '@testing-library/react'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
-
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { initKeaTests } from '~/test/init'
import { buildMetricRunPrompt, RunMetricWithAIButton } from './RunMetricWithAIButton'
-jest.mock('scenes/settings/organization/aiConsentLogic', () => {
+jest.mock('~/layout/ai/aiConsentLogic', () => {
const { kea, selectors } = jest.requireActual('kea')
return {
aiConsentLogic: kea([
diff --git a/products/data_warehouse/frontend/sql_editor/aiChartRecommendationLogic.ts b/products/data_warehouse/frontend/sql_editor/aiChartRecommendationLogic.ts
index fd143d06b09e..a2f3a6517238 100644
--- a/products/data_warehouse/frontend/sql_editor/aiChartRecommendationLogic.ts
+++ b/products/data_warehouse/frontend/sql_editor/aiChartRecommendationLogic.ts
@@ -18,9 +18,9 @@ import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { preflightLogic } from 'lib/logic/preflightLogic'
import { withTimeout } from 'lib/utils/async'
import { OutputTab, outputPaneLogic } from 'scenes/data-warehouse/editor/outputPaneLogic'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { teamLogic } from 'scenes/teamLogic'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { dataNodeLogic } from '~/queries/nodes/DataNode/dataNodeLogic'
import {
DataVisualizationLogicProps,
diff --git a/products/metrics/frontend/dashboardImport/MetricsDashboardImportModal.tsx b/products/metrics/frontend/dashboardImport/MetricsDashboardImportModal.tsx
index 4e73038d84ba..7fca836a4c90 100644
--- a/products/metrics/frontend/dashboardImport/MetricsDashboardImportModal.tsx
+++ b/products/metrics/frontend/dashboardImport/MetricsDashboardImportModal.tsx
@@ -2,9 +2,10 @@ import { useActions, useValues } from 'kea'
import { LemonButton, LemonModal } from '@posthog/lemon-ui'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { AIConsentPopoverWrapper } from 'scenes/settings/organization/AIConsentPopoverWrapper'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
+
import type { DashboardImportSourceEnumApi } from 'products/metrics/frontend/generated/api.schemas'
import { metricsDashboardImportLogic } from './metricsDashboardImportLogic'
diff --git a/products/posthog_ai/frontend/logics/aiOnboardingLogic.ts b/products/posthog_ai/frontend/logics/aiOnboardingLogic.ts
index 04fa2d8ba905..8d89c79e6123 100644
--- a/products/posthog_ai/frontend/logics/aiOnboardingLogic.ts
+++ b/products/posthog_ai/frontend/logics/aiOnboardingLogic.ts
@@ -2,10 +2,10 @@ import { MakeLogicType, actions, connect, kea, key, listeners, path, props, redu
import posthog from 'posthog-js'
import { integrationsLogic } from 'lib/integrations/integrationsLogic'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { teamLogic } from 'scenes/teamLogic'
import { userLogic } from 'scenes/userLogic'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { ProductKey } from '~/queries/schema/schema-general'
import type { IntegrationType, TeamPublicType, TeamType, UserType } from '~/types'
diff --git a/products/posthog_ai/frontend/logics/runInteractionLogic.test.ts b/products/posthog_ai/frontend/logics/runInteractionLogic.test.ts
index 195b5ea0b125..7af438f45173 100644
--- a/products/posthog_ai/frontend/logics/runInteractionLogic.test.ts
+++ b/products/posthog_ai/frontend/logics/runInteractionLogic.test.ts
@@ -4,8 +4,8 @@ import posthog from 'posthog-js'
import { ApiError } from 'lib/api-error'
import { lemonToast } from 'lib/lemon-ui/LemonToast'
import { projectLogic } from 'scenes/projectLogic'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { attachedContextLogic } from '~/layout/ai/attachedContextLogic'
import { initKeaTests } from '~/test/init'
diff --git a/products/posthog_ai/frontend/logics/runInteractionLogic.ts b/products/posthog_ai/frontend/logics/runInteractionLogic.ts
index 4bed53d70837..8a5c4ab5c84b 100644
--- a/products/posthog_ai/frontend/logics/runInteractionLogic.ts
+++ b/products/posthog_ai/frontend/logics/runInteractionLogic.ts
@@ -19,8 +19,8 @@ import posthog from 'posthog-js'
import { ApiError, readableErrorMessage } from 'lib/api-error'
import { lemonToast } from 'lib/lemon-ui/LemonToast'
import { projectLogic } from 'scenes/projectLogic'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { type AttachedContextItem, attachedContextItemKey } from '~/layout/ai/attachedContext'
import { attachedContextLogic } from '~/layout/ai/attachedContextLogic'
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.test.ts b/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.test.ts
index bdc49cb78205..c773faa33599 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.test.ts
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.test.ts
@@ -6,9 +6,9 @@ import { FEATURE_FLAGS } from 'lib/constants'
import { lemonToast } from 'lib/lemon-ui/LemonToast'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { phaiAiComposerSeedLogic } from 'scenes/max/phaiAiComposerSeedLogic'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { urls } from 'scenes/urls'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { attachedContextLogic } from '~/layout/ai/attachedContextLogic'
import { todaySpacesLogic } from '~/layout/today/todaySpacesLogic'
import { useMocks } from '~/mocks/jest'
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts b/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts
index e94b873e637f..47ac4b7730ab 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts
@@ -12,9 +12,9 @@ import { type FeatureFlagsSet, featureFlagLogic } from 'lib/logic/featureFlagLog
import { uuid } from 'lib/utils/dom'
import { removeProjectIdIfPresent } from 'lib/utils/kea-router'
import { projectLogic } from 'scenes/projectLogic'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { urls } from 'scenes/urls'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { attachedContextItemKey } from '~/layout/ai/attachedContext'
import type { AttachedContextItem } from '~/layout/ai/attachedContext'
import { attachedContextLogic } from '~/layout/ai/attachedContextLogic'
diff --git a/products/replay_vision/frontend/components/SummarizeButton.tsx b/products/replay_vision/frontend/components/SummarizeButton.tsx
index 4d3f39448609..51284c111717 100644
--- a/products/replay_vision/frontend/components/SummarizeButton.tsx
+++ b/products/replay_vision/frontend/components/SummarizeButton.tsx
@@ -6,9 +6,10 @@ import { IconChevronDown, IconLogomark, IconNotebook } from '@posthog/icons'
import { LemonButton } from '@posthog/lemon-ui'
import { LemonMenuItem, LemonMenuOverlay } from 'lib/lemon-ui/LemonMenu/LemonMenu'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { AIConsentPopoverWrapper } from 'scenes/settings/organization/AIConsentPopoverWrapper'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
+
import type { ReplayScannerApi } from '../generated/api.schemas'
import { observationsDockLogic } from '../logics/observationsDockLogic'
import { visionQuotaLogic } from '../logics/visionQuotaLogic'
diff --git a/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx b/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx
index be9c7539468c..7f7b47381cbe 100644
--- a/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx
+++ b/products/replay_vision/frontend/replay_scanners/ScannerEditorScene.tsx
@@ -30,10 +30,10 @@ import { LemonField } from 'lib/lemon-ui/LemonField'
import { useAttachedLogic } from 'lib/logic/scenes/useAttachedLogic'
import { pluralize } from 'lib/utils/strings'
import { SceneExport } from 'scenes/sceneTypes'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { AIConsentPopoverWrapper } from 'scenes/settings/organization/AIConsentPopoverWrapper'
import { urls } from 'scenes/urls'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { SceneContent } from '~/layout/scenes/components/SceneContent'
import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'
import { tagsModel } from '~/models/tagsModel'
diff --git a/products/replay_vision/frontend/replay_scanners/components/CreateScannerButton.tsx b/products/replay_vision/frontend/replay_scanners/components/CreateScannerButton.tsx
index 5f4f494631c0..7e8abee1db61 100644
--- a/products/replay_vision/frontend/replay_scanners/components/CreateScannerButton.tsx
+++ b/products/replay_vision/frontend/replay_scanners/components/CreateScannerButton.tsx
@@ -5,10 +5,11 @@ import { useState } from 'react'
import { IconPlus } from '@posthog/icons'
import { LemonButton } from '@posthog/lemon-ui'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { AIConsentPopoverWrapper } from 'scenes/settings/organization/AIConsentPopoverWrapper'
import { urls } from 'scenes/urls'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
+
import { getReplayVisionEditDisabledReason } from '../../utils/accessControl'
/**
diff --git a/products/replay_vision/frontend/replay_scanners/components/QuillCreateScannerButton.tsx b/products/replay_vision/frontend/replay_scanners/components/QuillCreateScannerButton.tsx
index 6bbcee0c4e73..ae461ba5cfa4 100644
--- a/products/replay_vision/frontend/replay_scanners/components/QuillCreateScannerButton.tsx
+++ b/products/replay_vision/frontend/replay_scanners/components/QuillCreateScannerButton.tsx
@@ -5,10 +5,11 @@ import { useState } from 'react'
import { IconPlus } from '@posthog/icons'
import { Button } from '@posthog/quill'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { AIConsentPopoverWrapper } from 'scenes/settings/organization/AIConsentPopoverWrapper'
import { urls } from 'scenes/urls'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
+
import { getReplayVisionEditDisabledReason } from '../../utils/accessControl'
export function QuillCreateScannerButton({
diff --git a/products/replay_vision/frontend/replay_scanners/components/ReplayFiltersScannerPopover.tsx b/products/replay_vision/frontend/replay_scanners/components/ReplayFiltersScannerPopover.tsx
index bd7bb1c9e033..d6b8ab7ca37a 100644
--- a/products/replay_vision/frontend/replay_scanners/components/ReplayFiltersScannerPopover.tsx
+++ b/products/replay_vision/frontend/replay_scanners/components/ReplayFiltersScannerPopover.tsx
@@ -4,10 +4,11 @@ import { IconSparkles } from '@posthog/icons'
import { LemonButton, LemonInput, LemonSegmentedButton, LemonTag, LemonTextArea } from '@posthog/lemon-ui'
import { pluralize } from 'lib/utils/strings'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { AIConsentPopoverWrapper } from 'scenes/settings/organization/AIConsentPopoverWrapper'
import { urls } from 'scenes/urls'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
+
import { getReplayVisionEditDisabledReason } from '../../utils/accessControl'
import { formatCreditCount } from '../../utils/credits'
import { type ReplayFiltersCreditCap, replayFiltersScannerLogic } from '../replayFiltersScannerLogic'
diff --git a/products/replay_vision/frontend/replay_scanners/components/ScannerGoalFlow.tsx b/products/replay_vision/frontend/replay_scanners/components/ScannerGoalFlow.tsx
index 6726fea2349d..0c2379c1e217 100644
--- a/products/replay_vision/frontend/replay_scanners/components/ScannerGoalFlow.tsx
+++ b/products/replay_vision/frontend/replay_scanners/components/ScannerGoalFlow.tsx
@@ -5,9 +5,10 @@ import { IconPlus, IconSparkles } from '@posthog/icons'
import { LemonButton, LemonInput, LemonSegmentedButton, LemonTextArea, Link } from '@posthog/lemon-ui'
import { PopoverReferenceContext } from 'lib/lemon-ui/Popover/Popover'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { AIConsentPopoverWrapper } from 'scenes/settings/organization/AIConsentPopoverWrapper'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
+
import type { ExperimentBasicApi } from 'products/experiments/frontend/generated/api.schemas'
import { visionQuotaLogic } from '../../logics/visionQuotaLogic'
diff --git a/products/replay_vision/frontend/replay_scanners/replayFiltersScannerLogic.ts b/products/replay_vision/frontend/replay_scanners/replayFiltersScannerLogic.ts
index b304582430ac..f27229fb529c 100644
--- a/products/replay_vision/frontend/replay_scanners/replayFiltersScannerLogic.ts
+++ b/products/replay_vision/frontend/replay_scanners/replayFiltersScannerLogic.ts
@@ -3,9 +3,9 @@ import { combineUrl, router } from 'kea-router'
import posthog from 'posthog-js'
import { addProductIntentForCrossSell } from 'lib/utils/product-intents'
-import { AI_CONSENT_PENDING_REDIRECT_TTL_MS } from 'scenes/settings/organization/aiConsentLogic'
import { urls } from 'scenes/urls'
+import { AI_CONSENT_PENDING_REDIRECT_TTL_MS } from '~/layout/ai/aiConsentLogic'
import { ProductIntentContext, ProductKey } from '~/queries/schema/schema-general'
import { visionQuotaLogic } from '../logics/visionQuotaLogic'
diff --git a/products/replay_vision/frontend/search/ObservationSearch.tsx b/products/replay_vision/frontend/search/ObservationSearch.tsx
index 905977abd3f0..efaff71e28ea 100644
--- a/products/replay_vision/frontend/search/ObservationSearch.tsx
+++ b/products/replay_vision/frontend/search/ObservationSearch.tsx
@@ -9,11 +9,12 @@ import { LemonButton, LemonInput, LemonMenu, Popover, Spinner } from '@posthog/l
import { pngHoggie } from 'lib/brand/hoggies'
import { DateFilter } from 'lib/components/DateFilter/DateFilter'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
+
import { visionScannersListLogic } from '../logics/visionScannersListLogic'
import { type ReplayScanner, scannerFromApi } from '../replay_scanners/types'
import { type ObservationSearchLogicProps, observationSearchLogic } from './observationSearchLogic'
diff --git a/products/signals/frontend/inbox/inboxTaskKickoffLogic.ts b/products/signals/frontend/inbox/inboxTaskKickoffLogic.ts
index 49eb986a8655..0a3737dd74cd 100644
--- a/products/signals/frontend/inbox/inboxTaskKickoffLogic.ts
+++ b/products/signals/frontend/inbox/inboxTaskKickoffLogic.ts
@@ -10,9 +10,9 @@ import type { FeatureFlagsSet } from 'lib/logic/featureFlagLogic'
import { uuid } from 'lib/utils/dom'
import { addProjectIdIfMissing } from 'lib/utils/kea-router'
import { projectLogic } from 'scenes/projectLogic'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { urls } from 'scenes/urls'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { REPORT_AI_PANEL } from '~/layout/ai/aiPanelIds'
import { attachedContextItemKey } from '~/layout/ai/attachedContext'
import type { AttachedContextItem } from '~/layout/ai/attachedContext'
diff --git a/products/signals/frontend/inbox/logics/scoutAiLogic.ts b/products/signals/frontend/inbox/logics/scoutAiLogic.ts
index a230aeaf999f..4f7f094f4646 100644
--- a/products/signals/frontend/inbox/logics/scoutAiLogic.ts
+++ b/products/signals/frontend/inbox/logics/scoutAiLogic.ts
@@ -2,8 +2,7 @@ import { MakeLogicType, actions, beforeUnmount, connect, kea, listeners, path, r
import { lemonToast } from '@posthog/lemon-ui'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
-
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
import { SCOUT_AI_PANEL } from '~/layout/ai/aiPanelIds'
import type { AttachedContextItem } from '~/layout/ai/attachedContext'
import { runnerPanelLogic } from '~/layout/ai/runnerPanelLogic'
diff --git a/products/signals/frontend/inbox/logics/scoutFleetLogic.ts b/products/signals/frontend/inbox/logics/scoutFleetLogic.ts
index 45a39cb9aecf..2eaa2785a6cc 100644
--- a/products/signals/frontend/inbox/logics/scoutFleetLogic.ts
+++ b/products/signals/frontend/inbox/logics/scoutFleetLogic.ts
@@ -21,11 +21,12 @@ import { FIRST_REPORT_SCOUT_NAME } from 'lib/constants'
import { dayjs } from 'lib/dayjs'
import { chunk } from 'lib/utils/arrays'
import { reconcileById } from 'lib/utils/objects'
-import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
+import { aiConsentLogic } from '~/layout/ai/aiConsentLogic'
+
import {
signalsScoutChatTasksCreate,
signalsScoutConfigDestroy,