From a8d7673b959613f30463279688516a7a8bf864de Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 1 Jul 2025 17:54:12 +0000 Subject: [PATCH 1/3] Initial plan From 4dd839878a16e245f18ca230ab3f405e14ec5c64 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 1 Jul 2025 18:00:01 +0000 Subject: [PATCH 2/3] Implement follow-up detection for active coding agent PRs Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com> --- src/github/copilotRemoteAgent.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/github/copilotRemoteAgent.ts b/src/github/copilotRemoteAgent.ts index 06dd96b4e5..9dd3ac0bea 100644 --- a/src/github/copilotRemoteAgent.ts +++ b/src/github/copilotRemoteAgent.ts @@ -6,7 +6,7 @@ import vscode from 'vscode'; import { Repository } from '../api/api'; import { AuthProvider } from '../common/authentication'; -import { COPILOT_LOGINS } from '../common/copilot'; +import { COPILOT_LOGINS, CopilotPRStatus } from '../common/copilot'; import { commands } from '../common/executeCommands'; import { Disposable } from '../common/lifecycle'; import Logger from '../common/logger'; @@ -280,6 +280,15 @@ export class CopilotRemoteAgentManager extends Disposable { // Group 2 is this, url-encoded: // {"owner":"monalisa","repo":"app","pullRequestNumber":18} let followUpPR: number | undefined = this.parseFollowup(followup, repoInfo); + + // Check if the currently active PR is a coding agent PR + if (!followUpPR) { + const activePR = repoInfo.fm.activePullRequest; + if (activePR && this._stateModel.get(owner, repo, activePR.number) !== CopilotPRStatus.None) { + followUpPR = activePR.number; + } + } + if (followUpPR) { return this.addFollowUpToExistingPR(followUpPR, userPrompt, summary); } From 74a0b4539b36eb05fc6e7e04aa3e4d410f46bd82 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 1 Jul 2025 19:08:16 +0000 Subject: [PATCH 3/3] Simplify active PR detection logic to use truthy check Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com> --- src/github/copilotRemoteAgent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/github/copilotRemoteAgent.ts b/src/github/copilotRemoteAgent.ts index 9dd3ac0bea..7de95a5dec 100644 --- a/src/github/copilotRemoteAgent.ts +++ b/src/github/copilotRemoteAgent.ts @@ -284,7 +284,7 @@ export class CopilotRemoteAgentManager extends Disposable { // Check if the currently active PR is a coding agent PR if (!followUpPR) { const activePR = repoInfo.fm.activePullRequest; - if (activePR && this._stateModel.get(owner, repo, activePR.number) !== CopilotPRStatus.None) { + if (activePR && this._stateModel.get(owner, repo, activePR.number)) { followUpPR = activePR.number; } }