permissionRequest hook: the input payload is not documented
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- json, markdown
調査の方向性
不足している内容は hooks-reference.md に追加してください。既存の「Hook event input payloads」セクション(sessionStart から agentStop までを扱う)の隣が適切です。それらのサブセクションの構成を読み、issue に記載された payload フィールドを使って permissionRequest のサブセクションを追加してください。ページに bash と powershell の値を含めて toolName、toolInput、permissionSuggestions が文書化され、動作に関する注記が issue の再現手順と照らし合わせて確認されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
What is missing
hooks-reference.md has a "Hook event input payloads" section that documents the stdin payload for sessionStart, sessionEnd, userPromptSubmitted, userPromptTransformed, preToolUse, postToolUse, postToolUseFailure and agentStop. permissionRequest is not among them, and it has no payload subsection anywhere else on the page.
Why it matters
permissionRequest is the only hook that can pre-approve a tool call — returning {"behavior":"allow"} short-circuits the permission service. Its decision-control section tells you to return behavior / message / interrupt, but to write a useful hook you need the tool name and the tool input, and neither field is documented. You have to discover them by writing a hook that dumps stdin to a file, which is how I obtained the payload below.
Payload actually received (CLI 1.0.98, Windows; toolName is powershell on Windows and bash on Unix):
{
"hookName": "permissionRequest",
"sessionId": "…",
"timestamp": 1792065216069,
"cwd": "C:\\src\\my-repo",
"toolName": "powershell",
"toolInput": { "command": "git status" },
"permissionSuggestions": []
}
Suggested addition — a subsection alongside the other events:
permissionRequest{ "hookName": "permissionRequest", "sessionId": "...", "timestamp": 0, "cwd": "/path/to/repo", "toolName": "bash", "toolInput": { "command": "git status" }, "permissionSuggestions": [] }
toolName— the tool being requested (bashon Unix,powershellon Windows).toolInput— the arguments for that tool; for shell tools the command istoolInput.command.permissionSuggestions— the permission rules the CLI would otherwise offer to save.
Two behaviours worth documenting on the same page, if they are not already:
permissionRequestdoes not fire for thereadandhookpermission kinds.- Exit code
2denies; any other non-zero exit is logged and falls through (fail-open), unlikepreToolUse, which is fail-closed. Timeouts are fail-open for every event.
Repro to capture the payload
{
"hooks": {
"permissionRequest": [
{ "type": "command", "bash": "cat > /tmp/perm-payload.json" }
]
}
}
Then run any shell tool and read /tmp/perm-payload.json.
- 主要言語
- TypeScript
- スター
- 21k
- フォーク
- 69.1k
- 平均マージ
- 10時間 32分
- マージ済み PR(30日)
- 103
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/docs のほかの issue
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
github/docs#46365 · コメント 3 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
github/docs#46354 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Incorrect Auto Tier Availability Information in Copilot Documentation対応中かも @ashis-baral が 2 日前に担当しました。 オープンcontent triage
難易度 1/5 1時間未満 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
Update VS Code instructions for creating a prompt file対応中かも @ashis-baral が 5 日前に担当しました。 オープンcontent
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
actions builder persona
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
github/docs#46304 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
radix-ui/primitives#4228 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
SignalK/freeboard-sk#1093 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
[测试] 等待仓库加载后再记录多仓库排序基线対応中かも @myot233 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信