Steering message in `preToolUse` "ask" denial is silently dropped
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
### 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.
### 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_
贡献指南
调研方向
首先使用 .github/hooks/pre-tool-use-demo.json 和工具请求重现该问题,然后跟踪 preToolUse ask 拒绝的处理方式。当自定义拒绝文本作为引导消息传回 agent 时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- powershell
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 描述清楚
- 新手友好度
- 68/100