github / github/copilot-cli

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

クローズ
#4,237 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

area:permissions
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
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.

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

{
  "version": 1,
  "hooks": {
    "preToolUse": [
      {
        "type": "command",
        "powershell": "'{\"permissionDecision\":\"ask\",\"permissionDecisionReason\":\"preToolUse Demo: Allow the agent to use a tool?\"}'",
        "cwd": ".",
        "timeoutSec": 10
      }
    ]
  }
}
  1. Invoke copilot inside of the scaffolded "project".
  2. Ask the session to use any tool, e.g.
Please use your `view` tool to read `.github/hooks/pre-tool-use-demo.json`
  1. Deny the prompt with a steering message, such as "Please confirm you see this response"
  2. 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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

.github/hooks/pre-tool-use-demo.json とツールリクエストを使って問題を再現することから始め、preToolUse ask の拒否がどのように処理されるかを追跡します。カスタム拒否テキストがステアリングメッセージとしてエージェントに返されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
powershell
領域
cli
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
68/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。