Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

permissionRequest hook: the input payload is not documented

Abierto Apto para principiantes
#46,334 1 comentario 0 reacciones 0 asignados Ver en GitHub

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

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

builder persona content copilot

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 (bash on Unix, powershell on Windows).
  • toolInput — the arguments for that tool; for shell tools the command is toolInput.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:

  • permissionRequest does not fire for the read and hook permission kinds.
  • Exit code 2 denies; any other non-zero exit is logged and falls through (fail-open), unlike preToolUse, 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

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de github/docs

Todos los issues de github/docs

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.