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(aio): remove fully rolled-out feature flags (#69386)

Carlos Marchale24299cbad4e
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index cf452a510011..d573730369c2 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -4975,13 +4975,13 @@ snapshots:
scenes-app-ai-observability-trace--full--light:
hash: v1.k794b7964.94ccb1c0676dfe56f2dfe450522e796570997788f5fd24f01b44230b64b5c31b.6nCJBKNf3JV1b9HV5LjK20lGJTLTfJFk72reYi3zw4o
scenes-app-ai-observability-trace--full-specific-event--dark:
- hash: v1.k794b7964.8126504b2645e4806916dcc6b57517a3007f54b260f0204e0e225fe8adb3fd94.2RqlaOK6qi0Hv838VmJC-uceXj0FcuT39uZkb10Q-48
+ hash: v1.k794b7964.9e2b03887812835f8023784604140d29f446039730a7dc25b79e36cde1ed1b6d.QHqBYIGjK-VR1vwG9_SzRgH3BeHv6k00HcHn9RAnM10
scenes-app-ai-observability-trace--full-specific-event--light:
- hash: v1.k794b7964.eea86936f0b29cfe31e200f0f0b8df0e1b67c12c8e325072ebf804b295e2df6d.jiN1e1cE_3-yDJP-nK8G6fxTByA6Zf704SjbNi1KO9U
+ hash: v1.k794b7964.20c4c76745d353d2ad3ef1bd0b9804fb219f8e2f609e892e2cfdc5bf8718a235.4i9VZL_CH7pQefsi18fQOQtJh1f0jnk12bZBlZSSoCM
scenes-app-ai-observability-trace--without-content--dark:
hash: v1.k794b7964.43c0a5235771b6bdb554e89d09b43f6aa3603ed7ebe2e0d84858e0d2c15eb278.yNl0wPG__RV5KWRQSSk1AAiPFcFBXftZFMuYZ9uXZeY
scenes-app-ai-observability-trace--without-content--light:
- hash: v1.k794b7964.2323b84137ee00e4c878b51c9c1c67feaa0b32e3ed1e02d3eff1614a8a71eb13.BVOCgmldcwW_4jjNPlSgjd9FUYrVrAp7x2qkjKKM3RA
+ hash: v1.k794b7964.cdee9ec2c6fded05ad4a583ba11574423b6fbe1685ec0c4c1f777e233845c467.87Jht5vUQnHMpxJ1KeqOIPgUtSlmqRwKAZhhEkgC2EM
scenes-app-aigateway--empty--dark:
hash: v1.k794b7964.a79751753cae893fcc58a4c977084260de54c1cedfbaf95e007c24e17b349bc0.P3gRNI2aaymd2jiM8kkbBUuRCvPxY4EGX66u3hdLODw
scenes-app-aigateway--empty--light:
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 28a7aab39be8..e099fbad95ca 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -246,7 +246,6 @@ export const FEATURE_FLAGS = {
ACTION_REFERENCE_COUNT: 'action-reference-count', // owner: @andyzzhao #team-product-analytics, gates bulk action reference counting on actions list
ADVANCE_MARKETING_ANALYTICS_SETTINGS: 'advance-marketing-analytics-settings', // owner: @jabahamondes #team-web-analytics
AI_GATEWAY: 'ai-gateway', // owner: #team-ai-gateway, gates the AI gateway UI and llm_gateway:read on project secret API keys
- AI_OBSERVABILITY_EVALUATIONS_TRACE_TARGET: 'ai-observability-evaluations-trace-target', // owner: #team-ai-observability
/** Alert edit modal: check history chart + chart/table toggle (table remains when off). */
ALERTS_15_MINUTE_INTERVAL: 'alerts-15-minute-interval', // owner: #team-analytics-platform, gates 15-minute insight alert interval
ALERTS_ANOMALY_DETECTION: 'alerts-anomaly-detection', // owner: @andrewm4894
@@ -344,15 +343,13 @@ export const FEATURE_FLAGS = {
LIVE_DEBUGGER: 'live-debugger', // owner: @marcecoll
LIVE_EVENTS_RICH_FILTERS: 'live-events-rich-filters', // owner: @jordanm-posthog #team-web-analytics
LLM_ANALYTICS_CLUSTERING_ADMIN: 'llm-analytics-clustering-admin', // owner: #team-ai-observability
- LLM_ANALYTICS_CUSTOM_PARSERS: 'ai-observability-custom-parsers', // owner: #team-ai-observability
LLM_ANALYTICS_DATASETS: 'llm-analytics-datasets', // owner: #team-ai-observability #team-posthog-ai
LLM_ANALYTICS_EARLY_ADOPTERS: 'llm-analytics-early-adopters', // owner: #team-ai-observability
- LLM_ANALYTICS_EVALUATIONS_SENTIMENT: 'llm-analytics-sentiment-evaluations', // owner: #team-ai-observability
+ LLM_ANALYTICS_EVALUATIONS_REPORTS: 'llm-analytics-evaluations-reports', // owner: #team-ai-observability
LLM_ANALYTICS_OFFLINE_EVALS: 'llm-analytics-offline-evals', // owner: #team-ai-observability
LLM_ANALYTICS_TAGS: 'llm-analytics-tags', // owner: #team-ai-observability
LLM_ANALYTICS_TRACE_NAVIGATION: 'llm-analytics-trace-navigation', // owner: #team-ai-observability
LLM_ANALYTICS_USER_FEEDBACK: 'llm-analytics-user-feedback', // owner: @adboio #team-surveys
- LLM_OBSERVABILITY_SHOW_INPUT_OUTPUT: 'llm-observability-show-input-output', // owner: #team-ai-observability
LLM_OBSERVABILITY_TRACE_SEARCH: 'llm-observability-trace-search', // owner: #team-ai-observability
LOGS: 'logs', // owner: #team-logs
LOGS_ALERTING: 'logs-alerting', // owner: #team-logs
diff --git a/frontend/src/scenes/max/max-constants.tsx b/frontend/src/scenes/max/max-constants.tsx
index 2fdba6635d43..51d04f6bce2a 100644
--- a/frontend/src/scenes/max/max-constants.tsx
+++ b/frontend/src/scenes/max/max-constants.tsx
@@ -1260,7 +1260,6 @@ export const TOOL_DEFINITIONS: Record<AssistantTool, ToolDefinition> = {
name: 'Create custom parsers',
description: 'Create custom parsers to control how AI observability events are displayed',
icon: iconForType('llm_analytics'),
- flag: FEATURE_FLAGS.LLM_ANALYTICS_CUSTOM_PARSERS,
clientExecuted: true,
displayFormatter: (toolCall) => {
if (toolCall.status === 'completed') {
diff --git a/frontend/src/scenes/settings/SettingsMap.tsx b/frontend/src/scenes/settings/SettingsMap.tsx
index bad421b7d967..7dda4db16fcf 100644
--- a/frontend/src/scenes/settings/SettingsMap.tsx
+++ b/frontend/src/scenes/settings/SettingsMap.tsx
@@ -367,7 +367,6 @@ export const SETTINGS_MAP: SettingSection[] = [
description:
"Add recipes that normalize provider message shapes the built-in recipes don't cover. They apply when rendering traces.",
component: <ParserRecipesSettings />,
- flag: 'LLM_ANALYTICS_CUSTOM_PARSERS',
keywords: ['parser', 'recipe', 'normalize', 'trace', 'provider', 'custom parsing', 'content'],
},
],
diff --git a/products/ai_observability/backend/api/evaluations.py b/products/ai_observability/backend/api/evaluations.py
index dcb1c5672f79..bf39c9099031 100644
--- a/products/ai_observability/backend/api/evaluations.py
+++ b/products/ai_observability/backend/api/evaluations.py
@@ -1,5 +1,5 @@
import json
-from typing import Any, cast
+from typing import Any
from django.db import transaction
from django.db.models import Q, QuerySet
@@ -19,14 +19,12 @@ from posthog.api.monitoring import monitor
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.api.shared import UserBasicSerializer
from posthog.event_usage import report_user_action
-from posthog.models import User
from posthog.permissions import AccessControlPermission
from posthog.rbac.access_control_api_mixin import AccessControlViewSetMixin
from posthog.temporal.ai_observability.message_utils import extract_text_from_messages
from posthog.temporal.ai_observability.model_resolution import active_key_fallback
from posthog.temporal.ai_observability.run_evaluation import extract_event_io, run_hog_eval
-from ..feature_flags import is_sentiment_evaluations_enabled
from ..hog import compile_ai_observability_hog
from ..llm import DEFAULT_MODEL_BY_PROVIDER, TRIAL_MODEL_IDS
from ..models.evaluation_config import EvaluationConfig
@@ -35,7 +33,6 @@ from ..models.evaluation_configs import (
TRACE_EVAL_MAX_WINDOW_SECONDS,
TRACE_EVAL_MIN_WINDOW_SECONDS,
EvaluationType,
- OutputType,
evaluation_supports_reports,
evaluation_uses_model_configuration,
get_evaluation_config_content_key,
@@ -288,11 +285,6 @@ class EvaluationSerializer(serializers.ModelSerializer):
getattr(self.instance, "model_configuration", None) if self.instance else None,
)
- if self._requires_sentiment_evaluations_feature(data) and not self._sentiment_evaluations_enabled():
- raise serializers.ValidationError(
- {"evaluation_type": "Sentiment evaluations are not available for this project."}
- )
-
if not evaluation_uses_model_configuration(evaluation_type) and model_configuration is not None:
raise serializers.ValidationError(
{"model_configuration": "This evaluation type does not use model configuration."}
@@ -352,34 +344,6 @@ class EvaluationSerializer(serializers.ModelSerializer):
return data
- def _requires_sentiment_evaluations_feature(self, data: dict) -> bool:
- if self.instance is None:
- return (
- data.get("evaluation_type") == EvaluationType.SENTIMENT.value
- or data.get("output_type") == OutputType.SENTIMENT.value
- )
- if (
- data.get("evaluation_type") == EvaluationType.SENTIMENT.value
- and self.instance.evaluation_type != EvaluationType.SENTIMENT.value
- ):
- return True
- if (
- data.get("output_type") == OutputType.SENTIMENT.value
- and self.instance.output_type != OutputType.SENTIMENT.value
- ):
- return True
- return (
- data.get("enabled") is True
- and not self.instance.enabled
- and self.instance.evaluation_type == EvaluationType.SENTIMENT.value
- )
-
- def _sentiment_evaluations_enabled(self) -> bool:
- return is_sentiment_evaluations_enabled(
- cast(User, self.context["request"].user),
- self.context["get_team"](),
- )
-
def _validate_can_run(self, data: dict) -> None:
"""An eval being turned on — created enabled or re-enabled — must be able to resolve a
model at runtime; otherwise the caller gets a 200/201 and the first Temporal run silently
diff --git a/products/ai_observability/backend/api/score_definitions.py b/products/ai_observability/backend/api/score_definitions.py
index 7078d8d6a0fe..a470df58ed6c 100644
--- a/products/ai_observability/backend/api/score_definitions.py
+++ b/products/ai_observability/backend/api/score_definitions.py
@@ -11,7 +11,6 @@ from drf_spectacular.types import OpenApiTypes
from drf_spectacular.utils import OpenApiExample, OpenApiParameter, OpenApiResponse
from rest_framework import mixins, serializers, status, viewsets
from rest_framework.decorators import action
-from rest_framework.permissions import BasePermission
from rest_framework.request import Request
from rest_framework.response import Response
@@ -20,36 +19,13 @@ from posthog.api.mixins import ValidatedRequest, validated_request
from posthog.api.routing import TeamAndOrgViewSetMixin
from posthog.api.shared import UserBasicSerializer
from posthog.event_usage import report_user_action
-from posthog.models import Team, User
+from posthog.models import User
from posthog.permissions import AccessControlPermission
-from posthog.ph_client import feature_enabled_or_false
from posthog.rbac.access_control_api_mixin import AccessControlViewSetMixin
from products.ai_observability.backend.models.score_definitions import ScoreDefinition, StaleScoreDefinitionVersion
from products.ai_observability.backend.score_definition_configs import ScoreDefinitionConfigField
-HUMAN_REVIEWS_FEATURE_FLAG = "llma-trace-review"
-
-
-def is_human_reviews_feature_enabled(user: User, team: Team) -> bool:
- distinct_id = user.distinct_id or str(user.uuid)
- organization_id = str(team.organization_id)
- project_id = str(team.id)
-
- return feature_enabled_or_false(
- HUMAN_REVIEWS_FEATURE_FLAG,
- distinct_id,
- groups={"organization": organization_id, "project": project_id},
- group_properties={"organization": {"id": organization_id}, "project": {"id": project_id}},
- only_evaluate_locally=False,
- send_feature_flag_events=False,
- )
-
-
-class HumanReviewsFeatureFlagPermission(BasePermission):
- def has_permission(self, request, view) -> bool:
- return is_human_reviews_feature_enabled(cast(User, request.user), view.team)
-
class ScoreDefinitionSerializer(serializers.ModelSerializer):
created_by = UserBasicSerializer(
@@ -201,7 +177,7 @@ class ScoreDefinitionViewSet(
viewsets.GenericViewSet,
):
scope_object = "llm_analytics"
- permission_classes = [HumanReviewsFeatureFlagPermission, AccessControlPermission]
+ permission_classes = [AccessControlPermission]
serializer_class = ScoreDefinitionSerializer
queryset = ScoreDefinition.objects.all()
filter_backends = [DjangoFilterBackend]
diff --git a/products/ai_observability/backend/api/test/test_ai_observability_access_control.py b/products/ai_observability/backend/api/test/test_ai_observability_access_control.py
index 71ede47b46ac..2f9186dc2720 100644
--- a/products/ai_observability/backend/api/test/test_ai_observability_access_control.py
+++ b/products/ai_observability/backend/api/test/test_ai_observability_access_control.py
@@ -37,17 +37,6 @@ class TestAIObservabilityAccessControl(APIBaseTest):
]
self.organization.save()
- self.score_definitions_flag_patcher = patch(
- "products.ai_observability.backend.api.score_definitions.feature_enabled_or_false", return_value=True
- )
- self.trace_reviews_flag_patcher = patch(
- "products.ai_observability.backend.api.trace_reviews.feature_enabled_or_false", return_value=True
- )
- self.score_definitions_flag_patcher.start()
- self.trace_reviews_flag_patcher.start()
- self.addCleanup(self.score_definitions_flag_patcher.stop)
- self.addCleanup(self.trace_reviews_flag_patcher.stop)
-
AccessControl.objects.create(
team=self.team,
resource="project",
diff --git a/products/ai_observability/backend/api/test/test_evaluations.py b/products/ai_observability/backend/api/test/test_evaluations.py
index cae0f6fff737..782ae5e1b049 100644
--- a/products/ai_observability/backend/api/test/test_evaluations.py
+++ b/products/ai_observability/backend/api/test/test_evaluations.py
@@ -244,19 +244,18 @@ class TestEvaluationConfigsApi(APIBaseTest):
self.assertEqual(EvaluationReport.objects.count(), 0)
def test_can_create_sentiment_evaluation_without_default_report(self):
- with patch("products.ai_observability.backend.feature_flags.feature_enabled_or_false", return_value=True):
- response = self.client.post(
- f"/api/environments/{self.team.id}/evaluations/",
- {
- "name": "Sentiment Evaluation",
- "enabled": True,
- "evaluation_type": "sentiment",
- "evaluation_config": {},
- "output_type": "sentiment",
- "output_config": {},
- "conditions": [{"id": "test-condition", "rollout_percentage": 50, "properties": []}],
- },
- )
+ response = self.client.post(
+ f"/api/environments/{self.team.id}/evaluations/",
+ {
+ "name": "Sentiment Evaluation",
+ "enabled": True,
+ "evaluation_type": "sentiment",
+ "evaluation_config": {},
+ "output_type": "sentiment",
+ "output_config": {},
+ "conditions": [{"id": "test-condition", "rollout_percentage": 50, "properties": []}],
+ },
+ )
self.assertEqual(response.status_code, status.HTTP_201_CREATED, response.json())
evaluation = Evaluation.objects.get(id=response.data["id"])
@@ -267,117 +266,42 @@ class TestEvaluationConfigsApi(APIBaseTest):
self.assertEqual(EvaluationReport.objects.filter(evaluation=evaluation).count(), 0)
def test_rejects_sentiment_evaluation_with_trace_target(self):
- with patch("products.ai_observability.backend.feature_flags.feature_enabled_or_false", return_value=True):
- response = self.client.post(
- f"/api/environments/{self.team.id}/evaluations/",
- {
- "name": "Sentiment over a trace",
- "evaluation_type": "sentiment",
- "evaluation_config": {},
- "output_type": "sentiment",
- "output_config": {},
- "conditions": [{"id": "test-condition", "rollout_percentage": 50, "properties": []}],
- "target": "trace",
- },
- )
+ response = self.client.post(
+ f"/api/environments/{self.team.id}/evaluations/",
+ {
+ "name": "Sentiment over a trace",
+ "evaluation_type": "sentiment",
+ "evaluation_config": {},
+ "output_type": "sentiment",
+ "output_config": {},
+ "conditions": [{"id": "test-condition", "rollout_percentage": 50, "properties": []}],
+ "target": "trace",
+ },
+ )
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.json()["attr"], "target")
self.assertEqual(Evaluation.objects.count(), 0)
- def test_create_sentiment_evaluation_requires_feature_flag(self):
- with patch("products.ai_observability.backend.feature_flags.feature_enabled_or_false", return_value=False):
- response = self.client.post(
- f"/api/environments/{self.team.id}/evaluations/",
- {
- "name": "Sentiment Evaluation",
- "enabled": True,
- "evaluation_type": "sentiment",
- "evaluation_config": {},
- "output_type": "sentiment",
- "output_config": {},
- "conditions": [{"id": "test-condition", "rollout_percentage": 50, "properties": []}],
- },
- )
-
- self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
- self.assertEqual(response.data["attr"], "evaluation_type")
- self.assertEqual(Evaluation.objects.count(), 0)
-
- def test_re_enable_sentiment_evaluation_requires_feature_flag(self):
- evaluation = Evaluation.objects.create(
- name="Sentiment Evaluation",
- enabled=False,
- evaluation_type="sentiment",
- evaluation_config={},
- output_type="sentiment",
- output_config={},
- conditions=[{"id": "test-condition", "rollout_percentage": 50, "properties": []}],
- team=self.team,
- created_by=self.user,
- )
-
- with patch("products.ai_observability.backend.feature_flags.feature_enabled_or_false", return_value=False):
- response = self.client.patch(
- f"/api/environments/{self.team.id}/evaluations/{evaluation.id}/",
- {"enabled": True},
- )
-
- self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
- self.assertEqual(response.data["attr"], "evaluation_type")
- evaluation.refresh_from_db()
- self.assertFalse(evaluation.enabled)
-
- def test_update_existing_sentiment_evaluation_allows_unchanged_type_when_feature_flag_off(self):
- evaluation = Evaluation.objects.create(
- name="Sentiment Evaluation",
- enabled=True,
- evaluation_type="sentiment",
- evaluation_config={},
- output_type="sentiment",
- output_config={},
- conditions=[{"id": "test-condition", "rollout_percentage": 50, "properties": []}],
- team=self.team,
- created_by=self.user,
- )
-
- with patch("products.ai_observability.backend.feature_flags.feature_enabled_or_false", return_value=False):
- response = self.client.patch(
- f"/api/environments/{self.team.id}/evaluations/{evaluation.id}/",
- {
- "name": "Updated Sentiment Evaluation",
- "evaluation_type": "sentiment",
- "output_type": "sentiment",
- "evaluation_config": {"source": "user_messages"},
- "output_config": {},
- },
- format="json",
- )
-
- self.assertEqual(response.status_code, status.HTTP_200_OK, response.json())
- evaluation.refresh_from_db()
- self.assertEqual(evaluation.name, "Updated Sentiment Evaluation")
-
def test_sentiment_evaluation_rejects_model_configuration(self):
- with patch("products.ai_observability.backend.feature_flags.feature_enabled_or_false", return_value=True):
- response = self.client.post(
- f"/api/environments/{self.team.id}/evaluations/",
- {
- "name": "Sentiment Evaluation",
- "enabled": True,
- "evaluation_type": "sentiment",
- "evaluation_config": {},
- "output_type": "sentiment",
- "output_config": {},
- "model_configuration": {
- "provider": "openai",
- "model": "gpt-5-mini",
- "provider_key_id": None,
- },
- "conditions": [{"id": "test-condition", "rollout_percentage": 50, "properties": []}],
+ response = self.client.post(
+ f"/api/environments/{self.team.id}/evaluations/",
+ {
+ "name": "Sentiment Evaluation",
+ "enabled": True,
+ "evaluation_type": "sentiment",
+ "evaluation_config": {},
+ "output_type": "sentiment",
+ "output_config": {},
+ "model_configuration": {
+ "provider": "openai",
+ "model": "gpt-5-mini",
+ "provider_key_id": None,
},
- format="json",
- )
+ "conditions": [{"id": "test-condition", "rollout_percentage": 50, "properties": []}],
+ },
+ format="json",
+ )
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.data["attr"], "model_configuration")
@@ -436,20 +360,19 @@ class TestEvaluationConfigsApi(APIBaseTest):
def test_rejects_unsupported_evaluation_output_type_combinations(
self, _name, evaluation_type, output_type, evaluation_config, output_config
):
- with patch("products.ai_observability.backend.feature_flags.feature_enabled_or_false", return_value=True):
- response = self.client.post(
- f"/api/environments/{self.team.id}/evaluations/",
- {
- "name": "Unsupported Evaluation",
- "enabled": True,
- "evaluation_type": evaluation_type,
- "evaluation_config": evaluation_config,
- "output_type": output_type,
- "output_config": output_config,
- "conditions": [{"id": "test-condition", "rollout_percentage": 50, "properties": []}],
- },
- format="json",
- )
+ response = self.client.post(
+ f"/api/environments/{self.team.id}/evaluations/",
+ {
+ "name": "Unsupported Evaluation",
+ "enabled": True,
+ "evaluation_type": evaluation_type,
+ "evaluation_config": evaluation_config,
+ "output_type": output_type,
+ "output_config": output_config,
+ "conditions": [{"id": "test-condition", "rollout_percentage": 50, "properties": []}],
+ },
+ format="json",
+ )
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.data["attr"], "config")
diff --git a/products/ai_observability/backend/api/test/test_score_definitions.py b/products/ai_observability/backend/api/test/test_score_definitions.py
index beca27d01814..6a680cf4e06b 100644
--- a/products/ai_observability/backend/api/test/test_score_definitions.py
+++ b/products/ai_observability/backend/api/test/test_score_definitions.py
@@ -12,14 +12,6 @@ from products.ai_observability.backend.models.score_definitions import (
class TestScoreDefinitionsApi(APIBaseTest):
- def setUp(self) -> None:
- super().setUp()
- self.feature_flag_patcher = patch(
- "products.ai_observability.backend.api.score_definitions.feature_enabled_or_false", return_value=True
- )
- self.feature_flag_patcher.start()
- self.addCleanup(self.feature_flag_patcher.stop)
-
def _endpoint(self) -> str:
return f"/api/environments/{self.team.id}/llm_analytics/score_definitions/"
diff --git a/products/ai_observability/backend/api/test/test_trace_reviews.py b/products/ai_observability/backend/api/test/test_trace_reviews.py
index be79375820d6..4f4aa2463baa 100644
--- a/products/ai_observability/backend/api/test/test_trace_reviews.py
+++ b/products/ai_observability/backend/api/test/test_trace_reviews.py
@@ -1,5 +1,4 @@
from posthog.test.base import APIBaseTest
-from unittest.mock import patch
from django.test import override_settings
@@ -12,14 +11,6 @@ from products.ai_observability.backend.models.trace_reviews import TraceReview,
class TestTraceReviewsApi(APIBaseTest):
- def setUp(self) -> None:
- super().setUp()
- self.feature_flag_patcher = patch(
- "products.ai_observability.backend.api.trace_reviews.feature_enabled_or_false", return_value=True
- )
- self.feature_flag_patcher.start()
- self.addCleanup(self.feature_flag_patcher.stop)
-
def _endpoint(self) -> str:
return f"/api/environments/{self.team.id}/llm_analytics/trace_reviews/"
diff --git a/products/ai_observability/backend/api/trace_reviews.py b/products/ai_observability/backend/api/trace_reviews.py
index 57498e34983c..e13c0dbe6b37 100644
--- a/products/ai_observability/backend/api/trace_reviews.py
+++ b/products/ai_observability/backend/api/trace_reviews.py
@@ -13,7 +13,6 @@ from django_filters.rest_framework import DjangoFilterBackend
from drf_spectacular.types import OpenApiTypes
from drf_spectacular.utils import OpenApiExample, OpenApiParameter, OpenApiResponse, extend_schema_field
from rest_framework import serializers, status
-from rest_framework.permissions import BasePermission
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.viewsets import ModelViewSet
@@ -25,7 +24,6 @@ from posthog.api.shared import UserBasicSerializer
from posthog.event_usage import report_user_action
from posthog.models import Team, User
from posthog.permissions import AccessControlPermission
-from posthog.ph_client import feature_enabled_or_false
from posthog.rbac.access_control_api_mixin import AccessControlViewSetMixin
from products.ai_observability.backend.api.metrics import llma_track_latency
@@ -37,30 +35,9 @@ from products.ai_observability.backend.score_definition_configs import (
normalize_score_definition_key,
)
-TRACE_REVIEW_FEATURE_FLAG = "llma-trace-review"
TRACE_REVIEW_SCORE_VALUE_FIELDS = ("categorical_values", "numeric_value", "boolean_value")
-def is_trace_review_feature_enabled(user: User, team: Team) -> bool:
- distinct_id = user.distinct_id or str(user.uuid)
- organization_id = str(team.organization_id)
- project_id = str(team.id)
-
- return feature_enabled_or_false(
- TRACE_REVIEW_FEATURE_FLAG,
- distinct_id,
- groups={"organization": organization_id, "project": project_id},
- group_properties={"organization": {"id": organization_id}, "project": {"id": project_id}},
- only_evaluate_locally=False,
- send_feature_flag_events=False,
- )
-
-
-class TraceReviewFeatureFlagPermission(BasePermission):
- def has_permission(self, request, view) -> bool:
- return is_trace_review_feature_enabled(cast(User, request.user), view.team)
-
-
class TraceReviewScoreSerializer(serializers.ModelSerializer):
categorical_values = serializers.ListField(
read_only=True,
@@ -589,7 +566,7 @@ class TraceReviewFilter(django_filters.FilterSet):
class TraceReviewViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixin, ModelViewSet):
scope_object = "llm_analytics"
- permission_classes = [TraceReviewFeatureFlagPermission, AccessControlPermission]
+ permission_classes = [AccessControlPermission]
serializer_class = TraceReviewSerializer
queryset = TraceReview.objects.all()
filter_backends = [DjangoFilterBackend]
diff --git a/products/ai_observability/backend/feature_flags.py b/products/ai_observability/backend/feature_flags.py
deleted file mode 100644
index 591cacd5b4f9..000000000000
--- a/products/ai_observability/backend/feature_flags.py
+++ /dev/null
@@ -1,21 +0,0 @@
-from __future__ import annotations
-
-from posthog.models import Team, User
-from posthog.ph_client import feature_enabled_or_false
-
-SENTIMENT_EVALUATIONS_FEATURE_FLAG = "llm-analytics-sentiment-evaluations"
-
-
-def is_sentiment_evaluations_enabled(user: User, team: Team) -> bool:
- distinct_id = user.distinct_id or str(user.uuid)
- organization_id = str(team.organization_id)
- project_id = str(team.id)
-
- return feature_enabled_or_false(
- SENTIMENT_EVALUATIONS_FEATURE_FLAG,
- distinct_id,
- groups={"organization": organization_id, "project": project_id},
- group_properties={"organization": {"id": organization_id}, "project": {"id": project_id}},
- only_evaluate_locally=False,
- send_feature_flag_events=False,
- )
diff --git a/products/ai_observability/frontend/AIObservabilityTraceScene.tsx b/products/ai_observability/frontend/AIObservabilityTraceScene.tsx
index af0d44415a45..8c8b4296c808 100644
--- a/products/ai_observability/frontend/AIObservabilityTraceScene.tsx
+++ b/products/ai_observability/frontend/AIObservabilityTraceScene.tsx
@@ -1451,8 +1451,7 @@ const EventContent = React.memo(
const showPromptButton = !!promptName
const showPlaygroundButton = isGenerationEvent
- const showCreateSentimentEvalButton =
- isGenerationEvent && !!featureFlags[FEATURE_FLAGS.LLM_ANALYTICS_EVALUATIONS_SENTIMENT]
+ const showCreateSentimentEvalButton = isGenerationEvent
const showSaveToDatasetButton = featureFlags[FEATURE_FLAGS.LLM_ANALYTICS_DATASETS]
diff --git a/products/ai_observability/frontend/AIObservabilityTracesScene.tsx b/products/ai_observability/frontend/AIObservabilityTracesScene.tsx
index 2e3ca064206f..0b94b43fb354 100644
--- a/products/ai_observability/frontend/AIObservabilityTracesScene.tsx
+++ b/products/ai_observability/frontend/AIObservabilityTracesScene.tsx
@@ -6,11 +6,9 @@ import { IconGear } from '@posthog/icons'
import { LemonButton, LemonDropdown, LemonSwitch, LemonTag } from '@posthog/lemon-ui'
import { TZLabel } from 'lib/components/TZLabel'
-import { FEATURE_FLAGS } from 'lib/constants'
import { LemonSkeleton } from 'lib/lemon-ui/LemonSkeleton'
import { Link } from 'lib/lemon-ui/Link'
import { Tooltip } from 'lib/lemon-ui/Tooltip'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { urls } from 'scenes/urls'
import { DataTable } from '~/queries/nodes/DataTable/DataTable'
@@ -96,28 +94,23 @@ export function AIObservabilityTraces(): JSX.Element {
}
function TracesOptionsMenu(): JSX.Element | null {
- const { featureFlags } = useValues(featureFlagLogic)
const { showInputOutputColumns, showSentimentColumn } = useValues(aiObservabilityTracesTabLogic)
const { setShowInputOutputColumns, setShowSentimentColumn } = useActions(aiObservabilityTracesTabLogic)
- const showInputOutputToggleEnabled = !!featureFlags[FEATURE_FLAGS.LLM_OBSERVABILITY_SHOW_INPUT_OUTPUT]
-
return (
<LemonDropdown
closeOnClickInside={false}
placement="bottom-end"
overlay={
<div className="flex flex-col gap-2 py-1 px-2 min-w-64">
- {showInputOutputToggleEnabled && (
- <LemonSwitch
- checked={showInputOutputColumns}
- onChange={setShowInputOutputColumns}
- label="Show input/output"
- fullWidth
- tooltip="Preview each trace's first input and last output in the table. Turn off for a denser view."
- data-attr="llm-traces-show-input-output-toggle"
- />
- )}
+ <LemonSwitch
+ checked={showInputOutputColumns}
+ onChange={setShowInputOutputColumns}
+ label="Show input/output"
+ fullWidth
+ tooltip="Preview each trace's first input and last output in the table. Turn off for a denser view."
+ data-attr="llm-traces-show-input-output-toggle"
+ />
<LemonSwitch
checked={showSentimentColumn}
onChange={setShowSentimentColumn}
diff --git a/products/ai_observability/frontend/customParser/useCustomParserMaxTool.ts b/products/ai_observability/frontend/customParser/useCustomParserMaxTool.ts
index f2921b1bc1fb..d2b9030b60ef 100644
--- a/products/ai_observability/frontend/customParser/useCustomParserMaxTool.ts
+++ b/products/ai_observability/frontend/customParser/useCustomParserMaxTool.ts
@@ -3,7 +3,6 @@ import { useCallback, useMemo } from 'react'
import { lemonToast } from '@posthog/lemon-ui'
-import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { useMaxTool } from 'scenes/max/useMaxTool'
import { teamLogic } from 'scenes/teamLogic'
@@ -40,7 +39,6 @@ export function useCustomParserMaxTool({
isLoading,
isGeneration,
}: CustomParserMaxToolOptions): (() => void) | null {
- const customParsersEnabled = useFeatureFlag('LLM_ANALYTICS_CUSTOM_PARSERS')
const { currentTeamId } = useValues(teamLogic)
const { storedForMerge, customItems } = useValues(parserRecipesLogic)
const { loadRecipes } = useActions(parserRecipesLogic)
@@ -53,7 +51,7 @@ export function useCustomParserMaxTool({
: !outputRecognized
? 'output'
: null
- const active = customParsersEnabled && unrecognized !== null && !isLoading
+ const active = unrecognized !== null && !isLoading
const context = useMemo(() => {
if (!active) {
diff --git a/products/ai_observability/frontend/evaluations/AIObservabilityEvaluation.tsx b/products/ai_observability/frontend/evaluations/AIObservabilityEvaluation.tsx
index ac65a940a60d..caf15958c39f 100644
--- a/products/ai_observability/frontend/evaluations/AIObservabilityEvaluation.tsx
+++ b/products/ai_observability/frontend/evaluations/AIObservabilityEvaluation.tsx
@@ -21,9 +21,7 @@ import {
import { AccessControlAction } from 'lib/components/AccessControlAction'
import { DurationPicker } from 'lib/components/DurationPicker/DurationPicker'
import { NotFound } from 'lib/components/NotFound'
-import { FEATURE_FLAGS } from 'lib/constants'
import { lemonToast } from 'lib/lemon-ui/LemonToast'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { SceneExport } from 'scenes/sceneTypes'
import { userLogic } from 'scenes/userLogic'
@@ -43,7 +41,6 @@ import { EvaluationRunsTable } from './components/EvaluationRunsTable'
import { EvaluationTriggers } from './components/EvaluationTriggers'
import {
evaluationSupportsReports,
- evaluationTypeCanBeCreated,
evaluationTypeHasEditableCriteria,
evaluationTypeSupportsSignalEmission,
evaluationTypeUsesModelConfiguration,
@@ -66,10 +63,8 @@ export function AIObservabilityEvaluation(): JSX.Element {
activeTab,
canEnable,
canEnableReason,
- originalEvaluation,
} = useValues(llmEvaluationLogic)
const { user } = useValues(userLogic)
- const { featureFlags } = useValues(featureFlagLogic)
const { searchParams } = useValues(router)
const {
setEvaluationName,
@@ -104,14 +99,6 @@ export function AIObservabilityEvaluation(): JSX.Element {
const isSentiment = evaluation.evaluation_type === 'sentiment'
const isReportableEvaluation = evaluationSupportsReports(evaluation)
const hasEditableCriteria = evaluationTypeHasEditableCriteria(evaluation.evaluation_type)
- const canUseEvaluationType = evaluationTypeCanBeCreated(evaluation.evaluation_type, featureFlags)
- const canSaveEvaluationType =
- canUseEvaluationType || originalEvaluation?.evaluation_type === evaluation.evaluation_type
- const effectiveCanEnable = canEnable && (evaluation.enabled || canUseEvaluationType)
- const effectiveCanEnableReason =
- !evaluation.enabled && !canUseEvaluationType
- ? 'Sentiment evaluations are not available for this project.'
- : canEnableReason
const trendInsightUrl =
isReportableEvaluation && !isNewEvaluation && evaluation.id
@@ -180,15 +167,13 @@ export function AIObservabilityEvaluation(): JSX.Element {
(c) => (c.rollout_percentage ?? 0) > 100 || (c.rollout_percentage ?? 0) < 0
)
const hasConditions = evaluation.conditions.length > 0
- const saveButtonDisabledReason = !canSaveEvaluationType
- ? 'Sentiment evaluations are not available for this project'
- : !hasName
- ? 'Add a name for this evaluation'
- : !configValid
- ? isHog
- ? 'Add evaluation code before saving'
- : 'Add an evaluation prompt before saving'
- : undefined
+ const saveButtonDisabledReason = !hasName
+ ? 'Add a name for this evaluation'
+ : !configValid
+ ? isHog
+ ? 'Add evaluation code before saving'
+ : 'Add an evaluation prompt before saving'
+ : undefined
const focusTriggers = (): void => {
setActiveTab('configuration')
@@ -232,22 +217,16 @@ export function AIObservabilityEvaluation(): JSX.Element {
label: 'Hog code',
},
]
- const sentimentEvaluationMethodOptions: { value: EvaluationType; label: string }[] =
- evaluationTypeCanBeCreated('sentiment', featureFlags) || isSentiment
- ? [
- {
- value: 'sentiment',
- label: 'Sentiment analysis',
- },
- ]
- : []
const evaluationMethodOptions: { value: EvaluationType; label: string }[] = [
{
value: 'llm_judge',
label: 'LLM as a judge',
},
...hogEvaluationMethodOptions,
- ...sentimentEvaluationMethodOptions,
+ {
+ value: 'sentiment',
+ label: 'Sentiment analysis',
+ },
]
return (
@@ -463,53 +442,51 @@ export function AIObservabilityEvaluation(): JSX.Element {
)}
</p>
- {featureFlags[FEATURE_FLAGS.AI_OBSERVABILITY_EVALUATIONS_TRACE_TARGET] &&
- !isSentiment && (
- <>
- <Field name="target" label="Evaluate">
- <LemonSelect<EvaluationTarget>
- value={evaluation.target ?? 'generation'}
- onChange={setEvaluationTarget}
- options={[
- {
- value: 'generation',
- label: 'Each generation',
- },
- {
- value: 'trace',
- label: 'Whole trace',
- },
- ]}
- fullWidth
- />
+ {!isSentiment && (
+ <>
+ <Field name="target" label="Evaluate">
+ <LemonSelect<EvaluationTarget>
+ value={evaluation.target ?? 'generation'}
+ onChange={setEvaluationTarget}
+ options={[
+ {
+ value: 'generation',
+ label: 'Each generation',
+ },
+ {
+ value: 'trace',
+ label: 'Whole trace',
+ },
+ ]}
+ fullWidth
+ />
+ </Field>
+ <p className="text-muted text-sm -mt-2">
+ {evaluation.target === 'trace'
+ ? 'Runs once per trace on all of its events together, after a delay that lets the trace complete.'
+ : 'Runs on each matching generation event individually, right after it is ingested.'}
+ </p>
+ {evaluation.target === 'trace' && (
+ <Field name="trace_window" label="Wait before evaluating">
+ <div className="space-y-1">
+ <DurationPicker
+ value={
+ evaluation.target_config.window_seconds ??
+ DEFAULT_TRACE_WINDOW_SECONDS
+ }
+ onChange={setTraceWindowSeconds}
+ />
+ <p className="text-muted text-xs">
+ How long to wait after the first matching generation
+ before pulling the whole trace (10s–2h). Captured
+ when the run is scheduled — changing it won't affect
+ trace runs already in flight.
+ </p>
+ </div>
</Field>
- <p className="text-muted text-sm -mt-2">
- {evaluation.target === 'trace'
- ? 'Runs once per trace on all of its events together, after a delay that lets the trace complete.'
- : 'Runs on each matching generation event individually, right after it is ingested.'}
- </p>
- {evaluation.target === 'trace' && (
- <Field name="trace_window" label="Wait before evaluating">
- <div className="space-y-1">
- <DurationPicker
- value={
- evaluation.target_config.window_seconds ??
- DEFAULT_TRACE_WINDOW_SECONDS
- }
- onChange={setTraceWindowSeconds}
- />
- <p className="text-muted text-xs">
- How long to wait after the first matching
- generation before pulling the whole trace
- (10s–2h). Captured when the run is scheduled —
- changing it won't affect trace runs already in
- flight.
- </p>
- </div>
- </Field>
- )}
- </>
- )}
+ )}
+ </>
+ )}
<Field name="description" label="Description (optional)">
<LemonTextArea
@@ -523,21 +500,21 @@ export function AIObservabilityEvaluation(): JSX.Element {
<div className="flex items-center gap-2">
<Tooltip
- title={effectiveCanEnableReason}
- visible={effectiveCanEnableReason ? undefined : false}
+ title={canEnableReason}
+ visible={canEnableReason ? undefined : false}
>
<span>
<LemonSwitch
checked={evaluation.enabled}
onChange={setEvaluationEnabled}
label="Enable evaluation"
- disabled={!effectiveCanEnable && !evaluation.enabled}
+ disabled={!canEnable && !evaluation.enabled}
/>
</span>
</Tooltip>
<span className="text-muted text-sm">
- {!effectiveCanEnable && !evaluation.enabled
- ? effectiveCanEnableReason
+ {!canEnable && !evaluation.enabled
+ ? canEnableReason
: evaluation.enabled
? 'This evaluation will run automatically based on triggers'
: 'This evaluation is paused and will not run'}
diff --git a/products/ai_observability/frontend/evaluations/AIObservabilityEvaluationsScene.tsx b/products/ai_observability/frontend/evaluations/AIObservabilityEvaluationsScene.tsx
index 4c6fce7daf44..f93ebcfcaae7 100644
--- a/products/ai_observability/frontend/evaluations/AIObservabilityEvaluationsScene.tsx
+++ b/products/ai_observability/frontend/evaluations/AIObservabilityEvaluationsScene.tsx
@@ -47,7 +47,7 @@ import {
PASS_RATE_WARNING_THRESHOLD,
} from './components/EvaluationMetrics'
import { OfflineEvaluationsTab } from './components/OfflineEvaluationsTab'
-import { evaluationTypeCanBeCreated, evaluationTypeUsesProviderKey } from './evaluationCapabilities'
+import { evaluationTypeUsesProviderKey } from './evaluationCapabilities'
import { EvaluationStats, evaluationMetricsLogic } from './evaluationMetricsLogic'
import { EvaluationTemplatesEmptyState } from './EvaluationTemplates'
import { llmEvaluationsLogic } from './llmEvaluationsLogic'
@@ -134,7 +134,6 @@ function AIObservabilityEvaluationsContent(): JSX.Element {
useActions(evaluationsLogic)
const { evaluationsWithMetrics } = useValues(metricsLogic)
const { currentTeamId } = useValues(teamLogic)
- const { featureFlags } = useValues(featureFlagLogic)
const { push } = useActions(router)
const { searchParams } = useValues(router)
const evaluationUrl = (id: string): string => combineUrl(urls.aiObservabilityEvaluation(id), searchParams).url
@@ -192,12 +191,9 @@ function AIObservabilityEvaluationsContent(): JSX.Element {
</Tooltip>
)
}
- const canUseEvaluationType = evaluationTypeCanBeCreated(evaluation.evaluation_type, featureFlags)
- const canEnable = canEnableEvaluation(evaluation) && (evaluation.enabled || canUseEvaluationType)
+ const canEnable = canEnableEvaluation(evaluation)
const isBlocked = !canEnable && !evaluation.enabled
- const blockedReason = !canUseEvaluationType
- ? 'Sentiment evaluations are not available for this project.'
- : 'Add a provider API key to enable this evaluation.'
+ const blockedReason = 'Add a provider API key to enable this evaluation.'
return (
<div className="flex items-center gap-2">
<AccessControlAction
diff --git a/products/ai_observability/frontend/evaluations/evaluationCapabilities.test.ts b/products/ai_observability/frontend/evaluations/evaluationCapabilities.test.ts
index a3212b521b1c..9a1cb917bac2 100644
--- a/products/ai_observability/frontend/evaluations/evaluationCapabilities.test.ts
+++ b/products/ai_observability/frontend/evaluations/evaluationCapabilities.test.ts
@@ -1,19 +1,6 @@
-import { FEATURE_FLAGS } from 'lib/constants'
-
-import { evaluationSupportsReports, evaluationTypeCanBeCreated } from './evaluationCapabilities'
+import { evaluationSupportsReports } from './evaluationCapabilities'
describe('evaluationCapabilities', () => {
- it('gates sentiment creation on the sentiment evaluations feature flag', () => {
- expect(evaluationTypeCanBeCreated('llm_judge', {})).toBe(true)
- expect(evaluationTypeCanBeCreated('hog', {})).toBe(true)
- expect(evaluationTypeCanBeCreated('sentiment', {})).toBe(false)
- expect(
- evaluationTypeCanBeCreated('sentiment', {
- [FEATURE_FLAGS.LLM_ANALYTICS_EVALUATIONS_SENTIMENT]: true,
- })
- ).toBe(true)
- })
-
it('supports reports only for boolean generation-target evaluations', () => {
expect(evaluationSupportsReports({ output_type: 'boolean', target: 'generation' })).toBe(true)
expect(evaluationSupportsReports({ output_type: 'boolean', target: 'trace' })).toBe(false)
diff --git a/products/ai_observability/frontend/evaluations/evaluationCapabilities.ts b/products/ai_observability/frontend/evaluations/evaluationCapabilities.ts
index df99df905d20..334d80ed36a2 100644
--- a/products/ai_observability/frontend/evaluations/evaluationCapabilities.ts
+++ b/products/ai_observability/frontend/evaluations/evaluationCapabilities.ts
@@ -1,6 +1,3 @@
-import { FEATURE_FLAGS } from 'lib/constants'
-import type { FeatureFlagsSet } from 'lib/logic/featureFlagLogic'
-
import type { EvaluationConfig, EvaluationOutputType, EvaluationType, LLMJudgeEvaluation } from './types'
export function isBooleanEvaluationOutput(outputType: EvaluationOutputType | null | undefined): boolean {
@@ -59,10 +56,3 @@ export function evaluationTypeHasEditableCriteria(evaluationType: EvaluationType
export function evaluationTypeSupportsSignalEmission(evaluationType: EvaluationType | null | undefined): boolean {
return evaluationType === 'llm_judge'
}
-
-export function evaluationTypeCanBeCreated(
- evaluationType: EvaluationType,
- featureFlags: FeatureFlagsSet | null | undefined
-): boolean {
- return evaluationType !== 'sentiment' || !!featureFlags?.[FEATURE_FLAGS.LLM_ANALYTICS_EVALUATIONS_SENTIMENT]
-}
diff --git a/products/ai_observability/frontend/evaluations/llmEvaluationsLogic.test.ts b/products/ai_observability/frontend/evaluations/llmEvaluationsLogic.test.ts
index b0289c8330de..075384f9dd29 100644
--- a/products/ai_observability/frontend/evaluations/llmEvaluationsLogic.test.ts
+++ b/products/ai_observability/frontend/evaluations/llmEvaluationsLogic.test.ts
@@ -1,8 +1,5 @@
import { expectLogic } from 'kea-test-utils'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-
import { useMocks } from '~/mocks/jest'
import { initKeaTests } from '~/test/init'
@@ -140,9 +137,6 @@ describe('llmEvaluationsLogic', () => {
describe('unhealthyProviderKeysUsedByEvaluations', () => {
it('allows Hog and sentiment evaluations when trial limit is reached', async () => {
- featureFlagLogic.actions.setFeatureFlags([FEATURE_FLAGS.LLM_ANALYTICS_EVALUATIONS_SENTIMENT], {
- [FEATURE_FLAGS.LLM_ANALYTICS_EVALUATIONS_SENTIMENT]: true,
- })
keysLogic.actions.loadEvaluationConfigSuccess({
trial_eval_limit: 100,
trial_evals_used: 100,
diff --git a/products/ai_observability/frontend/evaluations/llmEvaluationsLogic.ts b/products/ai_observability/frontend/evaluations/llmEvaluationsLogic.ts
index e5300e19a0ae..a3e52c3d369f 100644
--- a/products/ai_observability/frontend/evaluations/llmEvaluationsLogic.ts
+++ b/products/ai_observability/frontend/evaluations/llmEvaluationsLogic.ts
@@ -15,7 +15,7 @@ import { ProductIntentContext, ProductKey } from '~/queries/schema/schema-genera
import { LLMProviderKey, llmProviderKeysLogic } from '../settings/llmProviderKeysLogic'
import { getUnhealthyProviderKey } from '../settings/providerKeyStateUtils'
import { evaluationErrorMessage } from './apiErrors'
-import { evaluationCanResolveModel, evaluationTypeCanBeCreated } from './evaluationCapabilities'
+import { evaluationCanResolveModel } from './evaluationCapabilities'
import type { llmEvaluationsLogicType } from './llmEvaluationsLogicType'
import { EvaluationConfig } from './types'
@@ -193,10 +193,6 @@ export const llmEvaluationsLogic = kea<llmEvaluationsLogicType>([
if (!original) {
return
}
- if (!evaluationTypeCanBeCreated(original.evaluation_type, values.featureFlags)) {
- lemonToast.error('Sentiment evaluations are not available for this project.')
- return
- }
const duplicate = {
name: `${original.name} (Copy)`,
diff --git a/products/ai_observability/frontend/settings/parserRecipesLogic.test.ts b/products/ai_observability/frontend/settings/parserRecipesLogic.test.ts
index 7b7c58e60bd1..7ad31c637354 100644
--- a/products/ai_observability/frontend/settings/parserRecipesLogic.test.ts
+++ b/products/ai_observability/frontend/settings/parserRecipesLogic.test.ts
@@ -1,8 +1,5 @@
import { expectLogic } from 'kea-test-utils'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
-
import { initKeaTests } from '~/test/init'
import {
@@ -23,8 +20,6 @@ const mockList = llmAnalyticsParserRecipesList as jest.MockedFunction<typeof llm
const mockCreate = llmAnalyticsParserRecipesCreate as jest.MockedFunction<typeof llmAnalyticsParserRecipesCreate>
const mockDestroy = llmAnalyticsParserRecipesDestroy as jest.MockedFunction<typeof llmAnalyticsParserRecipesDestroy>
-const FLAG = FEATURE_FLAGS.LLM_ANALYTICS_CUSTOM_PARSERS
-
describe('parserRecipesLogic', () => {
let logic: ReturnType<typeof parserRecipesLogic.build>
@@ -32,25 +27,13 @@ describe('parserRecipesLogic', () => {
jest.clearAllMocks()
mockList.mockResolvedValue({ results: [] } as any)
initKeaTests()
- featureFlagLogic.mount()
})
afterEach(() => {
logic?.unmount()
})
- const enableFlag = (): void => featureFlagLogic.actions.setFeatureFlags([FLAG], { [FLAG]: true })
-
- it('does not fetch recipes while the feature flag is off', async () => {
- logic = parserRecipesLogic()
- logic.mount()
- await expectLogic(logic).toFinishAllListeners()
- expect(mockList).not.toHaveBeenCalled()
- expect(logic.values.storedRecipes).toEqual([])
- })
-
- it('fetches recipes when the flag is on and maps them for the list and the merge', async () => {
- enableFlag()
+ it('fetches recipes on mount and maps them for the list and the merge', async () => {
mockList.mockResolvedValue({ results: [{ id: 'r1', name: 'First', source: 'rules: []\n' }] } as any)
logic = parserRecipesLogic()
logic.mount()
@@ -61,7 +44,6 @@ describe('parserRecipesLogic', () => {
})
it('bumps recipesVersion every time loaded recipes are applied to the normalizer', async () => {
- enableFlag()
logic = parserRecipesLogic()
logic.mount()
await expectLogic(logic).toDispatchActions(['loadRecipesSuccess', 'recipesApplied'])
diff --git a/products/ai_observability/frontend/settings/parserRecipesLogic.ts b/products/ai_observability/frontend/settings/parserRecipesLogic.ts
index 1e05ef741941..08343aabecf7 100644
--- a/products/ai_observability/frontend/settings/parserRecipesLogic.ts
+++ b/products/ai_observability/frontend/settings/parserRecipesLogic.ts
@@ -5,8 +5,6 @@ import { parse as parseYaml } from 'yaml'
import { lemonToast } from '@posthog/lemon-ui'
-import { FEATURE_FLAGS } from 'lib/constants'
-import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { teamLogic } from 'scenes/teamLogic'
import {
@@ -44,13 +42,13 @@ export function sourceCompileError(source: string): string | null {
}
}
-// Owns the team's custom recipes end to end: loads them (flag-gated), pushes them into
-// the live trace-rendering normalizer, and backs the settings editor. Mounted on every
-// AI observability view via aiObservabilitySharedLogic so customizations apply even when
+// Owns the team's custom recipes end to end: loads them, pushes them into the live
+// trace-rendering normalizer, and backs the settings editor. Mounted on every AI
+// observability view via aiObservabilitySharedLogic so customizations apply even when
// the settings scene was never opened; the editor parts stay dormant outside settings.
export const parserRecipesLogic = kea<parserRecipesLogicType>([
path(['products', 'ai_observability', 'frontend', 'settings', 'parserRecipesLogic']),
- connect(() => ({ values: [teamLogic, ['currentTeamId'], featureFlagLogic, ['featureFlags']] })),
+ connect(() => ({ values: [teamLogic, ['currentTeamId']] })),
actions({
openEditorForNew: true,
openEditorForItem: (item: CustomRecipeItem) => ({ item }),
@@ -67,9 +65,6 @@ export const parserRecipesLogic = kea<parserRecipesLogicType>([
[] as ParserRecipeApi[],
{
loadRecipes: async () => {
- if (!values.featureFlags[FEATURE_FLAGS.LLM_ANALYTICS_CUSTOM_PARSERS]) {
- return []
- }
return (await llmAnalyticsParserRecipesList(String(values.currentTeamId), { limit: 1000 })).results
},
},
@@ -117,19 +112,12 @@ export const parserRecipesLogic = kea<parserRecipesLogicType>([
(s) => [s.editor],
(editor): string | null => (editor ? sourceCompileError(editor.source) : null),
],
- // The team whose recipes should be loaded, or null when the feature is off.
- // Re-fetches on team switch and when the flag flips on (see subscriptions).
- loadKey: [
- (s) => [s.currentTeamId, s.featureFlags],
- (currentTeamId, featureFlags): number | null =>
- featureFlags[FEATURE_FLAGS.LLM_ANALYTICS_CUSTOM_PARSERS] ? currentTeamId : null,
- ],
}),
subscriptions(({ actions }) => ({
// Fires on mount with the initial value, then on every change — so this covers
- // the first load, project switches, and the flag turning on.
- loadKey: (loadKey: number | null) => {
- if (loadKey !== null) {
+ // the first load and project switches.
+ currentTeamId: (currentTeamId: number | null) => {
+ if (currentTeamId !== null) {
actions.loadRecipes()
}
},
diff --git a/products/ai_observability/frontend/tabs/aiObservabilityTracesTabLogic.ts b/products/ai_observability/frontend/tabs/aiObservabilityTracesTabLogic.ts
index ff34572078f1..30ea83de76d3 100644
--- a/products/ai_observability/frontend/tabs/aiObservabilityTracesTabLogic.ts
+++ b/products/ai_observability/frontend/tabs/aiObservabilityTracesTabLogic.ts
@@ -129,9 +129,7 @@ export const aiObservabilityTracesTabLogic = kea<aiObservabilityTracesTabLogicTy
columns: [
'id',
'traceName',
- ...(featureFlags[FEATURE_FLAGS.LLM_OBSERVABILITY_SHOW_INPUT_OUTPUT] && showInputOutputColumns
- ? ['inputState', 'outputState']
- : []),
+ ...(showInputOutputColumns ? ['inputState', 'outputState'] : []),
'person',
...(showSentimentColumn ? ['__llm_sentiment'] : []),
'__llm_tools',