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(tasks): boot the agent after the wizard step for cloud wizard runs (#69455)

Fernando Gomescc6f1a3e73a9
diff --git a/products/tasks/backend/models.py b/products/tasks/backend/models.py
index a5e682137ae9..d58fb7988158 100644
--- a/products/tasks/backend/models.py
+++ b/products/tasks/backend/models.py
@@ -592,6 +592,12 @@ class Task(FileSystemSyncMixin, DeletedMetaFields, models.Model):
# the agent (see run_wizard activity / TaskProcessingContext.wizard_config).
if wizard_config is not None:
extra_state["wizard_config"] = wizard_config
+ # The agent-server self-delivers pending_user_message the moment it boots. With
+ # overlap-clone-boot the server launches during provisioning, so that first turn
+ # ("commit the wizard's changes, open a PR") runs before run_wizard has touched the
+ # repo, finds nothing to commit, and consumes the prompt — the run then idles forever.
+ # Wizard runs must boot the agent only after the wizard step.
+ extra_state["overlap_clone_boot_enabled"] = False
# The first message handed to the agent once its server is ready (forward_pending_user_message
# reads it from run state). Without it a background run boots the agent idle — it never gets a
diff --git a/products/tasks/backend/tests/test_facade.py b/products/tasks/backend/tests/test_facade.py
index 1c625a4a7211..a2701be52760 100644
--- a/products/tasks/backend/tests/test_facade.py
+++ b/products/tasks/backend/tests/test_facade.py
@@ -450,3 +450,7 @@ class TestFacadeReadsAndMappers(TestCase):
# The agent server boots idle; forward_pending_user_message only kicks it off if the run state
# carries the prompt. Without this the cloud wizard stalls right after "Started agent".
self.assertEqual(run.state.get("pending_user_message"), WIZARD_PR_AGENT_PROMPT)
+ # The agent-server self-delivers pending_user_message the moment it boots, so an
+ # overlap-clone-boot launch (before run_wizard) burns the prompt on an untouched repo
+ # and the run never opens a PR. Wizard runs must pin the overlap boot off.
+ self.assertIs(run.state.get("overlap_clone_boot_enabled"), False)