: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
feat(slack): default the Slack bot to Opus 5 (#76545)
Georgiy Tarasovc06c24602ed7
diff --git a/posthog/temporal/ai/slack_app/activities/task_creation.py b/posthog/temporal/ai/slack_app/activities/task_creation.pyindex 85c56716ca24..37c8c286ca19 100644--- a/posthog/temporal/ai/slack_app/activities/task_creation.py+++ b/posthog/temporal/ai/slack_app/activities/task_creation.py@@ -31,6 +31,11 @@ _SLACK_RECOVERY_STRATEGY_CANCELLED = "cancelled_resume"_THREAD_CONTEXT_TAG = "slack_thread_context"_THREAD_CONTEXT_UPDATE_TAG = "slack_thread_context_update"_INITIATOR_PLACEHOLDER = "<original user message was here>"+# Default the Slack bot to Opus 5 when neither the user nor the workspace has+# pinned a model, instead of letting the agent server fall back to its own+# default. Kept together as a valid (runtime_adapter, model) pair.+_SLACK_DEFAULT_RUNTIME_ADAPTER = "claude"+_SLACK_DEFAULT_MODEL = "claude-opus-5"_SLACK_DELIVERY_CONSTRAINTS = """Slack delivery constraints:- Local sandbox paths such as /tmp/workspace/... are not visible to Slack users.- Do not say a file, report, PDF, spreadsheet, document, or other artifact is attached, uploaded, or shared unless a tool explicitly confirms that delivery.@@ -636,6 +641,12 @@ def create_posthog_code_task_for_repo_activity(ai_prefs = resolve_ai_preferences(integration, slack_user_id)+ # `resolve_ai_preferences` guarantees runtime_adapter and model are set together,+ # so falling back on both keeps the pair consistent — an explicit override wins,+ # otherwise the Slack bot defaults to Opus 5.+ runtime_adapter = ai_prefs.runtime_adapter or _SLACK_DEFAULT_RUNTIME_ADAPTER+ model = ai_prefs.model or _SLACK_DEFAULT_MODEL+# File into the creator's personal "#me" channel so the task surfaces in PostHog Desktop's# Spaces feed, which is strictly channel-scoped — a NULL-channel task shows up in no space.personal_channel_id: uuid.UUID | None = None@@ -664,8 +675,8 @@ def create_posthog_code_task_for_repo_activity(start_workflow=False,posthog_mcp_scopes="full",initial_permission_mode="bypassPermissions",- runtime_adapter=ai_prefs.runtime_adapter,- model=ai_prefs.model,+ runtime_adapter=runtime_adapter,+ model=model,reasoning_effort=ai_prefs.reasoning_effort,channel_id=personal_channel_id,)diff --git a/products/slack_app/backend/services/slack_app_home.py b/products/slack_app/backend/services/slack_app_home.pyindex ea87e610a5c0..12f0e2ca6dae 100644--- a/products/slack_app/backend/services/slack_app_home.py+++ b/products/slack_app/backend/services/slack_app_home.py@@ -414,8 +414,8 @@ def _header_blocks() -> list[dict]:def _active_model_blocks(effective: AIPreferences, source: PreferenceSource) -> list[dict]:"""Headline that shows which model is actually running, and why.- When nothing is set the agent-server picks its own default — we don't- know which one, so don't lie. Just say so and let the user override.+ When nothing is set the Slack bot defaults to Opus 5 (pinned in the task+ creation activity); the user can still override it here."""header = _section_title("🤖 AI model",@@ -430,7 +430,7 @@ def _active_model_blocks(effective: AIPreferences, source: PreferenceSource) ->"type": "section","text": {"type": "mrkdwn",- "text": "Inheriting PostHog Desktop's default — pick personal or workspace settings to override.",+ "text": "Defaulting to Opus 5. Pick personal or workspace settings to override.",},},source_blurb,