: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(replay): remove LLM conversation preview from inspector (#61817)
Paul D'Ambrac05e9dd6f094
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex b5485ba17155..43bd2e32df9f 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -459,7 +459,6 @@ export const FEATURE_FLAGS = {REPLAY_UI_REDESIGN_2026: 'replay-ui-redesign-2026', // owner: #team-replay, New UI layout for replayREPLAY_VIDEO_BASED_SUMMARIZATION: 'replay-video-based-summarization', // owner: #team-replayREPLAY_VISION: 'replay-vision', // owner: #team-replay- REPLAY_X_LLM_ANALYTICS_CONVERSATION_VIEW: 'replay-x-llm-analytics-conversation-view', // owner: @pauldambra #team-replayREVENUE_ANALYTICS: 'revenue-analytics', // owner: @rafaeelaudibert #team-customer-analyticsREVENUE_FIELDS_IN_POWER_USERS_TABLE: 'revenue-fields-in-power-users-table', // owner: @arthurdedeus #team-customer-analyticsSCENE_MENU_BAR: 'scene-menu-bar', // owner: @adamleithp #team-platform-ux, gates the per-scene MenuBar above SceneTitleSectiondiff --git a/frontend/src/scenes/session-recordings/player/inspector/components/AIEventItems.tsx b/frontend/src/scenes/session-recordings/player/inspector/components/AIEventItems.tsxindex e57fbcaf4dae..9b8ba90b3e42 100644--- a/frontend/src/scenes/session-recordings/player/inspector/components/AIEventItems.tsx+++ b/frontend/src/scenes/session-recordings/player/inspector/components/AIEventItems.tsx@@ -1,8 +1,5 @@-import { IconPerson } from '@posthog/icons'-import { JSONViewer } from 'lib/components/JSONViewer'-import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'-import { IconExclamation, IconRobot } from 'lib/lemon-ui/icons'+import { IconExclamation } from 'lib/lemon-ui/icons'import { isObject } from 'lib/utils'import { cn } from 'lib/utils/css-classes'@@ -73,25 +70,7 @@ export function AIEventExpanded({ event }: { event: Record<string, any> }): JSX.)}-const isHumanMessage = (message: Record<string, any>): boolean => {- return message.type === 'human' || message.role === 'user' || message.role === 'human'-}--const isAIMessage = (message: Record<string, any>): boolean => {- return (- (message.type === 'ai' || message.role === 'assistant' || message.role === 'ai') &&- !!message.content?.length &&- message.visible !== false- )-}--const isDisplayableAIMessage = (message: Record<string, any>): boolean => {- return isHumanMessage(message) || isAIMessage(message)-}-export function AIEventSummary({ event }: { event: Record<string, any> }): JSX.Element | null {- const showConversation = useFeatureFlag('REPLAY_X_LLM_ANALYTICS_CONVERSATION_VIEW')-if (event.properties.$ai_is_error) {return (<div className="flex items-center gap-1 text-danger">@@ -101,54 +80,5 @@ export function AIEventSummary({ event }: { event: Record<string, any> }): JSX.E)}- if (!showConversation) {- return null- }-- const inputMessages = (- (event.properties?.$ai_input_state?.messages as Record<string, any>[] | undefined) ??- (event.properties?.$ai_input as Record<string, any>[] | undefined) ??- []- ).filter(isDisplayableAIMessage)- const outputMessages = (- (event.properties?.$ai_output_state?.messages as Record<string, any>[] | undefined) ??- (event.properties?.$ai_output_choices as Record<string, any>[] | undefined) ??- []- ).filter(isDisplayableAIMessage)- const seen = new Set<string>()- const messageChain: Array<{ id: string; content: string; role: string }> = []-- for (const m of [...inputMessages, ...outputMessages]) {- if (typeof m.content !== 'string') {- continue- }-- const role = m.role && !m.type ? (m.role === 'user' ? 'human' : 'ai') : m.type- const key = `${role}:${m.content}`-- if (!seen.has(key)) {- seen.add(key)- messageChain.push({ id: m.id, content: m.content, role })- }- }-- return (- <div className="hidden @sm:flex flex-col items-center gap-1 text-muted-alt">- {messageChain.map((m) => (- <div- className={cn(- 'flex flex-row w-full items-center',- isHumanMessage(m) ? 'justify-end' : 'justify-start'- )}- key={m.id}- >- {isAIMessage(m) && <IconRobot className="mr-1 text-2xl" />}- <div className="max-w-2/3 border rounded px-2 py-1 text-wrap text-sm bg-surface-primary">- {m.content}- </div>- {isHumanMessage(m) && <IconPerson className="ml-1 text-2xl" />}- </div>- ))}- </div>- )+ return null}