`create_branch` returns a bare 404 when the token has no push access

Offen Anfängerfreundlich
#3,994 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

@aloneangel45 arbeitet bereits daran.

Seit 01.12.2026.

  • #3995 von @aloneangel45 — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
68/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
github, go

Rechercherichtung

Beginne damit, die Implementierung des create_branch-Tools und die Fehlerbehandlung für die GitHub-Anfrage git/refs zu finden; vergleiche sie mit request_copilot_review und dessen copilotReviewErrMsg, die beide im Issue erwähnt werden. Füge einen Hinweis für den Fall hinzu, dass der Aufrufer das private Repository lesen kann, aber keinen Push-Zugriff hat, und prüfe, ob andere 404-Ursachen weiterhin verständlich bleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Describe the bug

create_branch fails with 404 Not Found on a private repo I can read but can't push to. My agent took the 404 for a wrong repo or base branch and needed gh api repos/<owner>/<repo> --jq .permissions to find the cause. request_copilot_review explains this same 404 (copilotReviewErrMsg), so I think the write tools could do the same. Would you take a PR for create_branch, or would you rather have it in one place for all write tools?

Affected version

Remote server (https://api.githubcopilot.com/mcp/), 2026-12-01

Steps to reproduce the behavior
  1. Pick a private repo where permissions.push is false for your user
  2. Call create_branch with owner, repo and branch
Expected vs actual behavior

Actual: failed to create branch: POST https://api.github.com/repos/<owner>/<repo>/git/refs: 404 Not Found []

Expected: the same error plus a hint that you can read the repo but your credentials have no write access

Vorherrschende Sprache
Go
Sterne
34.8k
Forks
5.4k
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
34

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus github/github-mcp-server

Alle Issues in github/github-mcp-server

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.