CLI cannot execute hooks shipped with plugins
- Ngôn ngữ chính
- Shell
- Star
- 11.2k
- Fork
- 1.9k
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
### Describe the bug
As of 1.0.57, I am unable to issue any prompts to GHCP CLI w/o them failing on preToolUse hook exceptions.
Logs show myriad failures like:
```plaintext
2026-06-03T18:51:15.906Z [DEBUG] [hook stderr] The argument '.github/hooks/governance-audit/audit-session-start.ps1' is not recognized as the name of a script file. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
2026-06-03T18:51:15.907Z [DEBUG] [hook stdout]
Usage: pwsh[.exe] [-Login] [[-File] [args]]
[-Command { - | [-args ]
| [] } ]
[-CommandWithArgs []
[-ConfigurationName ] [-ConfigurationFile ]
[-CustomPipeName ] [-EncodedCommand ]
[-ExecutionPolicy ] [-InputFormat {Text | XML}]
[-Interactive] [-MTA] [-NoExit] [-NoLogo] [-NonInteractive] [-NoProfile]
[-NoProfileLoadTime] [-OutputFormat {Text | XML}]
[-SettingsFile ] [-SSHServerMode] [-STA]
[-Version] [-WindowStyle ]
[-WorkingDirectory <directoryPath>]
pwsh[.exe] -h | -Help | -? | /?
PowerShell Online Help https://aka.ms/powershell-docs
All parameters are case-insensitive.
2026-06-03T18:51:16.068Z [ERROR] Hook execution failed: HookExitCodeError: Hook command failed with code 1
```
across numerous hook files.
### Affected version
1.0.57+
### Steps to reproduce the behavior
Install one or more plugins (which ship hooks as part of their functionality) into the CLI.
Send a prompt to the CLI with the plugin active & loaded
### Expected behavior
Prompt is processed
### Additional context
I have my Copilot Home and cache dirs set to my dev drive (`d:\.copilot` and `d:\.copilot\cache`, respectively)
Hướng dẫn đóng góp
Hướng nghiên cứu
Reproduce on Windows with a plugin that ships hooks, focusing on how the CLI invokes plugin-provided .ps1 files through pwsh. Compare the failing invocation with the logged pwsh usage and verify that a prompt completes without preToolUse hook exceptions.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- powershell
- Lĩnh vực
- cli
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 55/100