Cloud coding agent opens empty PR when invoked from a fork-backed PR review comment
还没有人认领这个 Issue。
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
Describe the bug
Product
GitHub Copilot cloud coding agent (app/copilot-swe-agent), triggered from review feedback on a fork-backed pull request. This may need routing to the hosted coding-agent workflow owners.
Summary
When Copilot was started from a review comment on a fork-backed pull request, it created a draft PR from upstream main instead of the reviewed PR’s fork head. The requested file existed only in the reviewed PR, so the agent could not change it. It nevertheless opened an empty draft PR with an empty Initial plan commit.
Reproduction
- Open a PR from a personal fork to an upstream repository.
- Add review feedback about a file introduced by that PR and absent from upstream
main. - Start Copilot coding agent from that review comment.
- Copilot creates its branch from upstream
mainrather than the reviewed PR head.
Actual behavior
- Reviewed PR: https://github.com/microsoft/rushstack/pull/5949
- Empty Copilot PR: https://github.com/microsoft/rushstack/pull/5951
- Copilot branch:
microsoft:copilot/fix-review-comment-5949 - Base SHA:
d563d6a09ebef0be1ff274faf8c1008767166875 - Head SHA:
7c5a2f29b89b8a8e59da5521ececbb918bd3f5e5 - Result: 0 changed files, 0 additions, 0 deletions.
- The head commit is titled
Initial planand is provably empty: both the head and parent tree SHA are65487a74d0cb345023b9aebe08aa233d79e1097d. - The timeline records
copilot_work_startedandcopilot_work_finisheddespite producing no change.
The reviewed file, libraries/rush-daemon/src/test/WorkspaceEngineComponentFactory.test.ts, existed only on PR #5949’s fork head and not on upstream main.
Expected behavior
For review-comment tasks on fork-backed PRs, Copilot should either:
- Base its work on the reviewed PR’s exact head; or
- Stop before creating a PR and report that fork-head access is unsupported.
Copilot should never publish a zero-diff PR when its head and base trees are identical.
Suggested safeguards
- Preserve the reviewed PR head SHA when launching from inline review feedback.
- Verify that the referenced file and line exist in the selected base.
- Compare head and base trees before publishing; suppress an identical-tree PR.
- Report an explicit unsupported-fork error instead of silently falling back to upstream
main.
Affected version
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
Additional context
No response
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先比较 PR #5949 的 fork head 与 upstream main,尤其检查 libraries/rush-daemon/src/test/WorkspaceEngineComponentFactory.test.ts,并检查空的 PR #5951 及其 Initial plan 提交。跟踪 hosted coding-agent workflow 中 fork-backed PR 的评论触发启动路径。完成的标准是保留或明确拒绝 fork head,并阻止发布任何具有相同 tree 的 PR。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- github
- 领域
- cloud, devtools
- Issue 类型
- 缺陷
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100