github / github/copilot-cli

Steering message in `preToolUse` "ask" denial is silently dropped

Aperta
#4,237 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
area:permissions
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

### Describe the bug

When `preToolUse` returns `permissionDecision: 'ask'`. the CLI shows a specialized permission prompt for the tool that includes any rationale the hook returned, along with a confirm/deny prompt.

The deny prompt allows custom text, similar to the standard `permissionRequest` prompt.

However, this custom text does not make it back to the session, so no steering is possible.

Image

Image

### Affected version

1.0.74-4

### Steps to reproduce the behavior

1. Scaffold a basic project with `.github\hooks` and one file:

**.github\hooks\pre-tool-use-demo.json**

```json
{
"version": 1,
"hooks": {
"preToolUse": [
{
"type": "command",
"powershell": "'{\"permissionDecision\":\"ask\",\"permissionDecisionReason\":\"preToolUse Demo: Allow the agent to use a tool?\"}'",
"cwd": ".",
"timeoutSec": 10
}
]
}
}
```

2. Invoke `copilot` inside of the scaffolded "project".
3. Ask the session to use any tool, e.g.

```md
Please use your `view` tool to read `.github/hooks/pre-tool-use-demo.json`
```

4. Deny the prompt with a steering message, such as "Please confirm you see this response"
5. Observe that the custom steering message is not passed to the agent

### Expected behavior

The steering message should be passed to the agent, allowing correcting behavior via HITL.

### Additional context

_No response_

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo il problema con .github/hooks/pre-tool-use-demo.json e una richiesta dello strumento, quindi segui come viene gestito il rifiuto di preToolUse ask. Il lavoro è concluso quando il testo di rifiuto personalizzato viene restituito all’agente come messaggio di indirizzamento.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
powershell
Ambito
cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Specificata chiaramente
Idoneità per principianti
68/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.