microsoft / microsoft/vscode-pull-request-github
activePullRequest misses open PR for current checked-out branch
@alexr00 已经在做这个了。
开始于 2026年9月16日。
- 主要语言
- TypeScript
- 星标
- 2.6k
- 派生
- 795
- 平均合并
- 1 天 4 小时
- 30 天内合并 PR
- 46
描述
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
- In an isolated Git worktree, create and check out a topic branch.
- Push the branch and create a pull request outside the Pull Requests extension, for example with
gh pr create. - Keep that same topic branch checked out and tracking its remote branch.
- Invoke the
activePullRequesttool, including with its normal cached lookup. - Observe
There is no active pull request. - Query GitHub directly with
gh pr viewor 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)
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
评估
这个 Issue 还没有评估数据。