permissionRequest hook: the input payload is not documented
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- json, markdown
- Área
- documentation
Línea de trabajo
El material que falta debe ir en hooks-reference.md, junto a la sección existente "Hook event input payloads", que cubre desde sessionStart hasta agentStop. Lee cómo están organizados esos subapartados y luego añade un subapartado permissionRequest con los campos del payload que aparecen en el issue. Está terminado cuando la página documenta toolName, toolInput y permissionSuggestions con los valores de bash y powershell, y las notas de comportamiento se han comprobado frente al repro del issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 21k
- Forks
- 69.1k
- Merge medio
- 6 h 37 min
- PR fusionados (30 d)
- 109
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/docs
-
Update VS Code instructions for creating a prompt filePosiblemente ocupada @ashis-baral la tomó hace 2 días. Abiertocontent
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
actions builder persona
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
github/docs#46304 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
actions builder persona
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
github/docs#46303 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
actions builder persona
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
github/docs#46302 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
workflow_dispatch inputs: description, default and options are not documentedPosiblemente ocupada @kburym la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 1 día
Todos los issues de github/docs
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
bug category:ai category:devices effort:s
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
LanternOps/breeze#8943 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
area:reliability difficulty:easy help wanted points:100 Stellar Wave
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Divinity-Labs/Lens#341 · 1 comentario ·
Los mantenedores suelen responder en 1 día