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(slack-app): stop adding the hedgehog reaction when a task run ends (#117640)

Vojta Bartoš94e4a2bb64e7
diff --git a/products/slack_app/backend/tests/test_followup_forwarding.py b/products/slack_app/backend/tests/test_followup_forwarding.py
index c57e8a1345a3..65b2d0f6d27a 100644
--- a/products/slack_app/backend/tests/test_followup_forwarding.py
+++ b/products/slack_app/backend/tests/test_followup_forwarding.py
@@ -1332,8 +1332,7 @@ class TestForwardPostHogCodeFollowupActivity(TestCase):
assert signal_kwargs["artifact_ids"] == []
assert signal_kwargs["actor_user_id"] == self.user.id
assert signal_kwargs["message_id"] is not None
- # The message is queued on the workflow, so the :eyes: reaction stays up — it
- # is not swapped to :hedgehog: until the task genuinely completes.
+ # The message is queued on the workflow, so the :eyes: reaction stays up.
mock_slack_instance.client.reactions_add.assert_called_once_with(
channel="C123", timestamp="1234.5679", name="eyes"
)
diff --git a/products/tasks/backend/logic/services/workflow_tasks.py b/products/tasks/backend/logic/services/workflow_tasks.py
index a6bab6232327..b5596639d241 100644
--- a/products/tasks/backend/logic/services/workflow_tasks.py
+++ b/products/tasks/backend/logic/services/workflow_tasks.py
@@ -53,7 +53,7 @@ ACTIVE_RUN_STATUSES = [TaskRun.Status.NOT_STARTED, TaskRun.Status.QUEUED, TaskRu
EVENT_PROMPT_MAX_CHARS = 16_000
# Matches the in-progress marker the task's own Slack updates use, so the later swap to
-# `hedgehog` (or `x`) replaces this rather than stacking a second reaction beside it.
+# `x` replaces this rather than stacking a second reaction beside it.
TRIGGER_ACK_EMOJI = "eyes"
# Daily ceilings on created tasks (trailing 24h) on top of the in-flight cap: a workflow
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 fe3e17dfe6c8..0f8c91162409 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
@@ -109,7 +109,6 @@ def post_slack_update(input: PostSlackUpdateInput) -> None:
if input.sandbox_cleaned:
if pr_url:
- handler.update_reaction("hedgehog")
_post_pr_opened_notification_once(task_run, handler, pr_url, task_url)
elif task_run.status == TaskRun.Status.CANCELLED:
_post_cancelled_once(task_run, handler)
@@ -118,7 +117,6 @@ def post_slack_update(input: PostSlackUpdateInput) -> None:
return
if task_run.status == TaskRun.Status.COMPLETED:
- handler.update_reaction("hedgehog")
if _is_timed_out_completion(task_run):
handler.delete_progress()
return
@@ -166,7 +164,6 @@ def _post_failure_or_timeout(task_run: Any, handler: Any, task_url: str | None)
still deserve an error card.
"""
if _has_timeout_marker(task_run):
- handler.update_reaction("hedgehog")
handler.delete_progress()
return
error = task_run.error_message or "Unknown error"
@@ -281,7 +278,6 @@ def _post_error_once(task_run: Any, handler: Any, error: str, task_url: str | No
return
if _is_suppressed_permission_rejection_error(task_run, error):
- handler.update_reaction("hedgehog")
handler.post_note(SLACK_DENIAL_STOP_MESSAGE)
else:
handler.update_reaction("x")
@@ -296,7 +292,6 @@ def _post_cancelled_once(task_run: Any, handler: Any) -> None:
handler.delete_progress()
return
- handler.update_reaction("hedgehog")
handler.delete_progress()
_mark_terminal_notified(task_run, TaskRun.Status.CANCELLED)
diff --git a/products/tasks/backend/temporal/process_task/activities/tests/test_post_slack_update.py b/products/tasks/backend/temporal/process_task/activities/tests/test_post_slack_update.py
index 5c1a11c698c5..34cced25be80 100644
--- a/products/tasks/backend/temporal/process_task/activities/tests/test_post_slack_update.py
+++ b/products/tasks/backend/temporal/process_task/activities/tests/test_post_slack_update.py
@@ -75,6 +75,6 @@ def test_cancelled_run_clears_progress_without_posting(mock_update_state: MagicM
_post_cancelled_once(task_run, handler)
- handler.update_reaction.assert_called_once_with("hedgehog")
+ handler.update_reaction.assert_not_called()
handler.delete_progress.assert_called_once_with()
mock_update_state.assert_called_once()
diff --git a/products/tasks/backend/tests/test_post_slack_update.py b/products/tasks/backend/tests/test_post_slack_update.py
index 606fe2ac2bd7..9fab7b2adb24 100644
--- a/products/tasks/backend/tests/test_post_slack_update.py
+++ b/products/tasks/backend/tests/test_post_slack_update.py
@@ -74,7 +74,7 @@ class TestPostSlackUpdate(TestCase):
post_slack_update(PostSlackUpdateInput(run_id="run-1", slack_thread_context=self.slack_thread_context))
- mock_update_reaction.assert_called_once_with("hedgehog")
+ mock_update_reaction.assert_not_called()
mock_post_pr_opened.assert_called_once()
mock_run.task.mark_slack_pr_notified.assert_called_once_with("https://github.com/org/repo/pull/1")
@@ -108,7 +108,7 @@ class TestPostSlackUpdate(TestCase):
post_slack_update(PostSlackUpdateInput(run_id="run-1", slack_thread_context=self.slack_thread_context))
- mock_update_reaction.assert_called_once_with("hedgehog")
+ mock_update_reaction.assert_not_called()
mock_post_completion.assert_called_once_with("http://localhost:8000/project/1/tasks/10?runId=run-1")
@patch.object(SlackThreadHandler, "post_error")
@@ -156,7 +156,7 @@ class TestPostSlackUpdate(TestCase):
post_slack_update(PostSlackUpdateInput(run_id="run-1", slack_thread_context=self.slack_thread_context))
- mock_update_reaction.assert_called_once_with("hedgehog")
+ mock_update_reaction.assert_not_called()
mock_delete_progress.assert_called_once()
@patch.object(SlackThreadHandler, "post_or_update_progress")
@@ -197,7 +197,7 @@ class TestPostSlackUpdate(TestCase):
post_slack_update(PostSlackUpdateInput(run_id="run-1", slack_thread_context=self.slack_thread_context))
mock_post_progress.assert_not_called()
- # Task is still running (PR opened mid-run) — reaction stays :eyes:, not :hedgehog:.
+ # Task is still running (PR opened mid-run) — reaction stays :eyes:.
mock_update_reaction.assert_called_once_with("eyes")
@parameterized.expand(
@@ -285,7 +285,7 @@ class TestPostSlackUpdate(TestCase):
post_slack_update(PostSlackUpdateInput(run_id="run-1", slack_thread_context=self.slack_thread_context))
- mock_update_reaction.assert_called_once_with("hedgehog")
+ mock_update_reaction.assert_not_called()
mock_delete_progress.assert_called_once()
mock_post_completion.assert_not_called()
@@ -318,7 +318,7 @@ class TestPostSlackUpdate(TestCase):
post_slack_update(PostSlackUpdateInput(run_id="run-1", slack_thread_context=self.slack_thread_context))
- mock_update_reaction.assert_called_once_with("hedgehog")
+ mock_update_reaction.assert_not_called()
mock_delete_progress.assert_called_once()
mock_post_error.assert_not_called()
@@ -385,7 +385,7 @@ class TestPostSlackUpdate(TestCase):
)
)
- mock_update_reaction.assert_called_once_with("hedgehog")
+ mock_update_reaction.assert_not_called()
mock_post_pr_opened.assert_called_once_with(
"https://github.com/org/repo/pull/1",
"http://localhost:8000/project/1/tasks/10?runId=run-1",
@@ -423,7 +423,7 @@ class TestPostSlackUpdate(TestCase):
post_slack_update(PostSlackUpdateInput(run_id="run-1", slack_thread_context=self.slack_thread_context))
- mock_update_reaction.assert_called_once_with("hedgehog")
+ mock_update_reaction.assert_not_called()
mock_post_pr_opened.assert_not_called()
mock_delete_progress.assert_called_once()
@@ -511,7 +511,7 @@ class TestPostSlackUpdate(TestCase):
)
)
- mock_update_reaction.assert_called_once_with("hedgehog")
+ mock_update_reaction.assert_not_called()
mock_post_pr_opened.assert_not_called()
mock_delete_progress.assert_called_once()
@@ -544,7 +544,7 @@ class TestPostSlackUpdate(TestCase):
)
)
- mock_update_reaction.assert_called_once_with("hedgehog")
+ mock_update_reaction.assert_not_called()
mock_post_pr_opened.assert_not_called()
mock_delete_progress.assert_called_once()
@@ -575,7 +575,7 @@ class TestPostSlackUpdate(TestCase):
)
)
- mock_update_reaction.assert_called_once_with("hedgehog")
+ mock_update_reaction.assert_not_called()
mock_post_pr_opened.assert_called_once_with(
"https://github.com/org/repo/pull/2",
"http://localhost:8000/project/1/tasks/10?runId=run-1",
@@ -606,7 +606,7 @@ class TestPostSlackUpdate(TestCase):
)
)
- mock_update_reaction.assert_called_once_with("hedgehog")
+ mock_update_reaction.assert_not_called()
mock_post_pr_opened.assert_called_once_with(
"https://github.com/org/repo/pull/2",
"http://localhost:8000/project/1/tasks/10?runId=run-1",