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.

fix(replay-vision): strip dead emits_embeddings from summarizer configs (#69865)

Tue Haulund5be6851cee23
diff --git a/products/replay_vision/backend/migrations/0041_strip_summarizer_emits_embeddings.py b/products/replay_vision/backend/migrations/0041_strip_summarizer_emits_embeddings.py
new file mode 100644
index 000000000000..b51b06eb6abb
--- /dev/null
+++ b/products/replay_vision/backend/migrations/0041_strip_summarizer_emits_embeddings.py
@@ -0,0 +1,25 @@
+from django.db import migrations
+
+
+def strip_emits_embeddings(apps, schema_editor):
+ # `emits_embeddings` was removed from the summarizer config when embeddings became always-on (#61284).
+ # Old rows still carry the dead key, which now fails save-time config validation. Idempotent — only rows
+ # that still have the key are loaded and rewritten.
+ ReplayScanner = apps.get_model("replay_vision", "ReplayScanner")
+ qs = ReplayScanner.objects.filter(
+ scanner_type="summarizer",
+ scanner_config__has_key="emits_embeddings",
+ ).iterator(chunk_size=500)
+ for scanner in qs:
+ scanner.scanner_config.pop("emits_embeddings", None)
+ scanner.save(update_fields=["scanner_config"])
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("replay_vision", "0040_replayobservation_rlo_team_in_flight_idx"),
+ ]
+
+ operations = [
+ migrations.RunPython(strip_emits_embeddings, reverse_code=migrations.RunPython.noop),
+ ]
diff --git a/products/replay_vision/backend/migrations/max_migration.txt b/products/replay_vision/backend/migrations/max_migration.txt
index 8f3654f9acb3..6eba70dd3626 100644
--- a/products/replay_vision/backend/migrations/max_migration.txt
+++ b/products/replay_vision/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0040_replayobservation_rlo_team_in_flight_idx
+0041_strip_summarizer_emits_embeddings