Fork PRs created from the GitHub Copilot app can't enable "Allow edits by maintainers" (`maintainer_can_modify` silently ignored)
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 45/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- github, github-actions, python
- Domaine
- authorization, devtools
Piste de recherche
Start by tracing how the Copilot app provides GH_TOKEN to remote sessions and how the CLI creates fork pull requests with gh pr create. Compare the token permissions and the maintainer_can_modify value during creation and update; the issue does not name source files or tests. Done means fork PRs have maintainer edits enabled by default, or the app clearly reports when its token cannot set the option.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
When the Copilot agent opens a PR from the user's fork into an upstream repo (gh pr create --head <user>:<branch>, using the GH_TOKEN the GitHub Copilot app provides), the PR is created with "Allow edits by maintainers" off. Trying to turn it on afterwards with PATCH /repos/{owner}/{repo}/pulls/{n} and maintainer_can_modify=true returns success but leaves the value false. gh pr edit on the same PR fails with Resource not accessible by integration.
The token appears to be a GitHub App user token (X-OAuth-Scopes is empty). My guess is that it lacks the access to the fork that this setting needs, and GitHub drops the field without reporting an error.
Impact: maintainer and bot workflows can't push to these PRs. For example, our /fix:link-cache bot falls back to pushing to refs/pull/<n>/head and fails with ! [remote rejected] HEAD -> refs/pull/12889/head (deny updating a hidden ref).
Affected version
Copilot CLI 1.0.109, run by the GitHub Copilot app in a remote (cloud) session.
Steps to reproduce the behavior
- In a Copilot app session on an upstream repo where you have a fork, have the agent push a branch to the fork and run
gh pr create -R <upstream> --head <user>:<branch> .... Maintainer edits aren't turned off (no--no-maintainer-edit). - Run
gh pr view <n> --json maintainerCanModifyand getfalse. - Run
gh api -X PATCH repos/<upstream>/pulls/<n> -F maintainer_can_modify=true --jq .maintainer_can_modify. It exits 0 and printsfalse. - Example: open-telemetry/opentelemetry.io#12889, which has
maintainerCanModify: false, and its failed bot push in https://github.com/open-telemetry/opentelemetry.io/actions/runs/46047662218
Expected behavior
Fork PRs created by the agent have "Allow edits by maintainers" on, matching gh pr create's default. If the token can't set it, the agent or app reports that instead of failing silently. A setting to choose the default would also help.
Additional context
- I couldn't find a setting for this in the app's
.github/github-app.ymlreference or in the cloud agent customization docs. - Workaround: tick the checkbox by hand on each PR.
- Possibly related: PyGithub/PyGithub#3297 (discussion:
maintainer_can_modifyhas no effect). - Side note: in the same session,
gh issue create -R github/copilot-cliwith the app's token also failed withResource not accessible by integration (createIssue).
- Langage dominant
- Python
- Étoiles
- 11.5k
- Forks
- 2k
- Merge moyen
- 6 h 34 min
- PR mergées (30 j)
- 3
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de github/copilot-cli
-
area:plugins
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
github/copilot-cli#5567 ·
-
Difficulté 1/5 1-3 heures Accessibilité débutants 78/100
github/copilot-cli#5489 ·
-
Built-in functions.view returns no content for large files despite documenting automatic truncationOuvertearea:tools
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
github/copilot-cli#5476 ·
-
triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 74/100
github/copilot-cli#5377 ·
-
area:platform-windows area:tools
Difficulté 1/5 Moins d'une heure Accessibilité débutants 74/100
github/copilot-cli#5340 ·
Toutes les issues de github/copilot-cli
Issues similaires
-
fidelity
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
backlog
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
sagemathinc/sagebrush#3434 ·
Les mainteneurs répondent en général sous 1 jour
-
marketing
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour
-
documentation good first issue help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
wuisabel-gif/MemWhale#576 ·
Les mainteneurs répondent en général sous 1 jour
-
Status: Triage Suggestion
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
GTNewHorizons/GT-New-Horizons-Modpack#27957 ·
Les mainteneurs répondent en général sous 1 jour