microsoft / microsoft/vscode-pull-request-github

activePullRequest misses open PR for current checked-out branch

Ouverte
#8,965 0 commentaires 0 réactions 1 personne assignée Voir sur GitHub

@alexr00 y travaille déjà.

Depuis le 16/9/2026.

Langage dominant
TypeScript
Étoiles
2.6k
Forks
795
Merge moyen
1 j 4 h
PR mergées (30 j)
46

Description

In the agents window, the agent seemed briefly confused by the fact that the activePullRequest tool reported that there was no PR, when it created a PR earlier for the current branch. Why do we need this tool? What problem is it solving?


Description

The activePullRequest tool can report There is no active pull request even when the current checkout is on the head branch of an open pull request in GitHub.

This is easy for an agent to interpret as "no PR exists for this branch," even though the result apparently means only that the host/session has not associated the PR with the current session.

Reproduction

  1. In an isolated Git worktree, create and check out a topic branch.
  2. Push the branch and create a pull request outside the Pull Requests extension, for example with gh pr create.
  3. Keep that same topic branch checked out and tracking its remote branch.
  4. Invoke the activePullRequest tool, including with its normal cached lookup.
  5. Observe There is no active pull request.
  6. Query GitHub directly with gh pr view or the GitHub API and observe that an open PR exists whose head ref exactly matches the checked-out branch.

Observed with:

  • GitHub Pull Requests extension: github.vscode-pull-request-github@0.167.2026091604
  • VS Code Insiders on macOS
  • PR created with the GitHub CLI

Actual behavior

activePullRequest returns no PR because the PR was not recorded as the session's active PR. The response does not distinguish this host-association state from GitHub having no pull request for the current branch.

In an agent workflow, this caused confusion and required falling back to direct GitHub queries to discover and read review comments from the existing PR.

Expected behavior

Ideally, activePullRequest should fall back to locating an open PR by the current repository and checked-out branch when no session association exists.

If that fallback is intentionally out of scope, the response should clearly distinguish the states, for example:

No pull request is associated with the current session. An open pull request may still exist for the checked-out branch.

This would prevent callers from treating missing session metadata as authoritative GitHub repository state.

(Written by Copilot)

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.