Skip to content

Hooks in hooks.json fail to trigger when bundled within an Agent Plugin #302350

Open

Description

@gn00678465
  • Copilot Chat Extension Version: 0.39.1
  • VS Code Version: 1.111.0
  • OS Version: Windows_NX x64 10.0.26200
  • Feature (e.g. agent/edit/ask mode): agent
  • Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet): gpt-5-mini
  • Logs:

Description

Hooks defined in hooks.json work as expected when placed in the project root or configured via chat.hookFilesLocations. However, when the same hook logic is integrated into an Agent Plugin and loaded via chat.pluginLocations, the hooks fail to trigger during the session.

Steps to Reproduce:

  1. Verify standard Hook functionality:
    Place hooks.json in .github/hooks/hooks.json or specify the path in chat.hookFilesLocations.

    {
      "version": 1,
      "hooks": {
        "SessionStart": [
          {
            "type": "command",
            "command": "bash -lc 'cat -'",
            "windows": "powershell -Command \"[Console]::In.ReadToEnd() | Write-Output\""
          }
        ]
      }
    }

    Result: Hook output is visible in the Output channel.

  2. Create an Agent Plugin with Hooks:
    Set up a plugin directory at ~/hooks-demo with the following structure:

    • ~/hooks-demo/.github/plugin/plugin.json
    • ~/hooks-demo/hooks/hooks.json

    plugin.json content:

    {
      "name": "hook-demo",
      "description": "Agent hooks demo plugin",
      "version": "1.0.0",
      "author": { "name": "John Doe" },
      "license": "MIT"
    }
  3. Register the Plugin:
    Add the following to VS Code settings.json:

    "chat.pluginLocations": {
      "~/hooks-demo": true
    }
  4. Trigger the Agent:
    Start a new session using the "hook-demo" agent and check the Output channel.

Actual Behavior:
The hooks within the Agent Plugin are not triggered, and no output is generated in the logs.

Expected Behavior:
Hooks defined within a registered Agent Plugin should be recognized and executed, consistent with workspace-level hooks.

Image

Activity

  1. added
    chat-ext-issue
    on Mar 17, 2026
  2. removed
    chat-ext-issue
    on Mar 17, 2026
  3. connor4312 commented on Mar 23, 2026

    @connor4312
    Member

    Please update your version of VS Code, the issue should be fixed there. Thanks.

  4. added
    info-needed
    on Mar 23, 2026
  5. removed
    info-needed
    on Mar 25, 2026
  6. gn00678465 commented on Mar 25, 2026

    @gn00678465
    Author

    Ok! I will test it again in 1.112.0.

  7. removed their assignment
    on Mar 25, 2026
  8. removed their assignment
    on Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions