♻️(backend) control metadata collector agent launch via feature flag

Allow controlling when the metadata collector agent is started,
enabling users to try the feature and disable it if needed.

Introduce a user-level feature flag to toggle the agent for the
initial release.
This commit is contained in:
lebaudantoine
2026-04-16 18:15:06 +02:00
committed by aleb_the_flash
parent fc4b6d679a
commit 3b474ba1c0
6 changed files with 20 additions and 5 deletions
@@ -5,4 +5,5 @@ export enum FeatureFlags {
noiseReduction = 'noise-reduction',
subtitles = 'subtitles',
candidatePolling = 'candidate-polling',
metadataCollector = 'metadata-collector',
}
@@ -32,6 +32,7 @@ import { NoAccessView } from './NoAccessView'
import { ControlsButton } from './ControlsButton'
import { RowWrapper } from './RowWrapper'
import { useMutateRecording } from '../hooks/useMutateRecording'
import { useIsMetadataCollectorEnabled } from '../hooks/useMetadataCollectorEnabled'
import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
export const TranscriptSidePanel = () => {
@@ -59,6 +60,8 @@ export const TranscriptSidePanel = () => {
FeatureFlags.Transcript
)
const isMetadataCollectorEnabled = useIsMetadataCollectorEnabled()
const roomId = useRoomId()
const { startRecording, isPendingToStart, stopRecording, isPendingToStop } =
@@ -106,6 +109,7 @@ export const TranscriptSidePanel = () => {
transcribe: true,
original_mode: RecordingMode.Transcript,
}),
collect_metadata: isMetadataCollectorEnabled,
}
await startRecording({
@@ -0,0 +1,10 @@
import { useFeatureFlagEnabled } from 'posthog-js/react'
import { useIsAnalyticsEnabled } from '@/features/analytics/hooks/useIsAnalyticsEnabled'
import { FeatureFlags } from '@/features/analytics/enums'
export const useIsMetadataCollectorEnabled = () => {
const featureEnabled = useFeatureFlagEnabled(FeatureFlags.metadataCollector)
const isAnalyticsEnabled = useIsAnalyticsEnabled()
return (featureEnabled && isAnalyticsEnabled) || true
}