Skip to content

Copilot harness does not respect existing hooks #342664

Closed

Description

Description

It appears that the "Copilot" harness uses Copilot-style hooks, and as such existing VS Code-style hooks stop working with the new harness.

Repro steps

You'll need to adjust these steps for non-Windows systems, but this is not a Windows-specific issue.

  1. Create a new workspace.
  2. Add the following to .github\hooks\test.json:
    {
      "hooks": {
        "SessionStart": [
          {
            "type": "command",
            "windows": "powershell.exe -NoProfile -NonInteractive -Command \"Add-Content -LiteralPath (Join-Path $env:TEMP 'hook-discovery.log') -Value 'SessionStart invoked'\"",
          }
        ]
      }
    }
  3. Save and close the file.
  4. Start a new chat conversation using the Copilot harness.

Expected

The text "SessionStart invoked" is written to $env:TEMP\hook-discovery.log

Actual

The hook does not run and nothing is written to the file.

Further Notes

If you replace "windows" with "powershell" in the test.json file and start a new chat, the text is written to the file. This indicates the "Copilot" harness is only using Copilot-style hooks.

Issue Details

Item Value
Issue Category Bug
Target Visual Studio Code
VS Code Version Code 1.142.0 (6d62b1d, 2026-10-15T03:02:17Z)
OS Version Windows_NT x64 10.0.26300

Additional Issue Data

issue-data.md

Activity

  1. aeschli commented on Nov 5, 2026

    @aeschli
    Contributor

    Tested with the exact SDK and runtime extracted from the official VS Code 1.145.0 macOS arm64 download (commit a717861c07586a53d83b80d742cd3f59b20a6273):

    • SDK: 1.0.27-unstable.41379698026.g3219c66
    • Runtime: 1.0.103-unstable.r41379698026.g3219c66

    In isolated SDK sessions, SessionStart hooks in .github/hooks/test.json successfully executed using osx, bash, or command. An osx override also took precedence over command. These checks verified the files written by the commands and successful hook execution events, not just discovery. Hooks ran when the first message was sent. This was a direct bundled-SDK test, not an end-to-end workbench test.

    One remaining compatibility difference: the runtime rejects comments and trailing commas, while the VS Code hook loader accepts JSONC. The example above contains a trailing comma after the command value; that must be removed for the current runtime to load the file. Both rejection cases were reproduced with the stable runtime.

    The macOS equivalent of the command-field problem therefore no longer reproduces in the latest stable bundled runtime. Windows-specific windows execution has not been verified. Please retest on VS Code 1.145.0 on Windows, removing the trailing comma and sending the first message in a new conversation, to confirm whether the original Windows symptom remains.

  2. aeschli commented on Nov 5, 2026

    @aeschli
    Contributor

    Retested on Windows x64 with the exact SDK and runtime extracted from the official latest stable VS Code 1.145.0 archive (commit a717861c07586a53d83b80d742cd3f59b20a6273). The archive's SHA-256 matched the official download metadata.

    • SDK: 1.0.27-unstable.41379698026.g3219c66
    • Runtime: 1.0.103-unstable.r41379698026.g3219c66

    In isolated SDK sessions using a local mock model endpoint:

    Test Result
    SessionStart with windows Executed successfully
    SessionStart with powershell Executed successfully
    SessionStart with command Executed successfully
    windows override alongside command Windows override executed
    Trailing comma in the hook file Rejected as invalid JSON; no hook execution
    JSON comment in the hook file Rejected as invalid JSON; no hook execution

    Successful execution was verified through both files written by the commands and successful hook.end events. Hooks ran when the first message was sent, not when the session was created.

    The original Windows command-field symptom therefore no longer reproduces in this stable bundled runtime with valid JSON. The issue's example contains a trailing comma after the command value; removing it is necessary for this runtime to load the file. JSONC compatibility remains a difference from the VS Code hook loader, which accepts comments and trailing commas.

    These were direct tests of the stable bundled SDK/runtime, not an end-to-end workbench UI test.

  3. added this to the 1.147.0 milestone on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions