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

未關閉 適合新手
#3,994 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 2 天內回覆

@aloneangel45 已經在處理了。

開始於 2026年12月1日。

  • #3995 來自 @aloneangel45 —— 未關閉

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
68/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
github, go

研究方向

先找出 create_branch 工具的實作,以及它對 GitHub git/refs 請求的錯誤處理;再與 issue 中提到的 request_copilot_review 及其 copilotReviewErrMsg 比較。針對呼叫端可以讀取私有儲存庫,但沒有 push 權限的情況新增提示,並確認其他 404 原因仍然容易理解。

由索引模型根據 Issue 內容生成。

描述

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

主要語言
Go
星號
34.8k
分支
5.4k
平均合併
2 天 15 小時
30 天內合併 PR
34

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

github/github-mcp-server 的其他 Issue

查看 github/github-mcp-server 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。