/delegate fails with 403 during UncommittedChangesCheck pre-flight ("Request forbidden by administrative rules") despite valid auth and repo access
還沒有人認領這個 Issue。
- 主要語言
- Shell
- 星號
- 11.2k
- 分支
- 1.9k
- 平均合併
- 14 小時 16 分鐘
- 30 天內合併 PR
- 6
描述
Description
Running /delegate in Copilot CLI on a valid, authenticated repo consistently fails during the pre-flight UncommittedChangesCheck stage with a 403 error, even though the same GitHub API endpoint succeeds when called directly via curl/gh api with the same credentials.
Environment
- Copilot CLI version: 1.0.81
- OS: macOS
- Repo: GroupiSP/probreg (public repo, non-fork)
- Auth:
ghOAuth token, scopesadmin:public_key, gist, read:org, repo - Confirmed repo permissions for user:
admin: true, maintain: true, pull: true, push: true, triage: true
Steps to reproduce
- In an authenticated Copilot CLI session on
GroupiSP/probreg(branchmain), run/delegate. - Observe failure during pre-flight validation.
Error from CLI logs (~/.copilot/logs/process-*.log)
2026-08-28T20:54:54.846Z [INFO] STAGE 1: UncommittedChangesCheck - Starting validation checks
2026-08-28T20:54:54.976Z [INFO] Repository: GroupiSP/probreg (host: github.com)
2026-08-28T20:54:54.976Z [INFO] Base branch: main, Head branch: main
2026-08-28T20:54:54.976Z [INFO] Async branch: copilot/established-meadowlark
2026-08-28T20:54:55.308Z [INFO] Running parallel validation checks...
2026-08-28T20:54:55.373Z [ERROR] Request to GitHub Repository API at https://api.github.com/repos/GroupiSP/probreg failed with status 403 (request ID: unknown), body:
Request forbidden by administrative rules. Please make sure your request has a User-Agent header (https://docs.github.com/en/rest/overview/resources-in-the-rest-api#user-agent-required). Check https://developer.github.com for other possible causes.
2026-08-28T20:54:55.373Z [ERROR] Failed during uncommitted changes check: Error: HTTP 403 response does not appear to originate from GitHub. Is a proxy or firewall intercepting this request? https://gh.io/copilot-firewall
Investigation performed
- No proxy/VPN or
HTTP(S)_PROXYenv vars set; TLS certs forapi.github.com/api.githubcopilot.comverify correctly with valid GitHub-issued certs (not proxy re-signed). - The exact same endpoint (
GET https://api.github.com/repos/GroupiSP/probreg) returns200 OKreliably (5+ consecutive attempts) viacurlandgh apiusing the same token, both with and without an explicitUser-Agentheader. gh auth statusshows a valid, active token; org (GroupiSP) membership and repo push/admin access confirmed via API.- Rate limit unaffected:
5000/5000remaining at time of failure. - The response body explicitly complains about a missing
User-Agentheader, and lacks the usualx-github-request-idheader — suggesting the CLI's internal HTTP client for this specific pre-flight request may be omitting/malforming theUser-Agentheader, or hitting a GitHub edge/WAF rule specific to this request path/session, rather than a client-side network intercept.
Expected behavior
/delegate's pre-flight check should succeed using the same authenticated context that other CLI operations (e.g., tool calls to gh api) use successfully.
Suggested area to check
The HTTP client used specifically for STAGE 1: UncommittedChangesCheck — likely missing/invalid User-Agent header on outgoing request, or the request identity differs from the normally-authenticated gh-based path.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
在 GroupiSP/probreg 上重現 /delegate,並檢查 STAGE 1: UncommittedChangesCheck 項目中的 ~/.copilot/logs/process-*.log。比較失敗的儲存庫請求與成功的 curl 或 gh api 請求,重點關注請求標頭以及內部 HTTP 用戶端使用的身分。使用現有的已驗證內容讓 pre-flight check 成功且不發生 403,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- github, shell
- 領域
- api, cli, networking
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 活躍
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100