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.

feat(tasks): link Slack "View agent logs" to PostHog Code deeplink (#60067)

Vojta Bartoš919f471f5ee9
diff --git a/products/slack_app/backend/tests/test_slack_thread.py b/products/slack_app/backend/tests/test_slack_thread.py
index 075c25f9db4e..a7f854842f1b 100644
--- a/products/slack_app/backend/tests/test_slack_thread.py
+++ b/products/slack_app/backend/tests/test_slack_thread.py
@@ -42,7 +42,7 @@ class TestSlackThreadHandler(TestCase):
)
handler = SlackThreadHandler(context)
- handler.post_or_update_progress("In progress...", task_url="https://example.com/task")
+ handler.post_or_update_progress("In progress...", task_url="posthog-code://task/abc/run/xyz")
mock_client.chat_postMessage.assert_called_once()
blocks = mock_client.chat_postMessage.call_args.kwargs["blocks"]
diff --git a/products/tasks/backend/temporal/process_task/activities/post_slack_update.py b/products/tasks/backend/temporal/process_task/activities/post_slack_update.py
index 43ab43db4da3..1c39b5979bb6 100644
--- a/products/tasks/backend/temporal/process_task/activities/post_slack_update.py
+++ b/products/tasks/backend/temporal/process_task/activities/post_slack_update.py
@@ -33,6 +33,7 @@ def post_slack_update(input: PostSlackUpdateInput) -> None:
context = SlackThreadContext.from_dict(input.slack_thread_context)
handler = SlackThreadHandler(context)
task_url = f"{settings.SITE_URL}/project/{task_run.task.team_id}/tasks/{task_run.task_id}?runId={task_run.id}"
+ logs_deeplink = f"posthog-code://task/{task_run.task_id}/run/{task_run.id}"
pr_url = (task_run.output or {}).get("pr_url")
if input.sandbox_cleaned:
@@ -73,7 +74,7 @@ def post_slack_update(input: PostSlackUpdateInput) -> None:
handler.delete_progress()
return
stage = _get_stage_from_status(task_run.status, task_run.stage)
- handler.post_or_update_progress(stage, task_url)
+ handler.post_or_update_progress(stage, logs_deeplink)
except Exception:
logger.exception("post_slack_update_failed", run_id=input.run_id)