Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Let cloud task users override the single-PR default - #3639

Merged
trunk-io[bot] merged 3 commits into
mainfrom
posthog-code/allow-user-authorized-extra-prs
Jul 22, 2026
Merged

Let cloud task users override the single-PR default#3639
trunk-io[bot] merged 3 commits into
mainfrom
posthog-code/allow-user-authorized-extra-prs

Conversation

@tatoalo

@tatoalo tatoalo commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Problem

Cloud task runs with an existing open PR hard-blocked the agent from creating a new branch or PR ("You MUST NOT create a new branch, close the existing PR, or create a new PR"). Users who explicitly authorized additional PRs still got refused, since the instruction had no override.

Changes

Made the single-PR prohibition the default rather than absolute in the existing-PR cloud task prompts (packages/agent/src/server/agent-server.ts): continue on the existing PR unless the user explicitly asks for a new branch or separate PR. This matches the escape hatch already used in the non-auto-publish path, so the default (avoid spontaneous extra PRs) is preserved while explicit user authorization is honored.

How did you test this?

Text-only prompt-string change with no assertions against the edited lines. Typecheck and the surrounding test suite fail only on pre-existing environment limitations (unbuilt workspace deps and the sandbox's global git commit block used by test fixtures) — none related to this change.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog from a Slack thread

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
@trunk-io

trunk-io Bot commented Jul 21, 2026

Copy link
Copy Markdown

😎 Merged directly without going through the merge queue, as the queue was empty and the PR was up to date with the target branch - details.

@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 056d16c.

@tatoalo
tatoalo marked this pull request as ready for review July 21, 2026 16:11
@tatoalo
tatoalo enabled auto-merge (squash) July 21, 2026 16:11
@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
packages/agent/src/server/agent-server.ts:3299-3302
**Override Conflicts With Mandatory Checkout**

When the user explicitly requests a separate branch or PR, the preceding `MUST` steps still require checking out the existing PR and pushing to that branch. The agent can therefore update the existing PR before applying the new exception, so the explicit request is misapplied.

```suggestion
      `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 for a new branch or separate PR, follow their instruction instead.`
```

Reviews (1): Last reviewed commit: "Let cloud task users override the single..." | Re-trigger Greptile

Comment thread packages/agent/src/server/agent-server.ts Outdated
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
@tatoalo tatoalo self-assigned this Jul 22, 2026
Comment thread packages/agent/src/server/agent-server.ts
@veria-ai

veria-ai Bot commented Jul 22, 2026

Copy link
Copy Markdown

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 1 · PR risk: 0/10

@tatoalo
tatoalo disabled auto-merge July 22, 2026 12:36
@trunk-io
trunk-io Bot merged commit fb1d37c into main Jul 22, 2026
33 checks passed
@trunk-io
trunk-io Bot deleted the posthog-code/allow-user-authorized-extra-prs branch July 22, 2026 12:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants