permissionRequest hook: the input payload is not documented
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 1/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 72/100
- Tipo de issue
- Documentação
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- json, markdown
- Domínio
- documentation
Direção de pesquisa
O material que falta pertence a hooks-reference.md, ao lado da seção existente "Hook event input payloads", que cobre de sessionStart até agentStop. Leia como essas subseções estão organizadas e depois adicione uma subseção permissionRequest com os campos de payload listados na issue. Está concluído quando a página documenta toolName, toolInput e permissionSuggestions com os valores bash e powershell, e as notas de comportamento foram conferidas com o repro da issue.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 21k
- Forks
- 69.1k
- Merge médio
- 10h 32min
- PRs com merge (30d)
- 103
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de github/docs
-
triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
github/docs#46365 · 3 comentários · 2 reações ·
Mantenedores costumam responder em até 1 dia
-
triage
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
github/docs#46354 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Incorrect Auto Tier Availability Information in Copilot DocumentationTalvez já em andamento @ashis-baral assumiu há 1 dia. Abertacontent triage
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 73/100
Mantenedores costumam responder em até 1 dia
-
Update VS Code instructions for creating a prompt fileTalvez já em andamento @ashis-baral assumiu há 5 dias. Abertacontent
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
actions builder persona
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
github/docs#46304 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de github/docs
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
OpenPetsHQ/openpets#273 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
fritzprix/libr-agent#2161 ·
Mantenedores costumam responder em até 1 dia
-
macOS: clicking a menu item that has a submenu closes the menu instead of opening the submenuAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
blackboardsh/electrobun#581 ·
-
backlog-skill effort:xs frontend infra ready-for-agent
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
LucasSantana-Dev/Lucky#2862 ·
Mantenedores costumam responder em até 1 dia