github / github/copilot-cli

Cloud coding agent opens empty PR when invoked from a fork-backed PR review comment

Aperta
#4,559 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

triage
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

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

  1. Open a PR from a personal fork to an upstream repository.
  2. Add review feedback about a file introduced by that PR and absent from upstream main.
  3. Start Copilot coding agent from that review comment.
  4. Copilot creates its branch from upstream main rather 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 plan and is provably empty: both the head and parent tree SHA are 65487a74d0cb345023b9aebe08aa233d79e1097d.
  • The timeline records copilot_work_started and copilot_work_finished despite 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:

  1. Base its work on the reviewed PR’s exact head; or
  2. 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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia confrontando il fork head di PR #5949 con upstream main, in particolare libraries/rush-daemon/src/test/WorkspaceEngineComponentFactory.test.ts, e analizza il PR vuoto #5951 e il relativo commit Initial plan. Traccia il percorso di avvio dai commenti di revisione per i PR basati su fork nel hosted coding-agent workflow. Il lavoro è completato quando il fork head viene mantenuto o rifiutato esplicitamente e viene impedita la pubblicazione di qualsiasi PR con un tree identico.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
github
Ambito
cloud, devtools
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.