File tree Expand file tree Collapse file tree
packages/agent/src/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -489,6 +489,16 @@ describe("AgentServer HTTP Mode", () => {
489489 delete process . env . POSTHOG_CODE_INTERACTION_ORIGIN ;
490490 } ) ;
491491
492+ it ( "returns auto-PR prompt for signal_report-origin runs" , ( ) => {
493+ process . env . POSTHOG_CODE_INTERACTION_ORIGIN = "signal_report" ;
494+ const s = createServer ( ) ;
495+ const prompt = ( s as unknown as TestableServer ) . buildCloudSystemPrompt ( ) ;
496+ expect ( prompt ) . toContain ( "posthog-code/" ) ;
497+ expect ( prompt ) . toContain ( "Create a draft pull request" ) ;
498+ expect ( prompt ) . toContain ( "gh pr create --draft" ) ;
499+ delete process . env . POSTHOG_CODE_INTERACTION_ORIGIN ;
500+ } ) ;
501+
492502 it ( "returns PR-update prompt for existing PRs on Slack-origin runs" , ( ) => {
493503 process . env . POSTHOG_CODE_INTERACTION_ORIGIN = "slack" ;
494504 const s = createServer ( ) ;
Original file line number Diff line number Diff line change @@ -1265,13 +1265,14 @@ export class AgentServer {
12651265 }
12661266
12671267 /**
1268- * Slack -origin cloud runs auto-publish by default. Every other origin is
1268+ * Automated -origin cloud runs auto-publish by default. Every other origin is
12691269 * review-first unless the user explicitly asks, and createPr=false always
12701270 * disables publishing.
12711271 */
12721272 private shouldAutoPublishCloudChanges ( ) : boolean {
1273+ const origin = this . getCloudInteractionOrigin ( ) ;
12731274 return (
1274- this . getCloudInteractionOrigin ( ) === "slack" &&
1275+ ( origin === "slack" || origin === "signal_report" ) &&
12751276 this . config . createPr !== false
12761277 ) ;
12771278 }
You can’t perform that action at this time.
0 commit comments