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(integrations): remove unused slack-posthog-code integration kind (#61174)

Vojta Bartoš69d08c0f4f6b
diff --git a/docs/internal/slack-local-setup-guide.md b/docs/internal/slack-local-setup-guide.md
index 1a7834ae67fd..1c3f619f7746 100644
--- a/docs/internal/slack-local-setup-guide.md
+++ b/docs/internal/slack-local-setup-guide.md
@@ -98,7 +98,6 @@ features:
always_online: true
oauth_config:
redirect_urls:
- # Path is `slack`, not `slack-posthog-code` (PostHog Code piggybacks on it).
- https://<you>-posthog.ngrok.dev/integrations/slack/callback
scopes:
bot:
@@ -133,19 +132,21 @@ Django must be up at that moment.
## Step 3 — backend credentials and `SITE_URL`
-Add the three app credentials to `.env` and restart the `django` + `temporal-django-worker`
-processes so it reloads:
+PostHog Code reuses the regular Slack notifications app, so set the standard
+`SLACK_APP_*` credentials in `.env` and restart the `django` +
+`temporal-django-worker` processes so it reloads. These are dynamic settings
+seeded from the env on boot (`posthog/settings/dynamic_settings.py`):
```bash
-SLACK_POSTHOG_CODE_CLIENT_ID=<client id>
-SLACK_POSTHOG_CODE_CLIENT_SECRET=<client secret>
-SLACK_POSTHOG_CODE_SIGNING_SECRET=<signing secret>
+SLACK_APP_CLIENT_ID=<client id>
+SLACK_APP_CLIENT_SECRET=<client secret>
+SLACK_APP_SIGNING_SECRET=<signing secret>
```
Confirm the backend picked them up:
```bash
-curl -sS https://<you>-posthog.ngrok.dev/_preflight | jq '.posthog_code_slack_service'
+curl -sS https://<you>-posthog.ngrok.dev/_preflight | jq '.slack_service'
# => { "available": true, "client_id": "...." }
```
@@ -167,37 +168,34 @@ Put it in `.env` instead if you want it to survive restarts from a fresh shell.
## Step 4 — feature flags
-Two flags gate the flow: `tasks` (shows the PostHog Code settings page and the Tasks UI) and
-`posthog-code-slack-availability` (enables the Slack connect button and lets the mention webhook
-proceed). Both are active flags in `frontend/src/lib/constants.tsx`, so the normal local sync
-enables both at 100%:
+One flag gates the UI: `tasks` (shows the Tasks scene and gates task creation —
+`products/tasks/backend/access.py`). It's an active flag in
+`frontend/src/lib/constants.tsx`, so the normal local sync enables it at 100%:
```bash
python manage.py sync_feature_flags
```
-If you already sync flags the usual way locally, they're likely on already — nothing to do.
-(`setup_background_agents` also turns on `tasks` as part of the sandbox setup.)
+If you already sync flags the usual way locally, it's likely on already — nothing to do.
+(`setup_background_agents` also turns on `tasks` as part of the sandbox setup.) The
+Slack mention webhook itself is not flag-gated — once the `slack` integration is
+connected, `@PostHog` events reach the agent unconditionally.
## Step 5 — connect the integrations
-**Slack (PostHog Code).** This has its own settings page, separate from the regular Slack
-notifications integration: **Settings → PostHog Code → Slack integration**, i.e.
-`https://<you>-posthog.ngrok.dev/project/<id>/settings/environment-posthog-code`. The page only
-shows when `tasks` is on, and the **Add to Slack** button only enables when
-`posthog-code-slack-availability` is on and the backend creds are present (hard-refresh if you
-just changed either).
-
-Click **Add to Slack** → authorize in your dev workspace → you bounce back to PostHog. This
-creates an `Integration` row of kind `slack-posthog-code` (distinct from the `slack`
-notifications kind). Verify:
+**Slack.** PostHog Code piggybacks on the regular Slack notifications install — there's no
+separate "PostHog Code Slack" install anymore. Go to **Settings → Project → Integrations**,
+find Slack, click **Connect to Slack**, and authorize in your dev workspace. The PostHog Code
+agent reads the same `Integration` row that the notifications product writes. Verify:
```bash
python manage.py shell -c "from posthog.models.integration import Integration; \
-print(list(Integration.objects.filter(kind='slack-posthog-code').values('id','team_id','integration_id')))"
+print(list(Integration.objects.filter(kind='slack').values('id','team_id','integration_id')))"
# => [{'id': ..., 'team_id': 1, 'integration_id': 'T0........'}]
```
+The `tasks` flag from Step 4 still gates the Tasks UI on top of the connected integration.
+
**GitHub** (Settings → Integrations): connect a _team_ GitHub with at least one repo (otherwise
the repo cascade has nothing to pick and creates a no-repo task), and connect your _personal_
GitHub under User → Personal integrations (otherwise the task parks behind a "Connect GitHub"
@@ -244,9 +242,9 @@ should react 👀 → 🦔 (or ❌ if the sandbox is gone). Expected from the co
The walls we actually hit and fixed:
-| Symptom | Cause / fix |
-| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `curl /_preflight` returns `200` with an empty body, `server: Caddy` | The tunnel reaches Caddy but isn't sending `Host: localhost`, so Caddy doesn't match its site block. Add `host_header: localhost` to the tunnel. |
-| OAuth → browser `ERR_SSL_PROTOCOL_ERROR` on `localhost:8010` | `SITE_URL` is still the localhost default. Point it at your https tunnel and restart django (Step 3). |
-| OAuth → "redirect_uri did not match any configured URIs" | The Slack app's **Redirect URLs** must include `https://<tunnel>/integrations/slack/callback` (note: `slack`, not `slack-posthog-code`) — add it **and click Save URLs**. |
-| Manifest won't save: "link_shared is missing scope links:read" | Remove `link_shared` from `bot_events` (Step 2). |
+| Symptom | Cause / fix |
+| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `curl /_preflight` returns `200` with an empty body, `server: Caddy` | The tunnel reaches Caddy but isn't sending `Host: localhost`, so Caddy doesn't match its site block. Add `host_header: localhost` to the tunnel. |
+| OAuth → browser `ERR_SSL_PROTOCOL_ERROR` on `localhost:8010` | `SITE_URL` is still the localhost default. Point it at your https tunnel and restart django (Step 3). |
+| OAuth → "redirect_uri did not match any configured URIs" | The Slack app's **Redirect URLs** must include `https://<tunnel>/integrations/slack/callback` — add it **and click Save URLs**. |
+| Manifest won't save: "link_shared is missing scope links:read" | Remove `link_shared` from `bot_events` (Step 2). |
diff --git a/frontend/src/lib/components/MarkdownEditor/inline/inlineMarkdownSlashCommands.test.tsx b/frontend/src/lib/components/MarkdownEditor/inline/inlineMarkdownSlashCommands.test.tsx
index 76f956e0f6d5..45b88c8f7bd7 100644
--- a/frontend/src/lib/components/MarkdownEditor/inline/inlineMarkdownSlashCommands.test.tsx
+++ b/frontend/src/lib/components/MarkdownEditor/inline/inlineMarkdownSlashCommands.test.tsx
@@ -32,7 +32,6 @@ const PREFLIGHT_WITH_OBJECT_STORAGE = {
available_social_auth_providers: {},
email_service_available: false,
slack_service: { available: false },
- posthog_code_slack_service: { available: false },
data_warehouse_integrations: { hubspot: {}, salesforce: {} },
object_storage: true,
} satisfies PreflightStatus
diff --git a/frontend/src/lib/integrations/integrationsLogic.ts b/frontend/src/lib/integrations/integrationsLogic.ts
index 238e9505297f..9c14170ddd71 100644
--- a/frontend/src/lib/integrations/integrationsLogic.ts
+++ b/frontend/src/lib/integrations/integrationsLogic.ts
@@ -282,10 +282,8 @@ export const integrationsLogic = kea<integrationsLogicType>([
},
handleOauthCallback: async ({ kind, searchParams }) => {
const { state, code, error, stripe_user_id, account_id, user_id } = searchParams
- const { next, token, source, server_id, kind: stateKind } = fromParamsGivenUrl(state)
- // slack-posthog-code reuses /integrations/slack/callback as its approved redirect URI,
- // so the real kind is carried in OAuth state and takes precedence over the URL path.
- const resolvedKind = (stateKind as IntegrationKind) || kind
+ const { next, token, source, server_id } = fromParamsGivenUrl(state)
+ const resolvedKind = kind
let replaceUrl: string = next || urls.settings('project-integrations')
if (error) {
diff --git a/frontend/src/lib/integrations/utils.ts b/frontend/src/lib/integrations/utils.ts
index 479c6d131f50..8373b0385343 100644
--- a/frontend/src/lib/integrations/utils.ts
+++ b/frontend/src/lib/integrations/utils.ts
@@ -33,7 +33,6 @@ import IconVercel from 'public/services/vercel.png'
export const ICONS: Record<IntegrationKind, any> = {
slack: IconSlack,
- 'slack-posthog-code': IconSlack,
salesforce: IconSalesforce,
hubspot: IconHubspot,
'google-pubsub': IconGoogleCloud,
@@ -68,8 +67,6 @@ export const ICONS: Record<IntegrationKind, any> = {
export const getIntegrationNameFromKind = (kind: string): string => {
switch (kind) {
- case 'slack-posthog-code':
- return 'PostHog Code (Slack)'
case 'google-pubsub':
return 'Google Cloud Pub/Sub'
case 'google-cloud-storage':
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json
index 2c3636734aec..fdfc63aba369 100644
--- a/frontend/src/queries/schema.json
+++ b/frontend/src/queries/schema.json
@@ -23425,7 +23425,6 @@
"IntegrationKind": {
"enum": [
"slack",
- "slack-posthog-code",
"salesforce",
"hubspot",
"google-pubsub",
diff --git a/frontend/src/scenes/settings/SettingsMap.tsx b/frontend/src/scenes/settings/SettingsMap.tsx
index 16a25cfc934b..2e10e327a735 100644
--- a/frontend/src/scenes/settings/SettingsMap.tsx
+++ b/frontend/src/scenes/settings/SettingsMap.tsx
@@ -1383,7 +1383,7 @@ export const SETTINGS_MAP: SettingSection[] = [
id: 'integration-other',
title: 'Other integrations',
description: 'Browse and manage additional third-party integrations.',
- component: <IntegrationsList omitKinds={['slack', 'slack-posthog-code', 'github', 'linear']} />,
+ component: <IntegrationsList omitKinds={['slack', 'github', 'linear']} />,
keywords: ['integration', 'connect', 'third-party', 'app'],
},
{
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index d0b00e02b852..9fed194ef31d 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -4340,10 +4340,6 @@ export interface PreflightStatus {
available: boolean
client_id?: string
}
- posthog_code_slack_service: {
- available: boolean
- client_id?: string
- }
data_warehouse_integrations: {
hubspot: {
client_id?: string
@@ -5154,7 +5150,6 @@ export enum EventDefinitionType {
export const INTEGRATION_KINDS = [
'slack',
- 'slack-posthog-code',
'salesforce',
'hubspot',
'google-pubsub',
diff --git a/posthog/api/integration.py b/posthog/api/integration.py
index edc08720e9ae..82d4421f34b4 100644
--- a/posthog/api/integration.py
+++ b/posthog/api/integration.py
@@ -303,6 +303,11 @@ class IntegrationSerializer(serializers.ModelSerializer, UserAccessControlSerial
fields = ["id", "kind", "config", "created_at", "created_by", "errors", "display_name"]
read_only_fields = ["id", "created_at", "created_by", "errors", "display_name"]
+ def validate_kind(self, value: str) -> str:
+ if value == Integration.IntegrationKind.SLACK_POSTHOG_CODE.value:
+ raise ValidationError("This integration kind is deprecated and can no longer be created.")
+ return value
+
def create(self, validated_data: Any) -> Any:
request = self.context["request"]
team_id = self.context["team_id"]
diff --git a/posthog/api/test/test_integration.py b/posthog/api/test/test_integration.py
index ea01ff01ba98..e806c7b5fc8f 100644
--- a/posthog/api/test/test_integration.py
+++ b/posthog/api/test/test_integration.py
@@ -16,7 +16,7 @@ from django.utils import timezone
from parameterized import parameterized
from rest_framework import status
-from posthog.api.integration import IntegrationViewSet
+from posthog.api.integration import IntegrationSerializer, IntegrationViewSet
from posthog.api.oauth.test_dcr import generate_rsa_key
from posthog.models.integration import (
ERROR_TOKEN_REFRESH_FAILED,
@@ -1012,7 +1012,6 @@ class TestIntegrationAPIKeyAccess:
"kind,scope,expected_status,expected_detail_substring",
[
("slack", "integration:read", status.HTTP_200_OK, None),
- ("slack-posthog-code", "integration:read", status.HTTP_200_OK, None),
("slack", "feature_flag:read", status.HTTP_403_FORBIDDEN, "integration:read"),
# GitHub and Twilio resolve via the queryset, but the channels action's kind
# guard rejects them with a 400 before SlackIntegration is constructed.
@@ -3204,3 +3203,40 @@ class TestAnthropicIntegration:
body = response.json()
assert body["vaults"] == [{"id": "vault_1", "display_name": "Customer secrets"}]
assert body["has_more"] is False
+
+
+class TestSlackPostHogCodeKindDeprecated:
+ @pytest.fixture(autouse=True)
+ def setup_environment(self, db):
+ self.organization = Organization.objects.create(name="Test Org")
+ self.team = Team.objects.create(organization=self.organization, name="Test Team")
+ self.user = User.objects.create_and_join(
+ self.organization, "[email protected]", "test", level=OrganizationMembership.Level.ADMIN
+ )
+
+ def test_create_slack_posthog_code_integration_rejected(self, client: HttpClient):
+ client.force_login(self.user)
+
+ response = client.post(
+ f"/api/environments/{self.team.pk}/integrations/",
+ {"kind": "slack-posthog-code", "config": {}},
+ content_type="application/json",
+ )
+
+ assert response.status_code == status.HTTP_400_BAD_REQUEST
+ assert "deprecated" in json.dumps(response.json()).lower()
+ assert not Integration.objects.filter(team=self.team, kind="slack-posthog-code").exists()
+
+ def test_validate_kind_rejects_slack_posthog_code(self):
+ serializer = IntegrationSerializer(data={"kind": "slack-posthog-code", "config": {}})
+
+ assert not serializer.is_valid()
+ assert "kind" in serializer.errors
+ assert "deprecated" in str(serializer.errors["kind"]).lower()
+
+ def test_validate_kind_accepts_other_kinds(self):
+ # Sanity check — the validator must not reject unrelated kinds.
+ serializer = IntegrationSerializer(data={"kind": "slack", "config": {}})
+
+ serializer.is_valid()
+ assert "kind" not in serializer.errors
diff --git a/posthog/api/test/test_preflight.py b/posthog/api/test/test_preflight.py
index 274e4110cb5f..f089e37055f8 100644
--- a/posthog/api/test/test_preflight.py
+++ b/posthog/api/test/test_preflight.py
@@ -50,7 +50,6 @@ class TestPreflight(APIBaseTest, QueryMatchingTest):
"can_create_org": False,
"email_service_available": False,
"slack_service": {"available": False, "client_id": None},
- "posthog_code_slack_service": {"available": False, "client_id": None},
"object_storage": False,
"public_egress_ip_addresses": [],
**options,
@@ -84,9 +83,6 @@ class TestPreflight(APIBaseTest, QueryMatchingTest):
with self.is_cloud(False):
with self.settings(
OBJECT_STORAGE_ENABLED=False,
- SLACK_POSTHOG_CODE_CLIENT_ID="",
- SLACK_POSTHOG_CODE_CLIENT_SECRET="",
- SLACK_POSTHOG_CODE_SIGNING_SECRET="",
):
response = self.client.get("/_preflight/")
@@ -98,9 +94,6 @@ class TestPreflight(APIBaseTest, QueryMatchingTest):
with self.settings(
INSTANCE_PREFERENCES=self.instance_preferences(debug_queries=True),
OBJECT_STORAGE_ENABLED=False,
- SLACK_POSTHOG_CODE_CLIENT_ID="",
- SLACK_POSTHOG_CODE_CLIENT_SECRET="",
- SLACK_POSTHOG_CODE_SIGNING_SECRET="",
):
response = self.client.get("/_preflight/")
assert response.status_code == status.HTTP_200_OK
@@ -118,9 +111,6 @@ class TestPreflight(APIBaseTest, QueryMatchingTest):
with self.settings(
INSTANCE_PREFERENCES=self.instance_preferences(debug_queries=True),
OBJECT_STORAGE_ENABLED=True,
- SLACK_POSTHOG_CODE_CLIENT_ID="",
- SLACK_POSTHOG_CODE_CLIENT_SECRET="",
- SLACK_POSTHOG_CODE_SIGNING_SECRET="",
):
response = self.client.get("/_preflight/")
assert response.status_code == status.HTTP_200_OK
@@ -140,9 +130,6 @@ class TestPreflight(APIBaseTest, QueryMatchingTest):
with self.is_cloud(True):
with self.settings(
OBJECT_STORAGE_ENABLED=False,
- SLACK_POSTHOG_CODE_CLIENT_ID="",
- SLACK_POSTHOG_CODE_CLIENT_SECRET="",
- SLACK_POSTHOG_CODE_SIGNING_SECRET="",
):
response = self.client.get("/_preflight/")
assert response.status_code == status.HTTP_200_OK
@@ -168,9 +155,6 @@ class TestPreflight(APIBaseTest, QueryMatchingTest):
with self.settings(
SITE_URL="https://app.posthog.com",
OBJECT_STORAGE_ENABLED=False,
- SLACK_POSTHOG_CODE_CLIENT_ID="",
- SLACK_POSTHOG_CODE_CLIENT_SECRET="",
- SLACK_POSTHOG_CODE_SIGNING_SECRET="",
):
response = self.client.get("/_preflight/")
assert response.status_code == status.HTTP_200_OK
@@ -214,9 +198,6 @@ class TestPreflight(APIBaseTest, QueryMatchingTest):
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET="test_secret",
INSTANCE_PREFERENCES=self.instance_preferences(disable_paid_fs=True),
OBJECT_STORAGE_ENABLED=False,
- SLACK_POSTHOG_CODE_CLIENT_ID="",
- SLACK_POSTHOG_CODE_CLIENT_SECRET="",
- SLACK_POSTHOG_CODE_SIGNING_SECRET="",
):
response = self.client.get("/_preflight/")
assert response.status_code == status.HTTP_200_OK
@@ -252,9 +233,6 @@ class TestPreflight(APIBaseTest, QueryMatchingTest):
with self.settings(
DEMO=True,
OBJECT_STORAGE_ENABLED=False,
- SLACK_POSTHOG_CODE_CLIENT_ID="",
- SLACK_POSTHOG_CODE_CLIENT_SECRET="",
- SLACK_POSTHOG_CODE_SIGNING_SECRET="",
):
response = self.client.get("/_preflight/")
@@ -330,19 +308,6 @@ class TestPreflight(APIBaseTest, QueryMatchingTest):
assert response.json()["realm"] == "hosted-clickhouse"
assert response.json()["cloud"] is False
- def test_posthog_code_slack_service_available_when_configured(self):
- with self.settings(
- SLACK_POSTHOG_CODE_CLIENT_ID="client-id",
- SLACK_POSTHOG_CODE_CLIENT_SECRET="client-secret",
- SLACK_POSTHOG_CODE_SIGNING_SECRET="signing-secret",
- ):
- response = self.client.get("/_preflight/")
- assert response.status_code == status.HTTP_200_OK
- assert response.json()["posthog_code_slack_service"] == {
- "available": True,
- "client_id": "client-id",
- }
-
@override_settings(DEBUG=True, ALLOW_DEV_LOGIN=True)
def test_preflight_includes_allow_dev_login_when_enabled(self):
with self.is_cloud(False):
diff --git a/posthog/llm/gateway_client.py b/posthog/llm/gateway_client.py
index ea8686c9204e..bca8f5f03689 100644
--- a/posthog/llm/gateway_client.py
+++ b/posthog/llm/gateway_client.py
@@ -19,7 +19,6 @@ Product = Literal[
"llma_eval_summary",
"slack-twig",
"customer_archetype_classification",
- "slack-posthog-code",
"product_analytics",
"subscriptions",
"signals",
diff --git a/posthog/models/integration.py b/posthog/models/integration.py
index a78563464b9f..d4cb501eb51c 100644
--- a/posthog/models/integration.py
+++ b/posthog/models/integration.py
@@ -175,6 +175,8 @@ class Integration(models.Model):
REDDIT_ADS = "reddit-ads"
SALESFORCE = "salesforce"
SLACK = "slack"
+ # Deprecated — kept in choices to avoid a no-op migration. The runtime no longer creates
+ # or reads this kind; see `products/slack_app/backend/api.py` for the live integration.
SLACK_POSTHOG_CODE = "slack-posthog-code"
SNAPCHAT = "snapchat"
STRIPE = "stripe"
@@ -290,7 +292,6 @@ POSTHOG_SLACK_SCOPE = ",".join(
class OauthIntegration:
supported_kinds = [
"slack",
- "slack-posthog-code",
"salesforce",
"hubspot",
"google-ads",
@@ -340,19 +341,6 @@ class OauthIntegration:
id_path="team.id",
name_path="team.name",
)
- elif kind == "slack-posthog-code":
- if not settings.SLACK_POSTHOG_CODE_CLIENT_ID or not settings.SLACK_POSTHOG_CODE_CLIENT_SECRET:
- raise NotImplementedError("PostHog Code Slack app not configured")
-
- return OauthConfig(
- authorize_url="https://slack.com/oauth/v2/authorize",
- token_url="https://slack.com/api/oauth.v2.access",
- client_id=settings.SLACK_POSTHOG_CODE_CLIENT_ID,
- client_secret=settings.SLACK_POSTHOG_CODE_CLIENT_SECRET,
- scope="app_mentions:read,channels:read,groups:read,channels:history,groups:history,chat:write,reactions:write,users:read,users:read.email",
- id_path="team.id",
- name_path="team.name",
- )
elif kind == "salesforce":
if not settings.SALESFORCE_CONSUMER_KEY or not settings.SALESFORCE_CONSUMER_SECRET:
raise NotImplementedError("Salesforce app not configured")
@@ -634,21 +622,15 @@ class OauthIntegration:
@classmethod
def redirect_uri(cls, kind: str) -> str:
# The redirect uri is fixed but should always be https and include the "next" parameter for the frontend to redirect
- # slack-posthog-code piggybacks on the approved /integrations/slack/callback redirect URI
- # because the approved production Slack app is still under review for the new path.
- # The real kind is carried in OAuth state so the callback still creates a slack-posthog-code integration.
- path_kind = "slack" if kind == "slack-posthog-code" else kind
if settings.DEBUG and settings.NGROK_URL:
- return f"{settings.NGROK_URL}/integrations/{path_kind}/callback"
- return f"{settings.SITE_URL.replace('http://', 'https://')}/integrations/{path_kind}/callback"
+ return f"{settings.NGROK_URL}/integrations/{kind}/callback"
+ return f"{settings.SITE_URL.replace('http://', 'https://')}/integrations/{kind}/callback"
@classmethod
def authorize_url(cls, kind: str, token: str, next: str = "", is_sandbox: bool = False) -> str:
oauth_config = cls.oauth_config_for_kind(kind, is_sandbox=is_sandbox)
state_payload: dict[str, str] = {"next": next, "token": token}
- if kind == "slack-posthog-code":
- state_payload["kind"] = kind
if kind == "tiktok-ads":
# TikTok uses different parameter names
@@ -1126,7 +1108,7 @@ class SlackIntegrationError(Exception):
pass
-SLACK_INTEGRATION_KINDS: tuple[str, ...] = ("slack", "slack-posthog-code")
+SLACK_INTEGRATION_KINDS: tuple[str, ...] = ("slack",)
SLACK_CHANNELS_PAGE_SIZE = 1000
SLACK_CHANNELS_MAX_PAGES = 10
@@ -1251,14 +1233,6 @@ class SlackIntegration:
return config
- @classmethod
- def posthog_code_slack_config(cls) -> dict[str, str]:
- return {
- "SLACK_POSTHOG_CODE_CLIENT_ID": settings.SLACK_POSTHOG_CODE_CLIENT_ID,
- "SLACK_POSTHOG_CODE_CLIENT_SECRET": settings.SLACK_POSTHOG_CODE_CLIENT_SECRET,
- "SLACK_POSTHOG_CODE_SIGNING_SECRET": settings.SLACK_POSTHOG_CODE_SIGNING_SECRET,
- }
-
def sign_slack_request(body: bytes, signing_secret: str) -> tuple[str, str]:
"""Sign a body with the Slack HMAC-SHA256 scheme; returns (signature, timestamp).
diff --git a/posthog/schema.py b/posthog/schema.py
index a86b4a7cf5f5..e7adbc07fa69 100644
--- a/posthog/schema.py
+++ b/posthog/schema.py
@@ -2805,7 +2805,6 @@ class IntegrationFilter(BaseModel):
class IntegrationKind(StrEnum):
SLACK = "slack"
- SLACK_POSTHOG_CODE = "slack-posthog-code"
SALESFORCE = "salesforce"
HUBSPOT = "hubspot"
GOOGLE_PUBSUB = "google-pubsub"
diff --git a/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_from_query.ambr b/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_from_query.ambr
index 4d81dc6a2021..800a3fff4b5e 100644
--- a/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_from_query.ambr
+++ b/posthog/session_recordings/queries/test/listing_recordings/__snapshots__/test_session_recording_list_from_query.ambr
@@ -1122,7 +1122,7 @@
WHERE and(equals(s.team_id, 99999), greaterOrEquals(s.min_first_timestamp, toDateTime64('2020-12-29 00:00:00.000000', 6, 'UTC')), lessOrEquals(s.min_first_timestamp, toDateTime64('today', 6, 'UTC')), globalIn(s.session_id,
(SELECT nullIf(nullIf(events.`$session_id`, ''), 'null') AS session_id
FROM events
- WHERE and(equals(events.team_id, 99999), notEmpty(nullIf(nullIf(events.`$session_id`, ''), 'null')), lessOrEquals(events.timestamp, now64(6, 'UTC')), equals(events.mat_pp_email, 'bla'), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
+ WHERE and(equals(events.team_id, 99999), notEmpty(nullIf(nullIf(events.`$session_id`, ''), 'null')), lessOrEquals(events.timestamp, now64(6, 'UTC')), ifNull(equals(replaceRegexpAll(nullIf(nullIf(JSONExtractRaw(events.person_properties, 'email'), ''), 'null'), '^"|"$', ''), 'bla'), 0), greaterOrEquals(events.timestamp, toDateTime64('2020-12-28 00:00:00.000000', 6, 'UTC')))
GROUP BY nullIf(nullIf(events.`$session_id`, ''), 'null')
HAVING 1
ORDER BY min(toTimeZone(events.timestamp, 'UTC')) DESC
diff --git a/posthog/settings/integrations.py b/posthog/settings/integrations.py
index 2b88ae409b4b..54012f417f3f 100644
--- a/posthog/settings/integrations.py
+++ b/posthog/settings/integrations.py
@@ -9,14 +9,6 @@ SNAPCHAT_APP_CLIENT_SECRET = get_from_env("SNAPCHAT_APP_CLIENT_SECRET", "")
INTERCOM_APP_CLIENT_ID = get_from_env("INTERCOM_APP_CLIENT_ID", "")
INTERCOM_APP_CLIENT_SECRET = get_from_env("INTERCOM_APP_CLIENT_SECRET", "")
-SLACK_POSTHOG_CODE_CLIENT_ID = get_from_env("SLACK_POSTHOG_CODE_CLIENT_ID", get_from_env("SLACK_TWIG_CLIENT_ID", ""))
-SLACK_POSTHOG_CODE_CLIENT_SECRET = get_from_env(
- "SLACK_POSTHOG_CODE_CLIENT_SECRET", get_from_env("SLACK_TWIG_CLIENT_SECRET", "")
-)
-SLACK_POSTHOG_CODE_SIGNING_SECRET = get_from_env(
- "SLACK_POSTHOG_CODE_SIGNING_SECRET", get_from_env("SLACK_TWIG_SIGNING_SECRET", "")
-)
-
SALESFORCE_CONSUMER_KEY = get_from_env("SALESFORCE_CONSUMER_KEY", "")
SALESFORCE_CONSUMER_SECRET = get_from_env("SALESFORCE_CONSUMER_SECRET", "")
diff --git a/posthog/temporal/ai/eval_slack_repo_selection.py b/posthog/temporal/ai/eval_slack_repo_selection.py
index f23472843aba..d8ec8104aced 100644
--- a/posthog/temporal/ai/eval_slack_repo_selection.py
+++ b/posthog/temporal/ai/eval_slack_repo_selection.py
@@ -1,8 +1,8 @@
"""Local eval for the Slack repo-selection flow — the canonical "how to test locally" tool.
Replicates the production cascade → Haiku gate → discovery agent path against a real
-team with a real GitHub integration, without needing a `slack-posthog-code` Integration
-row or any actual Slack traffic. Each case declares its expected terminal stage/outcome;
+team with a real GitHub integration, without needing a Slack Integration row or any
+actual Slack traffic. Each case declares its expected terminal stage/outcome;
the eval prints a pass/fail summary so you can re-run after touching repo selection
and spot regressions immediately.
diff --git a/posthog/views.py b/posthog/views.py
index 509ea29261a8..87f53a65ddda 100644
--- a/posthog/views.py
+++ b/posthog/views.py
@@ -180,10 +180,6 @@ def render_query(request: HttpRequest) -> HttpResponse:
def preflight_check(request: HttpRequest) -> JsonResponse:
with tracer.start_as_current_span("preflight.slack_config_main"):
slack_client_id = SlackIntegration.slack_config().get("SLACK_APP_CLIENT_ID")
- with tracer.start_as_current_span("preflight.posthog_code_slack_config"):
- posthog_code_slack_config = SlackIntegration.posthog_code_slack_config()
- posthog_code_slack_client_id = posthog_code_slack_config.get("SLACK_POSTHOG_CODE_CLIENT_ID")
- posthog_code_slack_signing_secret = posthog_code_slack_config.get("SLACK_POSTHOG_CODE_SIGNING_SECRET")
hubspot_client_id = settings.HUBSPOT_APP_CLIENT_ID
salesforce_client_id = settings.SALESFORCE_CONSUMER_KEY
@@ -214,12 +210,6 @@ def preflight_check(request: HttpRequest) -> JsonResponse:
"available": bool(slack_client_id),
"client_id": slack_client_id or None,
},
- "posthog_code_slack_service": {
- "available": bool(posthog_code_slack_client_id)
- and bool(posthog_code_slack_signing_secret)
- and bool(posthog_code_slack_config.get("SLACK_POSTHOG_CODE_CLIENT_SECRET")),
- "client_id": posthog_code_slack_client_id or None,
- },
"data_warehouse_integrations": {
"hubspot": {"client_id": hubspot_client_id},
"salesforce": {"client_id": salesforce_client_id},
diff --git a/products/dashboards/frontend/generated/api.schemas.ts b/products/dashboards/frontend/generated/api.schemas.ts
index ae5f68657f77..c4ea6ae31a4d 100644
--- a/products/dashboards/frontend/generated/api.schemas.ts
+++ b/products/dashboards/frontend/generated/api.schemas.ts
@@ -3856,7 +3856,6 @@ export type IntegrationKindApi = (typeof IntegrationKindApi)[keyof typeof Integr
export const IntegrationKindApi = {
Slack: 'slack',
- SlackPosthogCode: 'slack-posthog-code',
Salesforce: 'salesforce',
Hubspot: 'hubspot',
GooglePubsub: 'google-pubsub',
diff --git a/products/posthog_ai/skills/querying-posthog-data/references/models-integrations.md b/products/posthog_ai/skills/querying-posthog-data/references/models-integrations.md
index d0b26944b4c6..2c9ab6bc9446 100644
--- a/products/posthog_ai/skills/querying-posthog-data/references/models-integrations.md
+++ b/products/posthog_ai/skills/querying-posthog-data/references/models-integrations.md
@@ -20,7 +20,7 @@ Each integration represents a connection to an external service like Slack, GitH
### Integration Kinds
-`slack`, `slack-posthog-code`, `salesforce`, `hubspot`, `google-pubsub`, `google-cloud-storage`, `google-ads`, `google-sheets`, `google-cloud-service-account`, `snapchat`, `linkedin-ads`, `reddit-ads`, `tiktok-ads`, `bing-ads`, `intercom`, `email`, `linear`, `github`, `gitlab`, `meta-ads`, `twilio`, `clickup`, `vercel`, `databricks`, `azure-blob`, `firebase`, `jira`, `pinterest-ads`
+`slack`, `salesforce`, `hubspot`, `google-pubsub`, `google-cloud-storage`, `google-ads`, `google-sheets`, `google-cloud-service-account`, `snapchat`, `linkedin-ads`, `reddit-ads`, `tiktok-ads`, `bing-ads`, `intercom`, `email`, `linear`, `github`, `gitlab`, `meta-ads`, `twilio`, `clickup`, `vercel`, `databricks`, `azure-blob`, `firebase`, `jira`, `pinterest-ads`
### Key Relationships
diff --git a/products/product_analytics/frontend/generated/api.schemas.ts b/products/product_analytics/frontend/generated/api.schemas.ts
index 82665a6a7726..156eb253fc17 100644
--- a/products/product_analytics/frontend/generated/api.schemas.ts
+++ b/products/product_analytics/frontend/generated/api.schemas.ts
@@ -3549,7 +3549,6 @@ export type IntegrationKindApi = (typeof IntegrationKindApi)[keyof typeof Integr
export const IntegrationKindApi = {
Slack: 'slack',
- SlackPosthogCode: 'slack-posthog-code',
Salesforce: 'salesforce',
Hubspot: 'hubspot',
GooglePubsub: 'google-pubsub',
diff --git a/products/slack_app/backend/api.py b/products/slack_app/backend/api.py
index 840f7fb75e98..6e3298520a5b 100644
--- a/products/slack_app/backend/api.py
+++ b/products/slack_app/backend/api.py
@@ -59,9 +59,8 @@ logger = structlog.get_logger(__name__)
HANDLED_EVENT_TYPES = ["app_mention", "link_shared"]
-# Slack integration kind used by the PostHog Code coding-agent flow. Historically this used
-# a dedicated `slack-posthog-code` install, but the notifications Slack app (`slack`) carries
-# every scope the coding agent needs, so both surfaces share one kind.
+# The notifications Slack app (`slack`) install carries every scope the coding-agent flow
+# needs, so both surfaces share one kind.
SLACK_INTEGRATION_KIND = "slack"
# Scopes the coding-agent flow exercises end-to-end. Slack stores the granted scope set
diff --git a/products/slack_app/backend/tests/test_workspace_claims.py b/products/slack_app/backend/tests/test_workspace_claims.py
index c199de9bda83..0a0210954e18 100644
--- a/products/slack_app/backend/tests/test_workspace_claims.py
+++ b/products/slack_app/backend/tests/test_workspace_claims.py
@@ -273,10 +273,7 @@ class TestDoesOtherRegionClaimWorkspace(TestCase):
mock_config.return_value = {"SLACK_APP_SIGNING_SECRET": self.signing_secret}
mock_post.return_value = self._response(200, {"claimed": True})
does_other_region_claim_workspace(slack_team_id="T_KIND", kinds=["slack"], incoming_host="eu.posthog.com")
- does_other_region_claim_workspace(
- slack_team_id="T_KIND", kinds=["slack", "slack-posthog-code"], incoming_host="eu.posthog.com"
- )
- assert mock_post.call_count == 2
+ assert mock_post.call_count == 1
def test_signed_request_is_accepted_by_validator(self):
# End-to-end roundtrip: the sent headers + body, fed into the receiver's verifier, must
diff --git a/products/tasks/backend/tests/test_slack_thread_context.py b/products/tasks/backend/tests/test_slack_thread_context.py
index 2306145c73b3..04ec7df4176b 100644
--- a/products/tasks/backend/tests/test_slack_thread_context.py
+++ b/products/tasks/backend/tests/test_slack_thread_context.py
@@ -58,9 +58,7 @@ class TestSlackThreadContextEndpoint(_SlackThreadContextBase):
*,
slack_mention_workflow_id: str | None = "posthog-code-mention-T_SLACK:Ev01",
) -> tuple[Task, TaskRun, SlackThreadTaskMapping]:
- integration = Integration.objects.create(
- team=self.team, kind="slack-posthog-code", integration_id="T_SLACK", config={}
- )
+ integration = Integration.objects.create(team=self.team, kind="slack", integration_id="T_SLACK", config={})
task = Task.objects.create(
team=self.team,
title="Investigate flaky test",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 303ef8851f50..59a25fdd7d55 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -4585,7 +4585,6 @@ export namespace Schemas {
export const IntegrationKind = {
Slack: 'slack',
- SlackPosthogCode: 'slack-posthog-code',
Salesforce: 'salesforce',
Hubspot: 'hubspot',
GooglePubsub: 'google-pubsub',