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.

chore(signals): remove the fully rolled out scouts-suggestions-ui flag (#115092)

posthog[bot]650bb0789ff0
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index e42a2bb875e9..543ec95345fb 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -11215,9 +11215,9 @@ snapshots:
scenes-app-inbox-scene--legacy-report--light:
hash: v1.k794b7964.a19b5137a523a99023eccba1ee201951326680d039d8cd80e679664b94f5b8b0.y3_eA1e6uaDI6ZStz14t_As8tFQQF1iAD2YM6Dmn1BU
scenes-app-inbox-scene--legacy-scouts--dark:
- hash: v1.k794b7964.18ecc23ff0c745a25e9c21f374232108d3069e8cb1b16551ce68e54107ca6512.UTR5AKS8oW6TQQxe_n87wJbQwZ2FYYbfjOEB7us3-hg
+ hash: v1.k794b7964.aef8677fa43f11ff5f5b34c381208ef202da80771a5d2d17281d2a98d3361604.f8rgo5YeHpzk4rc50ylbjLdcTDBYNGJPqO--MNXk1Fw
scenes-app-inbox-scene--legacy-scouts--light:
- hash: v1.k794b7964.b4743e9e8ecfbb004e96caf2d2e2d661848bf97b67bafdd06b4d6f603f06a642.LZDkCQmq_1MES1B4SIQFL7UOyNSLkchg2MmbufH9zS4
+ hash: v1.k794b7964.9dd3dc8e6e80c8b05907082af42a22344b194f047b52fb748b67b7f801e95f5f.Z_d39bmfXBtFI0yeryorC9eA0mg0Uhgc01sSEDLa_vk
scenes-app-inbox-scene--report-with-many-evidence-items--dark:
hash: v1.k794b7964.cdf433915e692e878772c4299885f968c99c039e535ce00eedde96142225dc8a.3jz4_ynFjRQTKIFVz6-5ofn0AVAdDN3pilwzZWHmrKo
scenes-app-inbox-scene--report-with-many-evidence-items--light:
@@ -11231,9 +11231,9 @@ snapshots:
scenes-app-inbox-scene--report-without-evidence--light:
hash: v1.k794b7964.333f20aae372ab4f77e80174ad32954456822753634ddea6f33428721714916b.AWi8H5joJwmrMRc5_mNH01H_fIT-Ogxxo2zRS7IoQzs
scenes-app-inbox-scene--scouts--dark:
- hash: v1.k794b7964.6941932668172620c8904e6c2bd94d4d671a28429ad30b0b6b96733b3c28e82b.mvRVfSyZCQMoA4Tym3knNXQaQLAR5H3c9WCPqInhcfs
+ hash: v1.k794b7964.4c6c476bbe52a64bd89c81117a4a0bff8a4102920a03a8d722cff93177e5d209.DXZfqtUBd5_2Mg7tNceVoR_iiw-2yG655qhWQz2oWNc
scenes-app-inbox-scene--scouts--light:
- hash: v1.k794b7964.506124c209e920a26c81a178b4539d613d8deb6de08da550e1985e5d0943995e.T-XcU5Xr94qWbgn6UBcom2rdjykq5I7DpLtAfIWPBuE
+ hash: v1.k794b7964.751f7acf90211fb843c29021e4c5c07199a016d3758a98aebd030a2459e7e727.-dob_PqMSyNGS0sWCDRL7239l7w9pUTs5Oil7XD97cM
scenes-app-inbox-scene--self-driving-onboarding--dark:
hash: v1.k794b7964.e0a23cc49efed91ac01907f5197329613afd261d56817d389d26e42aad8602e2.Wb2-6F1bTbXLv66f02qDi8yAgRSIGhUkXu_wIeCxkFs
scenes-app-inbox-scene--self-driving-onboarding--light:
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 37f4161a6b9f..bcdcc15a7824 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -241,7 +241,6 @@ export const FEATURE_FLAGS = {
REPLAY_SETTINGS_HELP: 'replay-settings-help', // owner: @veryayskiy #team-replay
SCOUT_TRIALS: 'scout-trials', // owner: #team-self-driving, gates new trial and judging requests; saved results remain readable
SCOUTS_MODEL_CONFIG: 'scouts-model-config', // owner: #team-self-driving, gates the per-scout model pin in the inbox scout settings (also checked server-side)
- SCOUTS_SUGGESTIONS_UI: 'scouts-suggestions-ui', // owner: #team-self-driving, gates the pre-computed scout suggestions strip on the inbox scouts tab (the producer is the separate signals-scout-suggestions flag)
SELF_DRIVING_FREE_TRIAL: 'self-driving-free-trial', // owner: #team-self-driving, the org is on a Self-driving free trial: reports only, no pull requests (also checked server-side)
SELF_DRIVING_QUOTA_ENFORCEMENT: 'self-driving-quota-enforcement', // owner: #team-self-driving, gates self-driving PR-limit enforcement (also checked server-side)
SELF_OPTIMISING_WORKFLOWS: 'self-optimising-workflows', // owner: #team-workflows, gates agent-suggested workflow changes (also checked server-side)
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutCreateButton.test.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutCreateButton.test.tsx
index 63bf6ff50af4..a90e10008bde 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutCreateButton.test.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutCreateButton.test.tsx
@@ -1,7 +1,5 @@
import { cleanup, fireEvent, render, waitFor } from '@testing-library/react'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { getAccessControlDisabledReason } from 'lib/utils/accessControlUtils'
import { useMocks } from '~/mocks/jest'
@@ -78,17 +76,10 @@ describe('scout creation buttons', () => {
},
})
initKeaTests()
- featureFlagLogic.mount()
})
afterEach(cleanup)
- function setSuggestionsFlag(enabled: boolean): void {
- featureFlagLogic.actions.setFeatureFlags(enabled ? [FEATURE_FLAGS.SCOUTS_SUGGESTIONS_UI] : [], {
- [FEATURE_FLAGS.SCOUTS_SUGGESTIONS_UI]: enabled,
- })
- }
-
it('opens a prefilled form without starting a task', async () => {
const { findByText, getByText } = render(
<ScoutCreateButton initialValues={{ name: 'signals-scout-daily-digest' }} />
@@ -112,7 +103,6 @@ describe('scout creation buttons', () => {
// Closing the strip must not strand the picks: the header button reopens it in place of a chat.
it('reopens the closed strip from the header without starting a task', async () => {
- setSuggestionsFlag(true)
const logic = scoutSuggestionsLogic()
logic.mount()
await waitFor(() => expect(logic.values.hasPicks).toBe(true))
@@ -131,7 +121,6 @@ describe('scout creation buttons', () => {
// Reopening is local, so it must not wait on whatever else the header is starting. A separate
// test because the setup differs: this one needs a sibling task in flight.
it('reopens the closed strip while another header task is starting', async () => {
- setSuggestionsFlag(true)
const logic = scoutSuggestionsLogic()
logic.mount()
await waitFor(() => expect(logic.values.hasPicks).toBe(true))
@@ -156,7 +145,6 @@ describe('scout creation buttons', () => {
// A project with no picks has no strip to reopen, so the header button is the only entry point
// there. A headless scan would spend minutes with nothing on screen, so it opens the chat.
it('opens the authoring chat from the header on a project with no picks', async () => {
- setSuggestionsFlag(true)
useMocks({
get: { '/api/projects/:team/signals/scout/suggestions/': mockScoutSuggestionSet({ items: [] }) },
post: {
@@ -179,11 +167,7 @@ describe('scout creation buttons', () => {
logic.unmount()
})
- it.each([
- ['on the suggestions flag', true],
- ['off the suggestions flag', false],
- ])('starts an authoring chat on the typed request from New scout, %s', async (_name, suggestionsEnabled) => {
- setSuggestionsFlag(suggestionsEnabled)
+ it('starts an authoring chat on the typed request from New scout', async () => {
const { findByText, getByText, queryByText, container } = render(<ScoutsRosterActions />)
fireEvent.click(getByText('Ask'))
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutSuggestionsStrip.stories.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutSuggestionsStrip.stories.tsx
index 7b2995d31af1..68a2cd27fb50 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutSuggestionsStrip.stories.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutSuggestionsStrip.stories.tsx
@@ -57,7 +57,6 @@ const meta: Meta<typeof ScoutsRoster> = {
featureFlags: {
[FEATURE_FLAGS.PRODUCT_AUTONOMY]: true,
[FEATURE_FLAGS.INBOX_REDESIGN]: true,
- [FEATURE_FLAGS.SCOUTS_SUGGESTIONS_UI]: true,
},
testOptions: { waitForLoadersToDisappear: false },
},
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutSuggestionsStrip.test.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutSuggestionsStrip.test.tsx
index 89c87ee4a89b..d04dd4ba5fb8 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutSuggestionsStrip.test.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutSuggestionsStrip.test.tsx
@@ -1,8 +1,5 @@
import { act, cleanup, fireEvent, render, waitFor } from '@testing-library/react'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-
import { useMocks } from '~/mocks/jest'
import { initKeaTests } from '~/test/init'
@@ -24,10 +21,6 @@ describe('ScoutSuggestionsStrip', () => {
},
})
initKeaTests()
- featureFlagLogic.mount()
- featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.SCOUTS_SUGGESTIONS_UI], {
- [FEATURE_FLAGS.SCOUTS_SUGGESTIONS_UI]: true,
- })
}
// The strip opens collapsed, so a press from the collapsed line is the common path for Refresh,
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutsRosterActions.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutsRosterActions.tsx
index a06ee91bb649..cc9b5af0253e 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutsRosterActions.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutsRosterActions.tsx
@@ -3,8 +3,6 @@ import { useActions, useValues } from 'kea'
import { IconSparkles } from '@posthog/icons'
import { LemonButton, LemonMenu } from '@posthog/lemon-ui'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
@@ -18,10 +16,8 @@ import { ScoutNewButton } from './ScoutNewButton'
/** Actions for the roster, lifted into the scene header so they sit in one predictable place. */
export function ScoutsRosterActions(): JSX.Element {
const { loadScoutConfigs } = useActions(scoutFleetLogic)
- const { featureFlags } = useValues(featureFlagLogic)
const { currentTeamId } = useValues(teamLogic)
const { user } = useValues(userLogic)
- const suggestionsEnabled = !!featureFlags[FEATURE_FLAGS.SCOUTS_SUGGESTIONS_UI]
// Every trial endpoint requires skill editor access, so the page is empty without it.
const trialsDisabledReason = useScoutCreateDisabledReason()
return (
@@ -38,7 +34,7 @@ export function ScoutsRosterActions(): JSX.Element {
</LemonButton>
)}
<AskAboutScoutsMenu />
- {suggestionsEnabled ? <ShowSuggestionsButton /> : null}
+ <ShowSuggestionsButton />
<ScoutNewButton surface="fleet_list" size="small" onCreated={() => loadScoutConfigs()} />
</>
)
diff --git a/products/signals/frontend/inbox/logics/scoutSuggestionsLogic.test.ts b/products/signals/frontend/inbox/logics/scoutSuggestionsLogic.test.ts
index d5297e90e685..4a847b0f64c9 100644
--- a/products/signals/frontend/inbox/logics/scoutSuggestionsLogic.test.ts
+++ b/products/signals/frontend/inbox/logics/scoutSuggestionsLogic.test.ts
@@ -4,11 +4,9 @@ import { expectLogic } from 'kea-test-utils'
import posthog from 'posthog-js'
import { ApiError } from 'lib/api-error'
-import { FEATURE_FLAGS } from 'lib/constants'
// Imported from the source module rather than the `@posthog/lemon-ui` barrel, so the spies below
// replace the methods on the same `lemonToast` singleton the logic calls at runtime.
import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { initKeaTests } from '~/test/init'
@@ -141,19 +139,11 @@ function suggestionSet(overrides: Partial<ScoutSuggestionSetApi> = {}): ScoutSug
describe('scoutSuggestionsLogic', () => {
let logic: ReturnType<typeof scoutSuggestionsLogic.build>
- function setSuggestionsFlag(enabled: boolean): void {
- featureFlagLogic.actions.setFeatureFlags(enabled ? [FEATURE_FLAGS.SCOUTS_SUGGESTIONS_UI] : [], {
- [FEATURE_FLAGS.SCOUTS_SUGGESTIONS_UI]: enabled,
- })
- }
-
beforeEach(() => {
// The strip's collapsed and closed state persists per user and project, so one test's
// chevron would otherwise decide how the next one opens.
localStorage.clear()
initKeaTests()
- featureFlagLogic.mount()
- setSuggestionsFlag(true)
mockList.mockReset().mockResolvedValue(suggestionSet())
mockDismiss.mockReset().mockResolvedValue(CANONICAL_ITEM)
mockRefresh.mockReset().mockResolvedValue({ workflow_id: 'workflow-1' })
@@ -181,21 +171,6 @@ describe('scoutSuggestionsLogic', () => {
scoutFleetLogic.actions.loadScoutConfigsSuccess([CONFIG])
}
- it('reads nothing until the person is on the suggestions flag', async () => {
- setSuggestionsFlag(false)
- await mountWithBatch()
-
- expect(mockList).not.toHaveBeenCalled()
- expect(logic.values.hasPicks).toBe(false)
-
- // Flags usually resolve after the tab mounts, so the answer arriving is what starts the read.
- setSuggestionsFlag(true)
- await expectLogic(logic).toFinishAllListeners()
-
- expect(mockList).toHaveBeenCalledTimes(1)
- expect(logic.values.hasPicks).toBe(true)
- })
-
// The 500 row is the point of this case: a guard wide enough to swallow it would leave a real
// suggestions outage looking identical to a project the member cannot read.
it.each([
diff --git a/products/signals/frontend/inbox/logics/scoutSuggestionsLogic.ts b/products/signals/frontend/inbox/logics/scoutSuggestionsLogic.ts
index 96feebb2e8ca..49b234ef64be 100644
--- a/products/signals/frontend/inbox/logics/scoutSuggestionsLogic.ts
+++ b/products/signals/frontend/inbox/logics/scoutSuggestionsLogic.ts
@@ -4,10 +4,7 @@ import { loaders } from 'kea-loaders'
import { lemonToast } from '@posthog/lemon-ui'
import { ApiError } from 'lib/api-error'
-import { FEATURE_FLAGS } from 'lib/constants'
import { dayjs } from 'lib/dayjs'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-import type { FeatureFlagsSet } from 'lib/logic/featureFlagLogic'
import { buildUserScopedPersistenceConfig } from 'lib/logic/persistence'
import { teamLogic } from 'scenes/teamLogic'
@@ -69,7 +66,6 @@ const scanFromBatch = (suggestionSet: ScoutSuggestionSetApi | null): ScoutSugges
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface scoutSuggestionsLogicValues {
- featureFlags: FeatureFlagsSet // featureFlagLogic
aiConsentDisabledReason: string | null // scoutFleetLogic
runningChatType: ScoutChatType | null // scoutFleetLogic
scoutConfigs: SignalScoutConfig[] | null // scoutFleetLogic
@@ -97,18 +93,10 @@ export interface scoutSuggestionsLogicValues {
suggestionSet: ScoutSuggestionSetApi | null
suggestionSetLoading: boolean
suggestions: ScoutSuggestionItemApi[]
- suggestionsEnabled: boolean
}
// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface scoutSuggestionsLogicActions {
- setFeatureFlags: (
- flags: string[],
- variants: Record<string, boolean | string>
- ) => {
- flags: string[]
- variants: Record<string, boolean | string>
- } // featureFlagLogic
loadScoutConfigs: (_?: void | undefined) => void // scoutFleetLogic
startScoutChatTask: (
chatType: ScoutChatType,
@@ -239,15 +227,9 @@ export interface scoutSuggestionsLogicMeta {
) => ScoutSuggestionItemApi[]
batchStatus: (suggestionSet: ScoutSuggestionSetApi | null) => string
batchAgeHours: (suggestionSet: ScoutSuggestionSetApi | null) => number | null
- suggestionsEnabled: (featureFlags: FeatureFlagsSet) => boolean
- hasPicks: (suggestions: ScoutSuggestionItemApi[], suggestionsEnabled: boolean) => boolean
- stripVisible: (
- hasPicks: boolean,
- suggestionsEnabled: boolean,
- stripHidden: boolean,
- isRefreshing: boolean
- ) => boolean
- suggestButtonVisible: (hasPicks: boolean, suggestionsEnabled: boolean, stripHidden: boolean) => boolean
+ hasPicks: (suggestions: ScoutSuggestionItemApi[]) => boolean
+ stripVisible: (hasPicks: boolean, stripHidden: boolean, isRefreshing: boolean) => boolean
+ suggestButtonVisible: (hasPicks: boolean, stripHidden: boolean) => boolean
refreshElapsedLabel: (isRefreshing: boolean, refreshElapsedMs: number) => string | null
collapsed: (collapsedOverride: boolean | null) => boolean
}
@@ -280,8 +262,6 @@ export const scoutSuggestionsLogic = kea<scoutSuggestionsLogicType>([
['scoutConfigs', 'aiConsentDisabledReason', 'runningChatType'],
teamLogic,
['currentTeamId', 'currentProjectId'],
- featureFlagLogic,
- ['featureFlags'],
],
actions: [
scoutFleetLogic,
@@ -292,8 +272,6 @@ export const scoutSuggestionsLogic = kea<scoutSuggestionsLogicType>([
'startScoutChatTaskSuccess',
'startScoutChatTaskFailure',
],
- featureFlagLogic,
- ['setFeatureFlags'],
],
})),
@@ -339,8 +317,7 @@ export const scoutSuggestionsLogic = kea<scoutSuggestionsLogicType>([
{
loadSuggestions: async (_: void, breakpoint) => {
const teamId = values.currentTeamId
- // Off the flag there is no surface to fill, so the project is never read.
- if (!teamId || !values.suggestionsEnabled) {
+ if (!teamId) {
return values.suggestionSet
}
try {
@@ -495,34 +472,23 @@ export const scoutSuggestionsLogic = kea<scoutSuggestionsLogicType>([
? Math.max(0, Math.round(dayjs().diff(dayjs(suggestionSet.generated_at), 'hour', true) * 10) / 10)
: null,
],
- // The one gate every suggestions surface reads while the feature is dogfooded. The flag is
- // resolved per user, so two people on the same project can see different scouts tabs.
- suggestionsEnabled: [
- (s) => [s.featureFlags],
- (featureFlags: FeatureFlagsSet): boolean => !!featureFlags[FEATURE_FLAGS.SCOUTS_SUGGESTIONS_UI],
- ],
// Every suggestions surface reads this instead of the batch row. A batch with no picks left
// — a scan that found nothing, picks all acted on, a scan that failed — has nothing to
// show, so it must not put an empty box on the roster.
- hasPicks: [
- (s) => [s.suggestions, s.suggestionsEnabled],
- (suggestions: ScoutSuggestionItemApi[], suggestionsEnabled: boolean): boolean =>
- suggestionsEnabled && suggestions.length > 0,
- ],
+ hasPicks: [(s) => [s.suggestions], (suggestions: ScoutSuggestionItemApi[]): boolean => suggestions.length > 0],
// A running scan keeps the strip up with its skeletons, so the person who pressed for one
// watches it arrive rather than looking at a roster that ignored the press.
stripVisible: [
- (s) => [s.hasPicks, s.suggestionsEnabled, s.stripHidden, s.isRefreshing],
- (hasPicks: boolean, suggestionsEnabled: boolean, stripHidden: boolean, isRefreshing: boolean): boolean =>
- suggestionsEnabled && !stripHidden && (hasPicks || isRefreshing),
+ (s) => [s.hasPicks, s.stripHidden, s.isRefreshing],
+ (hasPicks: boolean, stripHidden: boolean, isRefreshing: boolean): boolean =>
+ !stripHidden && (hasPicks || isRefreshing),
],
// The header's own entry point, which stays put while a scan runs: the empty-fleet state
// renders no strip at all, so a button that hid itself on press would be the only feedback
// the person got, and it would be feedback that the press did nothing.
suggestButtonVisible: [
- (s) => [s.hasPicks, s.suggestionsEnabled, s.stripHidden],
- (hasPicks: boolean, suggestionsEnabled: boolean, stripHidden: boolean): boolean =>
- suggestionsEnabled && (!hasPicks || stripHidden),
+ (s) => [s.hasPicks, s.stripHidden],
+ (hasPicks: boolean, stripHidden: boolean): boolean => !hasPicks || stripHidden,
],
// Minutes, not seconds: a stopwatch on a five-minute wait nobody can hurry reads badly.
refreshElapsedLabel: [
@@ -778,13 +744,6 @@ export const scoutSuggestionsLogic = kea<scoutSuggestionsLogicType>([
cache.disposables.dispose('suggestionsRefreshPoll')
cache.disposables.dispose('suggestionsRefreshElapsed')
},
- setFeatureFlags: () => {
- // Flags often resolve after the tab mounts, so the read is retried once the answer is
- // in. Without this a person on the flag opens the roster and sees no strip.
- if (values.suggestionsEnabled && values.suggestionSet === null && !values.suggestionSetLoading) {
- actions.loadSuggestions()
- }
- },
})),
afterMount(({ actions, values }) => {