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(slack-app): remove rolled-out flags and drained patch markers (#120888)

Vojta Bartoš892acb5b8d13
diff --git a/products/slack_app/backend/api.py b/products/slack_app/backend/api.py
index 9112dcff11c3..038af90598d1 100644
--- a/products/slack_app/backend/api.py
+++ b/products/slack_app/backend/api.py
@@ -50,7 +50,6 @@ from products.slack_app.backend.feature_flags import (
ASSISTANT_REQUIRED_SCOPES,
is_slack_app_assistant_enabled,
is_slack_app_oauth_enabled,
- is_slack_app_project_picker_enabled,
is_slack_app_unprompted_answers_enabled,
)
from products.slack_app.backend.helpers import local_dev_slack_email
@@ -1900,7 +1899,6 @@ def _post_project_picker(
event: dict[str, Any],
event_id: str | None,
*,
- posthog_user: User,
is_ext_shared_channel: bool,
mention_is_threaded: bool,
) -> bool:
@@ -1911,9 +1909,6 @@ def _post_project_picker(
message_ts = event.get("ts")
if not isinstance(slack_user_id, str) or not isinstance(channel, str) or not isinstance(message_ts, str):
return False
- if not is_slack_app_project_picker_enabled(probe, posthog_user.distinct_id):
- return False
-
context_token = uuid.uuid4().hex
cache.set(
_picker_context_cache_key(context_token),
@@ -3097,7 +3092,6 @@ def route_posthog_code_event_to_relevant_region(
candidates,
event,
event_id,
- posthog_user=posthog_user,
is_ext_shared_channel=is_ext_shared_channel,
mention_is_threaded=mention_is_threaded,
)
diff --git a/products/slack_app/backend/feature_flags.py b/products/slack_app/backend/feature_flags.py
index 9ed198f65b4d..cdab445df32a 100644
--- a/products/slack_app/backend/feature_flags.py
+++ b/products/slack_app/backend/feature_flags.py
@@ -47,8 +47,6 @@ logger = structlog.get_logger(__name__)
SLACK_APP_AGENT_DESIGN_FLAG = "slack-app-agent-design"
SLACK_APP_FORKING_FLAG = "slack-app-forking"
-SLACK_APP_PROJECT_PICKER_FLAG = "slack-app-project-picker"
-SLACK_APP_REPLY_SUGGESTIONS_FLAG = "slack-app-reply-suggestions"
SLACK_APP_UNPROMPTED_ANSWERS_FLAG = "slack-app-unprompted-answers"
@@ -128,25 +126,6 @@ def is_slack_app_agent_design_enabled(integration: Integration, distinct_id: str
)
-def is_slack_app_project_picker_enabled(integration: Integration, distinct_id: str | None = None) -> bool:
- """Gate for the in-thread project picker. With the gate closed, a mention that could go
- to more than one project gets the text hint."""
- return _workspace_flag_enabled(
- SLACK_APP_PROJECT_PICKER_FLAG,
- integration,
- failure_log_key="slack_app_project_picker_feature_flag_check_failed",
- distinct_id=distinct_id,
- )
-
-
-def is_slack_app_reply_suggestions_enabled(integration: Integration) -> bool:
- return _workspace_flag_enabled(
- SLACK_APP_REPLY_SUGGESTIONS_FLAG,
- integration,
- failure_log_key="slack_app_reply_suggestions_feature_flag_check_failed",
- )
-
-
def is_slack_app_unprompted_answers_enabled(integration: Integration) -> bool:
"""Gate for answering top-level channel messages nobody tagged the app in.
diff --git a/products/slack_app/backend/slack_thread.py b/products/slack_app/backend/slack_thread.py
index 0e0ef47e7d9b..f59de50935de 100644
--- a/products/slack_app/backend/slack_thread.py
+++ b/products/slack_app/backend/slack_thread.py
@@ -15,10 +15,7 @@ from posthog.models.integration import Integration, SlackIntegration
from posthog.slack.markdown import SLACK_MARKDOWN_TEXT_MAX_LEN, slack_markdown_block
from products.slack_app.backend.analytics import capture_slack_event, slack_session_id
-from products.slack_app.backend.feature_flags import (
- is_slack_app_forking_enabled,
- is_slack_app_reply_suggestions_enabled,
-)
+from products.slack_app.backend.feature_flags import is_slack_app_forking_enabled
from products.slack_app.backend.logic.reply_suggestions import (
ReplySuggestionAttribution,
SuggestedReply,
@@ -1003,8 +1000,6 @@ class SlackThreadHandler:
def _suggestions_block(self, answer_markdown: str) -> tuple[list[SuggestedReply], dict[str, Any]] | None:
integration = self._get_integration()
- if not is_slack_app_reply_suggestions_enabled(integration):
- return None
posthog_user = self._actor_posthog_user
attribution = ReplySuggestionAttribution(
trace_id=self.turn_trace_id,
diff --git a/products/slack_app/backend/temporal/slack_app_mention.py b/products/slack_app/backend/temporal/slack_app_mention.py
index afbde9ee9c78..4f4de71f8cb9 100644
--- a/products/slack_app/backend/temporal/slack_app_mention.py
+++ b/products/slack_app/backend/temporal/slack_app_mention.py
@@ -23,8 +23,6 @@ from products.slack_app.backend.temporal.types import (
)
SLACK_APP_MENTION_IDLE_TIMEOUT_SECONDS = 30
-# The legacy child workflow ID branch is gone. deprecate_patch keeps runs that recorded the marker replayable.
-_PATCH_ID_MENTION_PROCESSING_ID_RENAME = "slack-app-mention-processing-id-rename-2026-10"
# Dedup keys carried across continue_as_new. Bounded so the carry-over payload
# stays small; old keys only matter for Slack retries, which arrive within
# minutes of the original event.
@@ -178,7 +176,6 @@ class SlackAppMentionWorkflow(PostHogWorkflow):
ALLOW_DUPLICATE mirrors the standalone dispatch's reuse policy for
retries that outlive this instance's dedup keys.
"""
- workflow.deprecate_patch(_PATCH_ID_MENTION_PROCESSING_ID_RENAME)
child_id = derive_mention_workflow_id(message)
try:
# The default parent close policy (terminate) is deliberate: an
diff --git a/products/slack_app/backend/temporal/slack_app_mention_processing.py b/products/slack_app/backend/temporal/slack_app_mention_processing.py
index 74b239982489..f09c2a7abb9a 100644
--- a/products/slack_app/backend/temporal/slack_app_mention_processing.py
+++ b/products/slack_app/backend/temporal/slack_app_mention_processing.py
@@ -45,16 +45,6 @@ if TYPE_CHECKING:
POSTHOG_CODE_SLACK_MENTION_TIMEOUT_SECONDS = 10 * 60
POSTHOG_CODE_SLACK_PICKER_TIMEOUT_MINUTES = 15
-# Temporal patch IDs — arbitrary strings recorded in workflow history. These gates have
-# drained: this workflow's longest wait is the 15-minute repo picker, and it is bounded
-# at an hour as a child of the queue workflow, so the pre-patch histories are gone within
-# hours of a deploy. The old branches are gone and only `deprecate_patch` remains, keeping the
-# recorded markers compatible for executions in flight across the deploy that removes the
-# branches. Standard two-step Temporal patch lifecycle: the calls come out once the
-# histories that recorded a plain marker have drained as well.
-_PATCH_ID_PARALLEL_PREWORK = "slack-app-parallel-prework-v1"
-_PATCH_ID_REPO_SELECTION_USAGE_LIMIT = "slack-app-repo-selection-usage-limit-v1"
-
@workflow.defn(name="slack-app-mention-processing")
class SlackAppMentionProcessingWorkflow(PostHogWorkflow):
@@ -121,7 +111,6 @@ class SlackAppMentionProcessingWorkflow(PostHogWorkflow):
return
silent_on_error = False
- workflow.deprecate_patch(_PATCH_ID_PARALLEL_PREWORK)
prework = await _prework_in_parallel(inputs, channel, thread_ts, slack_user_id)
if prework is None:
return
@@ -183,7 +172,6 @@ class SlackAppMentionProcessingWorkflow(PostHogWorkflow):
elif outcome.status == "no_match":
repository = None
else:
- workflow.deprecate_patch(_PATCH_ID_REPO_SELECTION_USAGE_LIMIT)
if outcome.usage_limited:
# The activity told the thread the team is out of credits. A picked repo would fail the same way.
return
diff --git a/products/slack_app/backend/temporal/tests/test_slack_app_mention_processing_workflow.py b/products/slack_app/backend/temporal/tests/test_slack_app_mention_processing_workflow.py
index 18577fcec002..5d0c7fde18fe 100644
--- a/products/slack_app/backend/temporal/tests/test_slack_app_mention_processing_workflow.py
+++ b/products/slack_app/backend/temporal/tests/test_slack_app_mention_processing_workflow.py
@@ -53,9 +53,8 @@ async def test_untagged_followup_with_files_classifier_gating(text: str, expecte
raise AssertionError(f"unexpected activity: {activity_fn.__name__}")
- with (
- patch.object(slack_app_mention_processing, "_execute_posthog_code_activity", side_effect=fake_execute_activity),
- patch.object(slack_app_mention_processing.workflow, "deprecate_patch"),
+ with patch.object(
+ slack_app_mention_processing, "_execute_posthog_code_activity", side_effect=fake_execute_activity
):
await workflow.run(inputs)
@@ -87,9 +86,8 @@ async def test_confirmed_untagged_followup_skips_the_classifier_and_the_prompt()
return True
raise AssertionError(f"unexpected activity: {activity_fn.__name__}")
- with (
- patch.object(slack_app_mention_processing, "_execute_posthog_code_activity", side_effect=fake_execute_activity),
- patch.object(slack_app_mention_processing.workflow, "deprecate_patch"),
+ with patch.object(
+ slack_app_mention_processing, "_execute_posthog_code_activity", side_effect=fake_execute_activity
):
await workflow.run(inputs)
diff --git a/products/slack_app/backend/tests/test_feature_flags.py b/products/slack_app/backend/tests/test_feature_flags.py
index 083f3d202292..3aec5f884e23 100644
--- a/products/slack_app/backend/tests/test_feature_flags.py
+++ b/products/slack_app/backend/tests/test_feature_flags.py
@@ -34,8 +34,8 @@ def test_gate_stays_closed_when_a_required_scope_is_missing(workspace_integratio
@pytest.mark.parametrize(
"gate",
- [feature_flags.is_slack_app_agent_design_enabled, feature_flags.is_slack_app_project_picker_enabled],
- ids=["agent design", "project picker"],
+ [feature_flags.is_slack_app_agent_design_enabled],
+ ids=["agent design"],
)
@pytest.mark.parametrize(
("distinct_id", "expected_identity"),
diff --git a/products/slack_app/backend/tests/test_project_picker_flow.py b/products/slack_app/backend/tests/test_project_picker_flow.py
index 38b88aa21587..5d969a966f61 100644
--- a/products/slack_app/backend/tests/test_project_picker_flow.py
+++ b/products/slack_app/backend/tests/test_project_picker_flow.py
@@ -80,14 +80,11 @@ class TestProjectPickerFlow(TestCase):
return integration
@override_settings(DEBUG=False, CLOUD_DEPLOYMENT="US")
- def _mention(
- self, *, picker_enabled: bool = True, post_fails: bool = False, is_ext_shared_channel: bool = False
- ) -> dict[str, Any]:
+ def _mention(self, *, post_fails: bool = False, is_ext_shared_channel: bool = False) -> dict[str, Any]:
from products.slack_app.backend.api import route_posthog_code_event_to_relevant_region
request = RequestFactory().post("/slack/event-callback/", HTTP_HOST="us.posthog.com")
with (
- patch("products.slack_app.backend.api.is_slack_app_project_picker_enabled", return_value=picker_enabled),
patch(
"products.slack_app.backend.api.post_slack_ephemeral",
side_effect=RuntimeError("slack is down") if post_fails else None,
@@ -142,15 +139,12 @@ class TestProjectPickerFlow(TestCase):
@parameterized.expand(
[
- ("picker_on", True, False, True),
- ("picker_off", False, False, False),
- ("picker_fails_to_post", True, True, False),
+ ("picker_posted", False, True),
+ ("picker_fails_to_post", True, False),
]
)
- def test_mention_with_several_projects_gets_the_picker_or_the_hint(
- self, _name, picker_enabled, post_fails, expect_picker
- ):
- outcome = self._mention(picker_enabled=picker_enabled, post_fails=post_fails)
+ def test_mention_with_several_projects_gets_the_picker_or_the_hint(self, _name, post_fails, expect_picker):
+ outcome = self._mention(post_fails=post_fails)
assert outcome["hint_posted"] is not expect_picker
assert outcome["drop"]["drop_reason"] == "multiple_projects"
diff --git a/products/slack_app/backend/tests/test_reply_suggestions.py b/products/slack_app/backend/tests/test_reply_suggestions.py
index bbbfe000a568..bae786616bfe 100644
--- a/products/slack_app/backend/tests/test_reply_suggestions.py
+++ b/products/slack_app/backend/tests/test_reply_suggestions.py
@@ -275,12 +275,11 @@ class TestReplySuggestionPlacement(SimpleTestCase):
@patch("products.slack_app.backend.slack_thread.capture_slack_event")
@patch("products.slack_app.backend.slack_thread.suggest_replies", return_value=[OPEN_PR])
- @patch("products.slack_app.backend.slack_thread.is_slack_app_reply_suggestions_enabled", return_value=True)
@patch.object(SlackThreadHandler, "_actor_posthog_user", None)
@patch.object(SlackThreadHandler, "_get_integration")
@patch.object(SlackThreadHandler, "_get_client")
def test_plain_answer_gets_the_buttons_under_its_text(
- self, mock_get_client, mock_get_integration, _mock_enabled, mock_suggest, _mock_capture
+ self, mock_get_client, mock_get_integration, mock_suggest, _mock_capture
) -> None:
mock_client = MagicMock()
mock_client.chat_postMessage.return_value = {"ts": "2.0"}