Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/agent/src/server/agent-server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3827,13 +3827,18 @@ describe("AgentServer HTTP Mode", () => {
expect(context).not.toContain("gh pr checkout");
});

it("returns auto-update PR context for Slack-origin runs", () => {
it("avoids redundant PR checkout for auto-update runs", () => {
process.env.POSTHOG_CODE_INTERACTION_ORIGIN = "slack";
const s = createServer();
const context = (s as unknown as TestableServer).buildDetectedPrContext(
prUrl,
);
expect(context).toContain(`gh pr checkout ${prUrl}`);
expect(context).toContain(
`If it is not already checked out, check it out with \`gh pr checkout ${prUrl}\``,
);
expect(context).toContain(
"Do not check it out again when it is already active",
);
expect(context).toContain(
"Make changes, commit, and push to that branch",
);
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/server/agent-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3152,7 +3152,7 @@ export class AgentServer {
`IMPORTANT — OVERRIDE PREVIOUS INSTRUCTIONS ABOUT CREATING BRANCHES/PRs.\n` +
`You already have an open pull request: ${prUrl}\n` +
`You MUST:\n` +
`1. Check out the existing PR branch with \`gh pr checkout ${prUrl}\`\n` +
`1. Continue working on the existing PR branch. If it is not already checked out, check it out with \`gh pr checkout ${prUrl}\`. Do not check it out again when it is already active.\n` +
Comment thread
tatoalo marked this conversation as resolved.
Outdated
`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.`
);
Expand Down
Loading