CLI cannot execute hooks shipped with plugins
- Lingua principale
- Shell
- Stelle
- 11.2k
- Fork
- 1.9k
- Merge medio
- 14h 16m
- PR unite (30g)
- 6
Descrizione
### 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)
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Riprodurre su Windows con un plugin che fornisce hook, concentrandosi sul modo in cui la CLI invoca i file .ps1 forniti dal plugin tramite pwsh. Confrontare l’invocazione che fallisce con l’uso di pwsh registrato e verificare che un prompt venga completato senza eccezioni dell’hook preToolUse.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- powershell
- Ambito
- cli
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 55/100