From 19a12a4ff3ea4c6d35a6bbda308645eccfd9bea5 Mon Sep 17 00:00:00 2001 From: Osvaldo Ortega Date: Thu, 26 Feb 2026 15:16:05 -0800 Subject: [PATCH] Update pull request state handling to include all states in checks --- extensions/github/src/commands.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/github/src/commands.ts b/extensions/github/src/commands.ts index 879b90ad575..3adf7d3dcae 100644 --- a/extensions/github/src/commands.ts +++ b/extensions/github/src/commands.ts @@ -98,13 +98,14 @@ async function checkOpenPullRequest(gitAPI: GitAPI, _sessionResource: vscode.Uri try { const octokit = await getOctokit(); - const { data: pullRequests } = await octokit.pulls.list({ + const { data: openPRs } = await octokit.pulls.list({ owner: resolved.remoteInfo.owner, repo: resolved.remoteInfo.repo, head: `${resolved.remoteInfo.owner}:${resolved.head.name}`, + state: 'all', }); - vscode.commands.executeCommand('setContext', 'github.hasOpenPullRequest', pullRequests.length > 0); + vscode.commands.executeCommand('setContext', 'github.hasOpenPullRequest', openPRs.length > 0); } catch { // Silently fail — leave context key unchanged } @@ -144,6 +145,7 @@ async function createPullRequest(gitAPI: GitAPI, sessionResource: vscode.Uri | u owner: remoteInfo.owner, repo: remoteInfo.repo, head: `${remoteInfo.owner}:${head.name}`, + state: 'all', }); if (pullRequests.length > 0) {