Skip to content

Notification hook fires for already-approved tools in interactive mode #2586

@07JP27

Description

@07JP27

Describe the bug

Summary

The Notification hook with notification_type: "permission_prompt" fires for every tool execution in interactive mode, even when the tool
has already been approved for the session.

Actual Behavior

Notification(permission_prompt) fires on every tool execution (glob, bash, view, edit, etc.) regardless of whether the permission
prompt is shown to the user.

Affected version

GitHub Copilot CLI 1.0.21.

Steps to reproduce the behavior

  1. Add to ~/.copilot/config.json:
    {
      "hooks": {
        "Notification": [
          {
            "type": "command",
            "bash": "cat >> /tmp/copilot_noti.log",
            "timeoutSec": 5
          }
        ]
      }
    }
    
  2. Launch copilot in interactive mode
  3. Approve a tool (e.g., bash) when first prompted
  4. Continue using the same tool — no permission prompt appears in the UI
  5. Check /tmp/copilot_noti.log

Each tool execution logs a Notification event with "notification_type":"permission_prompt", even though no prompt was shown.

Expected behavior

Notification(permission_prompt) should only fire when the user is actually presented with a permission prompt — i.e., when the tool has not
yet been approved and user input is required.

Additional context

Environment

  • macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions