: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(conversations): remove product-support-ai-notes flag (#128156)
Alex V2d347a43f73d
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex 5ea689da1277..e788c627b4e0 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -483,7 +483,6 @@ export const FEATURE_FLAGS = {PRODUCT_ANALYTICS_RETENTION_AGGREGATION: 'retention-aggregation', // owner: @anirudhpillai #team-product-analyticsPRODUCT_AUTONOMY: 'product-autonomy', // owner: #team-self-drivingPRODUCT_BUSINESS_KNOWLEDGE: 'product-business-knowledge', // owner: @veryayskiy #team-conversations- PRODUCT_SUPPORT_AI_NOTES: 'product-support-ai-notes', // owner: @veryayskiy #team-conversations, shows AI private notes in the ticket threadPRODUCT_SUPPORT_AI_SUGGESTION: 'product-support-ai-suggestion', // owner: @veryayskiy #team-conversationsPRODUCT_SUPPORT_GITHUB_CHANNEL: 'product-support-github-channel', // owner: @veryayskiy #team-conversationsPRODUCT_SUPPORT_IMPORT_TICKETS: 'product-support-import-tickets', // owner: @veryayskiy #team-conversationsdiff --git a/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.test.ts b/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.test.tsindex b277e1c5f6a3..c667f47e3dfa 100644--- a/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.test.ts+++ b/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.test.ts@@ -155,7 +155,6 @@ describe('supportTicketSceneLogic ai reply feedback', () => {submitAiFeedbackMock.mockClear()logic = supportTicketSceneLogic({ id: 'new' })logic.mount()- featureFlagLogic.actions.setFeatureFlags([], { [FEATURE_FLAGS.PRODUCT_SUPPORT_AI_NOTES]: true })logic.actions.setTicket(makeTicket())logic.actions.setMessages([makeAiComment('msg-ai-1')])})@@ -331,7 +330,6 @@ describe('supportTicketSceneLogic chatMessages mapping', () => {})it('maps AI citation and persist_as fields onto chat messages', () => {- featureFlagLogic.actions.setFeatureFlags([], { [FEATURE_FLAGS.PRODUCT_SUPPORT_AI_NOTES]: true })logic.actions.setMessages([{...makeAiComment('msg-ai-1'),@@ -357,7 +355,6 @@ describe('supportTicketSceneLogic chatMessages mapping', () => {})it('selects the latest applicable AI draft', () => {- featureFlagLogic.actions.setFeatureFlags([], { [FEATURE_FLAGS.PRODUCT_SUPPORT_AI_NOTES]: true })logic.actions.setMessages([{ ...makeAiComment('new-draft'), created_at: '2026-01-01T00:02:00Z' },{ ...makeAiComment('not-a-draft', false), created_at: '2026-01-01T00:01:00Z' },@@ -368,7 +365,6 @@ describe('supportTicketSceneLogic chatMessages mapping', () => {})it('shows automated private notes without treating them as AI drafts', () => {- featureFlagLogic.actions.setFeatureFlags([], { [FEATURE_FLAGS.PRODUCT_SUPPORT_AI_NOTES]: false })logic.actions.setMessages([{...makeAiComment('pr-update'),@@ -406,7 +402,6 @@ describe('supportTicketSceneLogic applyAiDraft', () => {submitAiHumanOutcomeMock.mockClear()logic = supportTicketSceneLogic({ id: 'new' })logic.mount()- featureFlagLogic.actions.setFeatureFlags([], { [FEATURE_FLAGS.PRODUCT_SUPPORT_AI_NOTES]: true })logic.actions.setTicket(makeTicket())})@@ -471,15 +466,10 @@ describe('supportTicketSceneLogic AI note visibility', () => {logic.actions.setTicket(makeTicket())})- test.each<[string, boolean, boolean, string[]]>([- ['hides AI private notes without the flag', false, true, ['msg-customer']],- ['shows AI private notes with the flag', true, true, ['msg-customer', 'msg-ai']],- ['keeps sent AI replies visible without the flag', false, false, ['msg-customer', 'msg-ai']],- ])('%s', (_name, flagEnabled, isPrivate, expectedIds) => {- featureFlagLogic.actions.setFeatureFlags([], { [FEATURE_FLAGS.PRODUCT_SUPPORT_AI_NOTES]: flagEnabled })+ it.each([true, false])('shows AI messages when is_private is %s', (isPrivate) => {logic.actions.setMessages([makeCustomerComment('msg-customer'), makeAiComment('msg-ai', isPrivate)])- expect(logic.values.chatMessages.map((m) => m.id)).toEqual(expectedIds)+ expect(logic.values.chatMessages.map((m) => m.id)).toEqual(['msg-customer', 'msg-ai'])})})diff --git a/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts b/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.tsindex 93ce385ced3e..86218ae28f88 100644--- a/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts+++ b/products/conversations/frontend/scenes/ticket/supportTicketSceneLogic.ts@@ -280,20 +280,6 @@ export function getEmailReplyBlockedReason(return null}-/**- * An AI draft the pipeline saved as an internal note, i.e. one the customer never received.- * Gated behind PRODUCT_SUPPORT_AI_NOTES because agents who don't want the drafts read them as- * noise. A published AI reply is not one of these: hiding what the customer already got would- * make the thread misrepresent the conversation.- */-export function isAiPrivateNote(message: Pick<CommentType, 'item_context'>): boolean {- return (- message.item_context?.author_type === 'AI' &&- message.item_context?.is_private === true &&- !message.item_context?.automated_update_key- )-}-// Generated by kea-typegen. Update if you're an agent, ignore if you're human.export interface supportTicketSceneLogicValues {resolveAssignee: (assignee: TicketAssignee) => Assignee // assigneeSelectLogic@@ -635,7 +621,7 @@ export interface supportTicketSceneLogicMeta {unsavedTicketChanges: string[]) => booleanhasPendingWork: (hasUnsavedChanges: boolean, editingMessageId: string | null) => boolean- chatMessages: (messages: CommentType[], ticket: Ticket | null, featureFlags: FeatureFlagsSet) => ChatMessage[]+ chatMessages: (messages: CommentType[], ticket: Ticket | null) => ChatMessage[]deliveryStatusByMessageId: (chatMessages: ChatMessage[],ticket: Ticket | null@@ -1231,86 +1217,81 @@ export const supportTicketSceneLogic = kea<supportTicketSceneLogicType>([},],chatMessages: [- (s) => [s.messages, s.ticket, s.featureFlags],- (messages: CommentType[], ticket: Ticket | null, featureFlags: FeatureFlagsSet): ChatMessage[] => {- const showAiNotes = !!featureFlags[FEATURE_FLAGS.PRODUCT_SUPPORT_AI_NOTES]- return messages- .filter((message) => showAiNotes || !isAiPrivateNote(message))- .map((message) => {- const authorType = message.item_context?.author_type || 'customer'- let displayName = 'Anonymous user'- if (message.created_by) {+ (s) => [s.messages, s.ticket],+ (messages: CommentType[], ticket: Ticket | null): ChatMessage[] => {+ return messages.map((message) => {+ const authorType = message.item_context?.author_type || 'customer'+ let displayName = 'Anonymous user'+ if (message.created_by) {+ displayName =+ [message.created_by.first_name, message.created_by.last_name].filter(Boolean).join(' ') ||+ message.created_by.email ||+ 'Support'+ } else if (authorType === 'AI') {+ displayName = 'PostHog Assistant'+ } else {+ // Per-message author identity (e.g. Zendesk import stores each comment's own+ // author) takes precedence over the ticket-level requester, so a reply from a+ // second requester or an agent shows the real name instead of the ticket owner.+ const messageAuthorName =+ message.item_context?.author_name ||+ message.item_context?.author_email ||+ message.item_context?.slack_author_name ||+ message.item_context?.teams_author_name ||+ message.item_context?.teams_author_email ||+ message.item_context?.github_login ||+ message.item_context?.email_from_name+ if (messageAuthorName) {+ displayName = messageAuthorName+ } else if (authorType === 'customer') {displayName =- [message.created_by.first_name, message.created_by.last_name]- .filter(Boolean)- .join(' ') ||- message.created_by.email ||- 'Support'- } else if (authorType === 'AI') {- displayName = 'PostHog Assistant'+ ticket?.person?.properties?.name ||+ ticket?.person?.properties?.email ||+ ticket?.anonymous_traits?.name ||+ ticket?.anonymous_traits?.email ||+ 'Anonymous user'} else {- // Per-message author identity (e.g. Zendesk import stores each comment's own- // author) takes precedence over the ticket-level requester, so a reply from a- // second requester or an agent shows the real name instead of the ticket owner.- const messageAuthorName =- message.item_context?.author_name ||- message.item_context?.author_email ||- message.item_context?.slack_author_name ||- message.item_context?.teams_author_name ||- message.item_context?.teams_author_email ||- message.item_context?.github_login ||- message.item_context?.email_from_name- if (messageAuthorName) {- displayName = messageAuthorName- } else if (authorType === 'customer') {- displayName =- ticket?.person?.properties?.name ||- ticket?.person?.properties?.email ||- ticket?.anonymous_traits?.name ||- ticket?.anonymous_traits?.email ||- 'Anonymous user'- } else {- // Staff message with no resolvable author (e.g. deleted ex-agent).- displayName = 'Support'- }+ // Staff message with no resolvable author (e.g. deleted ex-agent).+ displayName = 'Support'}+ }- return {- id: message.id,- content: message.content || '',- richContent: message.rich_content,- authorType: authorType === 'support' || authorType === 'workflow' ? 'human' : authorType,- authorName: displayName,- createdBy: message.created_by,- createdAt: message.created_at,- isPrivate: message.item_context?.is_private || false,- automatedUpdate: !!message.item_context?.automated_update_key,- version: message.version,- emailDeliveryStatus: message.item_context?.email_delivery_status,- fromZendesk: message.item_context?.from_zendesk === true,- hasFullEmailContent: message.item_context?.has_full_email_content === true,- citations: Array.isArray(message.item_context?.citations)- ? message.item_context.citations.filter(- (item: unknown): item is string => typeof item === 'string' && !!item- )+ return {+ id: message.id,+ content: message.content || '',+ richContent: message.rich_content,+ authorType: authorType === 'support' || authorType === 'workflow' ? 'human' : authorType,+ authorName: displayName,+ createdBy: message.created_by,+ createdAt: message.created_at,+ isPrivate: message.item_context?.is_private || false,+ automatedUpdate: !!message.item_context?.automated_update_key,+ version: message.version,+ emailDeliveryStatus: message.item_context?.email_delivery_status,+ fromZendesk: message.item_context?.from_zendesk === true,+ hasFullEmailContent: message.item_context?.has_full_email_content === true,+ citations: Array.isArray(message.item_context?.citations)+ ? message.item_context.citations.filter(+ (item: unknown): item is string => typeof item === 'string' && !!item+ )+ : undefined,+ confidence:+ typeof message.item_context?.confidence === 'number'+ ? message.item_context.confidence: undefined,- confidence:- typeof message.item_context?.confidence === 'number'- ? message.item_context.confidence- : undefined,- persistAs:- message.item_context?.persist_as === 'reply' ||- message.item_context?.persist_as === 'findings' ||- message.item_context?.persist_as === 'clarification'- ? message.item_context.persist_as- : undefined,- clarifyingQuestions: Array.isArray(message.item_context?.clarifying_questions)- ? message.item_context.clarifying_questions.filter(- (item: unknown): item is string => typeof item === 'string'- )+ persistAs:+ message.item_context?.persist_as === 'reply' ||+ message.item_context?.persist_as === 'findings' ||+ message.item_context?.persist_as === 'clarification'+ ? message.item_context.persist_as: undefined,- }- })+ clarifyingQuestions: Array.isArray(message.item_context?.clarifying_questions)+ ? message.item_context.clarifying_questions.filter(+ (item: unknown): item is string => typeof item === 'string'+ )+ : undefined,+ }+ })},],deliveryStatusByMessageId: [