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(signals): open the draft PR before the /simplify pass (#102979)

Alessandro Pogliaghi862331c0d820
diff --git a/products/signals/backend/auto_start.py b/products/signals/backend/auto_start.py
index d52a8235aae4..2a6dc7e08be0 100644
--- a/products/signals/backend/auto_start.py
+++ b/products/signals/backend/auto_start.py
@@ -362,10 +362,14 @@ def _build_autostart_task_description(
"the user to that branch so they can review the changes and decide how to proceed, and explain in your "
"turn summary why you didn't open the PR directly. Err on the side of caution to avoid committing a "
"social faux pas in someone else's project.\n\n"
- "Before you open the PR, run the `/simplify` skill over your branch and apply what it "
- "finds; if the skill isn't available to you, reread your own diff for the same. Cut the "
- "scaffolding a first draft accumulates, and any comment that only narrates the code. Only "
- "remove, never widen the change, and rerun the tests if you removed anything.\n\n"
+ "As soon as the change works and the tests you touched pass, make the work durable before anything "
+ "else: stage it, commit with the git_signed_commit tool, push the branch, and open the draft PR; when "
+ "the repository policy check above rules a PR out, push the branch to the user's fork instead. "
+ "Only after that point, run the `/simplify` skill over your branch and push what it finds as "
+ "a follow-up commit; if the skill isn't available to you, reread your own diff for the same. Cut "
+ "the scaffolding a first draft accumulates, and any comment that only narrates the code. Only "
+ "remove, never widen the change, and rerun the tests if you removed anything. If you are told "
+ "the run is short on budget or time, skip this polish pass: the pushed branch is what matters.\n\n"
"Write everything you produce in Simplified Technical English, following the "
"`writing-simplified-technical-english` skill: one meaning per word, active voice, simple tenses, "
"one idea per sentence.\n\n"
diff --git a/products/signals/backend/test/test_auto_start.py b/products/signals/backend/test/test_auto_start.py
index 5ee525217b40..bd70618b3ce4 100644
--- a/products/signals/backend/test/test_auto_start.py
+++ b/products/signals/backend/test/test_auto_start.py
@@ -771,6 +771,23 @@ def test_autostart_description_lists_source_issues_only_when_references_exist(so
assert "inbox/reports/0198c0de-0000-7000-8000-000000000001).' -" in description
+def test_autostart_description_opens_the_pr_before_the_simplify_pass():
+ description = _build_autostart_task_description(
+ report_id="0198c0de-0000-7000-8000-000000000001",
+ team_id=1,
+ summary="Fix the auth panel.",
+ repository="PostHog/posthog",
+ priority=None,
+ )
+
+ open_pr = description.index("open the draft PR")
+ fork_push = description.index("push the branch to the user's fork instead")
+ simplify = description.index("`/simplify`")
+ assert open_pr < simplify
+ assert fork_push < simplify
+ assert "skip this polish pass" in description
+
+
@pytest.mark.parametrize(
("summary", "expect_fix_loop"),
[