From e2480fa2981b6d99bb24b96337371876ab57a2a3 Mon Sep 17 00:00:00 2001 From: Alessandro Pogliaghi Date: Tue, 21 Jul 2026 17:09:17 +0100 Subject: [PATCH 1/2] Let cloud task users override the single-PR default The existing-PR cloud task prompts hard-blocked creating a new branch or PR ("You MUST NOT create a new branch, close the existing PR, or create a new PR"), so the agent refused even when the user explicitly authorized additional PRs. Make those prohibitions the default rather than absolute: continue on the existing PR unless the user explicitly asks otherwise, matching the escape hatch already used in the non-auto-publish path. Generated-By: PostHog Code Task-Id: 228eca58-a141-4129-af28-560fab7a150a --- packages/agent/src/server/agent-server.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/agent/src/server/agent-server.ts b/packages/agent/src/server/agent-server.ts index 684ef146b7..a0fb359d44 100644 --- a/packages/agent/src/server/agent-server.ts +++ b/packages/agent/src/server/agent-server.ts @@ -3299,7 +3299,7 @@ export class AgentServer { `You MUST:\n` + `1. ${this.buildExistingPrCheckoutInstruction(prUrl)}\n` + `2. Make changes, commit, and push to that branch\n` + - `You MUST NOT create a new branch, close the existing PR, or create a new PR.` + `By default, do not create a new branch, close the existing PR, or create a new PR — continue on the existing PR. If the user explicitly asks you to create a new branch or a separate PR, follow their instruction.` ); } @@ -3417,7 +3417,7 @@ Do the requested work, but stop with local changes ready for review. Important: - Do NOT create new commits, push to the branch, or update the pull request unless the user explicitly asks. -- Do NOT create a new branch or a new pull request. +- Do NOT create a new branch or a new pull request unless the user explicitly asks. ${signedCommitInstructions}${prLinkInstructions}${shellEfficiencyInstructions} `; } @@ -3437,7 +3437,7 @@ After completing the requested changes: List unresolved threads first with \`gh api graphql -f query='{repository(owner:"",name:""){pullRequest(number:){reviewThreads(first:100){nodes{id isResolved comments(first:1){nodes{body}}}}}}}'\` so you can resolve each one you fixed. Important: -- Do NOT create a new branch or a new pull request. +- Do NOT create a new branch or a new pull request unless the user explicitly asks. - Do NOT push fixes for review comments without replying to and resolving each related thread. ${signedCommitInstructions}${prLinkInstructions}${shellEfficiencyInstructions} `; From b665187542988da07827acb4d5cf0b995b98cd4b Mon Sep 17 00:00:00 2001 From: Alessandro Pogliaghi Date: Tue, 21 Jul 2026 17:39:12 +0100 Subject: [PATCH 2/2] Scope the mandatory-checkout steps to the single-PR default The auto-publish existing-PR prompt still opened with an unconditional "You MUST" checkout-and-push-to-existing-branch block before the override sentence, so an explicit request for a separate PR conflicted with the mandatory steps. Gate those steps on "Unless the user explicitly asks for a new branch or separate PR" so the exception is consistent. Addresses Greptile P1. Generated-By: PostHog Code Task-Id: 228eca58-a141-4129-af28-560fab7a150a --- packages/agent/src/server/agent-server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/agent/src/server/agent-server.ts b/packages/agent/src/server/agent-server.ts index a0fb359d44..c37475fc4d 100644 --- a/packages/agent/src/server/agent-server.ts +++ b/packages/agent/src/server/agent-server.ts @@ -3296,10 +3296,10 @@ export class AgentServer { return ( `IMPORTANT — OVERRIDE PREVIOUS INSTRUCTIONS ABOUT CREATING BRANCHES/PRs.\n` + `You already have an open pull request: ${prUrl}\n` + - `You MUST:\n` + + `Unless the user explicitly asks for a new branch or separate PR, you MUST:\n` + `1. ${this.buildExistingPrCheckoutInstruction(prUrl)}\n` + `2. Make changes, commit, and push to that branch\n` + - `By default, do not create a new branch, close the existing PR, or create a new PR — continue on the existing PR. If the user explicitly asks you to create a new branch or a separate PR, follow their instruction.` + `By default, do not create a new branch, close the existing PR, or create a new PR — continue on the existing PR. If the user explicitly asks you to create a new branch or a separate PR, follow their instruction instead.` ); }