: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore: remove dead AI_ONLY_MODE feature-flag code (#58120)
Paul D'Ambrac8ae3523258c
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex e7c28b0364fc..7cb2d57e9b4a 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -228,7 +228,6 @@ export const FEATURE_FLAGS = {ACTION_REFERENCE_COUNT: 'action-reference-count', // owner: @andyzzhao #team-product-analytics, gates bulk action reference counting on actions listADVANCE_MARKETING_ANALYTICS_SETTINGS: 'advance-marketing-analytics-settings', // owner: @jabahamondes #team-web-analyticsAI_EVENTS_TABLE_ROLLOUT: 'ai-events-table-rollout', // owner: #team-llm-analytics, gates reads off the dedicated ai_events table- AI_ONLY_MODE: 'ai-only-mode', // owner: #team-posthog-aiALERTS_ANOMALY_DETECTION: 'alerts-anomaly-detection', // owner: @andrewm4894/** Alert edit modal: check history chart + chart/table toggle (table remains when off). */ALERTS_HISTORY_CHART: 'alerts-history-chart', // owner: #team-analytics-platform@@ -511,9 +510,7 @@ export const FEATURE_FLAGS = {export type FeatureFlagLookupKey = keyof typeof FEATURE_FLAGSexport type FeatureFlagKey = (typeof FEATURE_FLAGS)[keyof typeof FEATURE_FLAGS]-export const STORYBOOK_FEATURE_FLAGS = Object.values(FEATURE_FLAGS).filter(- (flag) => flag !== FEATURE_FLAGS.AI_ONLY_MODE-)+export const STORYBOOK_FEATURE_FLAGS = Object.values(FEATURE_FLAGS)export const INSIGHT_VISUAL_ORDER = {trends: 10,diff --git a/frontend/src/scenes/App.tsx b/frontend/src/scenes/App.tsxindex 1cc3746d2e8a..1874e9985b55 100644--- a/frontend/src/scenes/App.tsx+++ b/frontend/src/scenes/App.tsx@@ -27,8 +27,6 @@ import { themeLogic } from '~/layout/navigation-3000/themeLogic'import { breadcrumbsLogic } from '~/layout/navigation/Breadcrumbs/breadcrumbsLogic'import { ImpersonationNotice } from '~/layout/navigation/ImpersonationNotice'-import { MaxInstance } from './max/Max'-window.process = MOCK_NODE_PROCESS/**@@ -87,7 +85,7 @@ function AppScene(): JSX.Element | null {activeSceneLogicPropsWithTabId,sceneConfig,} = useValues(sceneLogic)- const { showingDelayedSpinner, hasExitedAIOnlyMode } = useValues(appLogic)+ const { showingDelayedSpinner } = useValues(appLogic)const { featureFlags } = useValues(featureFlagLogic)const { isDarkModeOn } = useValues(themeLogic)@@ -105,23 +103,6 @@ function AppScene(): JSX.Element | null {/>)- if (featureFlags[FEATURE_FLAGS.AI_ONLY_MODE] && !hasExitedAIOnlyMode) {- return (- <>- <div- className="fixed inset-0 bg-surface-secondary flex flex-col overflow-auto"- ref={() => {- // HACK: Normally DebugNotice removes the HTML-level debug bar, but in this case we don't have the nav rendering DebugNotice- document.getElementById('bottom-notice')?.remove()- }}- >- <MaxInstance tabId="ai-only-mode" sidePanel isAIOnlyMode />- </div>- {toastContainer}- </>- )- }-let sceneElement: JSX.Elementif (activeExportedScene?.component) {const { component: SceneComponent } = activeExportedScenediff --git a/frontend/src/scenes/appLogic.tsx b/frontend/src/scenes/appLogic.tsxindex a4ec3aa69dd8..687b38ecb10f 100644--- a/frontend/src/scenes/appLogic.tsx+++ b/frontend/src/scenes/appLogic.tsx@@ -14,7 +14,6 @@ export const appLogic = kea<appLogicType>([connect([teamLogic, organizationLogic, preflightLogic]),actions({- exitAIOnlyMode: true,enableDelayedSpinner: true,ignoreFeatureFlags: true,showDevTools: true,@@ -23,7 +22,6 @@ export const appLogic = kea<appLogicType>([showingDelayedSpinner: [false, { enableDelayedSpinner: () => true }],featureFlagsTimedOut: [false, { ignoreFeatureFlags: () => true }],showingDevTools: [false, { showDevTools: () => true }],- hasExitedAIOnlyMode: [false, { exitAIOnlyMode: () => true }],}),selectors({showApp: [diff --git a/frontend/src/scenes/max/Max.tsx b/frontend/src/scenes/max/Max.tsxindex bebcdcd96696..e26ce60013bf 100644--- a/frontend/src/scenes/max/Max.tsx+++ b/frontend/src/scenes/max/Max.tsx@@ -16,7 +16,6 @@ import { LemonButton } from 'lib/lemon-ui/LemonButton'import { ButtonPrimitive } from 'lib/ui/Button/ButtonPrimitives'import { copyToClipboard } from 'lib/utils/copyToClipboard'import { cn } from 'lib/utils/css-classes'-import { appLogic } from 'scenes/appLogic'import { maxGlobalLogic } from 'scenes/max/maxGlobalLogic'import { sceneLogic } from 'scenes/sceneLogic'import { SceneExport } from 'scenes/sceneTypes'@@ -78,14 +77,9 @@ export function Max({ tabId }: { tabId?: string }): JSX.Element {export interface MaxInstanceProps {sidePanel?: booleantabId: string- isAIOnlyMode?: boolean}-export const MaxInstance = React.memo(function MaxInstance({- sidePanel,- tabId,- isAIOnlyMode,-}: MaxInstanceProps): JSX.Element {+export const MaxInstance = React.memo(function MaxInstance({ sidePanel, tabId }: MaxInstanceProps): JSX.Element {const {threadVisible,conversationHistoryVisible,@@ -98,7 +92,6 @@ export const MaxInstance = React.memo(function MaxInstance({const { startNewConversation, goBack } = useActions(maxLogic({ tabId }))const { openSidePanelMax } = useActions(maxGlobalLogic)const { closeTabId } = useActions(sceneLogic)- const { exitAIOnlyMode } = useActions(appLogic)const threadProps: MaxThreadLogicProps = {tabId,@@ -156,14 +149,7 @@ export const MaxInstance = React.memo(function MaxInstance({</BindLogic>)const header = (- <SidePanelPaneHeader- className="transition-all duration-200"- onClose={() => {- exitAIOnlyMode()- startNewConversation()- }}- showCloseButton={false}- >+ <SidePanelPaneHeader className="transition-all duration-200" showCloseButton={false}><div className="flex flex-1 min-w-0 overflow-hidden"><div className="flex items-center flex-1 min-w-0"><AnimatedBackButton in={!backButtonDisabled}>@@ -182,7 +168,7 @@ export const MaxInstance = React.memo(function MaxInstance({<h3 className="flex-1 font-semibold mb-0 truncate text-sm ml-2">{chatTitle || 'PostHog AI'}</h3></Tooltip></div>- {conversationId && !conversationHistoryVisible && !threadVisible && !isAIOnlyMode && (+ {conversationId && !conversationHistoryVisible && !threadVisible && (<LemonButtonsize="small"icon={<IconPlus />}diff --git a/posthog/management/commands/sync_feature_flags.py b/posthog/management/commands/sync_feature_flags.pyindex ebbab97765b6..a803f0ba4837 100644--- a/posthog/management/commands/sync_feature_flags.py+++ b/posthog/management/commands/sync_feature_flags.py@@ -25,7 +25,6 @@ INACTIVE_FLAGS = ["webhooks-denylist","insight-horizontal-controls","flagged-feature-indicator",- "ai-only-mode",]