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): widen send_followup_message signal handler arity (#71562)

Vojta Bartoš8216629ac05b
diff --git a/products/tasks/backend/temporal/process_task/workflow.py b/products/tasks/backend/temporal/process_task/workflow.py
index 4a82b6557a6f..00014478b5c4 100644
--- a/products/tasks/backend/temporal/process_task/workflow.py
+++ b/products/tasks/backend/temporal/process_task/workflow.py
@@ -1806,7 +1806,21 @@ class ProcessTaskWorkflow(PostHogWorkflow):
self._last_active_time = workflow.now()
@temporalio.workflow.signal
- async def send_followup_message(self, message: str | None = None, artifact_ids: Optional[list[str]] = None) -> None:
+ async def send_followup_message(
+ self,
+ message: str | None = None,
+ artifact_ids: Optional[list[str]] = None,
+ message_id: Optional[str] = None,
+ actor_user_id: Optional[int] = None,
+ message_context: Optional[dict[str, Any]] = None,
+ ) -> None:
+ # The handler declares the full positional arg list even though only
+ # ``message`` and ``artifact_ids`` are read here. Temporal passes every
+ # positional arg a caller sends to the handler, and a handler that
+ # declares fewer params than were sent raises and fails the workflow
+ # task — so the arity must stay a superset of every caller's. Widening it
+ # here, ahead of any caller that populates the extra fields, lets this
+ # handler roll out to all workers before those callers ship.
# Log signal arrival so we can correlate it with the adapter's "begin dispatch"
# log below — gaps between the two point at workflow-loop backpressure.
context = self._context