: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
fix(aio): remove the summarization model env lever (#94013)
Bernat Torres17484bc3a0b0
diff --git a/posthog/settings/temporal.py b/posthog/settings/temporal.pyindex 61da9f697da7..cb0e6f6498e0 100644--- a/posthog/settings/temporal.py+++ b/posthog/settings/temporal.py@@ -25,9 +25,6 @@ MAX_CONCURRENT_WORKFLOW_TASKS: int | None = get_from_env("MAX_CONCURRENT_WORKFLOW_TASKS", None, optional=True, type_cast=int)MAX_CONCURRENT_ACTIVITIES: int | None = get_from_env("MAX_CONCURRENT_ACTIVITIES", None, optional=True, type_cast=int)-# Batch trace summarization model; overridable so a fleet-wide model rollback is a config change-# plus a worker restart, not a deploy.-LLMA_SUMMARIZATION_MODEL: str = get_from_env("LLMA_SUMMARIZATION_MODEL", "gpt-5-nano")TARGET_MEMORY_USAGE: float | None = get_from_env("TARGET_MEMORY_USAGE", None, optional=True, type_cast=float)TARGET_CPU_USAGE: float | None = get_from_env("TARGET_CPU_USAGE", None, optional=True, type_cast=float)diff --git a/posthog/temporal/ai_observability/trace_summarization/constants.py b/posthog/temporal/ai_observability/trace_summarization/constants.pyindex 01c8d3951526..a68024b7af8d 100644--- a/posthog/temporal/ai_observability/trace_summarization/constants.py+++ b/posthog/temporal/ai_observability/trace_summarization/constants.py@@ -2,8 +2,6 @@from datetime import timedelta-from django.conf import settings-from temporalio.common import RetryPolicyfrom products.ai_observability.backend.summarization.models import OpenAIModel, SummarizationMode@@ -17,11 +15,12 @@ DEFAULT_TRACE_BATCH_SIZE = 6 # Traces processed in small parallel batchesDEFAULT_MODE = SummarizationMode.DETAILEDDEFAULT_WINDOW_MINUTES = 60 # Process traces from last N minutes (matches schedule frequency)DEFAULT_WINDOW_OFFSET_MINUTES = 30 # Offset window into the past so traces have time to fully complete-# parse() fails the worker at boot on a value outside OpenAIModel, naming the valid models,-# instead of failing every summary at runtime. It cannot check the other constraint: the value-# must also be on the Python gateway's llma_summarization allowlist-# (services/llm-gateway/src/llm_gateway/products/config.py), or the fallback path 403s.-DEFAULT_MODEL = OpenAIModel.parse(settings.LLMA_SUMMARIZATION_MODEL)+# Not env-configurable: the coordinator schedule bakes this value into its stored input in+# whatever process re-creates it, so an env override would govern only part of the traffic.+# Changing the model is a deploy, and the value must also be on the Python gateway's+# llma_summarization allowlist (services/llm-gateway/src/llm_gateway/products/config.py),+# or the fallback path 403s.+DEFAULT_MODEL = OpenAIModel.GPT_5_NANO# Max estimated raw trace size (in characters) before formatting.# Traces exceeding this are skipped — formatting huge traces is CPU-intensive