Built-in skill `github-pr-media` cannot run: `gh auth token` is empty in a cloud agent session, and the endpoint rejects `Bearer`
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 75/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- github-actions, shell
調査の方向性
builtin-skills/github-pr-media/SKILL.md を確認してください。この issue は 3 つの欠陥を説明しています:Authorization ヘッダーが間違ったスキームとトークンソースを使用している、最終的な PR 編集ステップに追加のスコープが必要である、未使用の環境変数がある。まず、curl コマンドと gh pr edit 呼び出しを確認するためにスキルファイルを読んでください。提案された修正をテストします:'Bearer $(gh auth token)' を 'token $GITHUB_COPILOT_API_TOKEN' に変更し、gh pr edit を gh api --method PATCH に置き換えます。copilot_swe_agent_use_attachment_proxy がコードベースのどこかで参照されているか確認してください。スキルをエンドツーエンドで実行して、変更がクラウドエージェントセッションで機能することを確認します。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
The runtime ships builtin-skills/github-pr-media/SKILL.md. Run as written inside a Copilot cloud agent session, it fails at every step. A session can attach media - its own credential works -but not by following this skill.
Fault 1 - the authorization line is wrong twice
-H "Authorization: Bearer $(gh auth token)"
gh auth tokenreturns nothing in a session.GH_TOKEN,GITHUB_TOKENandGH_ENTERPRISE_TOKENare all unset, andgh auth statusreports the default token as invalid.Beareris the wrong scheme for this endpoint. It answers404 Not Found, which reads as a missing endpoint rather than a wrong header.
Fault 2 - the final step needs a scope the session does not have
The skill finishes with gh pr edit --body-file -. That always requests the reviewRequests field, so it needs read:org. See cli/cli #13575, still open. gh api --method PATCH repos/{owner}/{repo}/pulls/{n} has no such requirement.
What actually works
A session holds GITHUB_COPILOT_API_TOKEN, a ghu_ GitHub App user-to-server token, and the attachment endpoint accepts it:
curl --fail-with-body -sS -X POST "$GITHUB_UPLOADS_URL" \
--url-query "name=e.png" --url-query "content_type=image/png" \
--url-query "repository_id=$GITHUB_REPOSITORY_ID" \
-H "Content-Type: application/octet-stream" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Authorization: token $GITHUB_COPILOT_API_TOKEN" \
--data-binary @e.png
HTTP/2 201
{"url":"https://<host>/user-attachments/assets/<uuid>"}
Six variants in one session, changing only the Authorization header:
| Credential | Scheme | Answer |
|---|---|---|
GITHUB_COPILOT_API_TOKEN |
Bearer |
HTTP/2 404 |
GITHUB_COPILOT_API_TOKEN |
token |
HTTP/2 201 |
COPILOT_SDK_AUTH_TOKEN |
Bearer |
HTTP/2 404 |
COPILOT_SDK_AUTH_TOKEN |
token |
HTTP/2 201 |
GITHUB_VERIFICATION_TOKEN |
Bearer |
HTTP/2 404 |
| none | - | HTTP/2 404 |
The whole route then ran end to end in one session: make a PNG, open a draft pull request, upload, place the URL in the description with the harness tool, delete the file from the branch. The capture still renders, because the asset does not live in the repository.
Fault 3 - a flag that names nothing
The session environment carries copilot_swe_agent_use_attachment_proxy=true. I tested every local listener looking for what it selects. The Copilot API proxy answers 403 and the git credential proxy answers 406, and nothing in the runtime bundle reads that variable. Either wire it up or drop it, because it reads like a supported route and is not one.
What I ask for
- Change the skill to
Authorization: token $GITHUB_COPILOT_API_TOKEN. - Change its final step to
gh api --method PATCH, or to the harness tool that writes the description. - Remove or implement
copilot_swe_agent_use_attachment_proxy.
Related: cli/cli refuses ghu_ in --attach for the same endpoint, which is the other half of why this looks unreachable. I filed that separately in #14495
Affected version
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
Additional context
No response
- 主要言語
- Shell
- スター
- 11.2k
- フォーク
- 1.9k
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 6
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/copilot-cli のほかの issue
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
github/copilot-cli#4909 ·
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
github/copilot-cli#4906 ·
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
github/copilot-cli#4848 ·
-
area:agents area:mcp
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
github/copilot-cli#4729 ·
-
area:sessions
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
github/copilot-cli#4712 ·
github/copilot-cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
elastic/gradle-plugins#156 ·
-
Priority/High ready-for-agent Severity/Major Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
comp/cli P3 type/docs
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
NousResearch/hermes-agent#119756 · コメント 1 件 ·
-
comp: build/pipeline type: bug version: current (v17+)
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
angular/angularfire#3766 ·
-
out-of-date
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
CachyOS/CachyOS-PKGBUILDS#1903 ·