fix(agent): Don't let long running local checks prevent draft-PR creation#2693
fix(agent): Don't let long running local checks prevent draft-PR creation#2693mp-hog wants to merge 1 commit into
Conversation
The cloud agent treated "all checks green" as a hard prerequisite for opening a draft PR — kicking off a full typecheck/test/build and polling for it, so the draft was sometimes never created. Add a reusable `draftPrVerificationGuidance` block to the cloud system prompt in `buildCloudSystemPrompt()` and wire it into every PR-capable branch (review-first, auto-publish, and the publish-enabled no-repository clone path). It instructs the agent to open the draft FIRST, then handle verification without blocking: rely on CI if the repo has it, otherwise offer to run checks as a follow-up task when the agent judges it warranted. Does not assume CI exists. Lives in the product prompt (injected into every cloud run) so the fix applies to any user repo, not just this one. Generated-By: PostHog Code Task-Id: f899b653-ef6d-4af0-bad6-1bce6334f06e
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
|
Problem
I ran into a problem that a PR wasn't created and subsequently the sandbox got killed without snapshot so that all work was lost. The PR creation was blocked because of long-running checks that were not needed as the coding task was verified already.
This PR modifies the PR-creation instructions to not gate draft PRs if the user requests to create one.
More context: https://posthog.slack.com/archives/C09G8Q32R6F/p1781593261186719
Changes
Added a reusable
draftPrVerificationGuidanceblock tobuildCloudSystemPrompt()inpackages/agent/src/server/agent-server.tsand wired it into every PR-capable branch (review-first connected-repo, auto-publish, and the publish-enabled no-repository clone path). It instructs the agent to:How did you test this?
pnpm --filter @posthog/agent typecheck— passesbiome checkon both changed files — cleanpnpm --filter @posthog/agent test agent-server.test.ts— 64/64 pass, including new assertions covering the guidance across the review-first, auto-publish, and no-repository branches (and its absence whencreatePr: false)Automatic notifications
Created with PostHog Code