Describe the bug
Starting around CLI version 1.0.51, extension lifecycle hooks (onSessionStart, onPreToolUse, onUserPromptSubmitted) receive an empty string "" for workingDirectory in the hook input.
Previously (CLI 1.0.49 and earlier), the hook input contained the actual working directory path where the CLI session was started.
Affected version
1.0.51, 1.0.52, 1.0.53, 1.0.54
Steps to reproduce the behavior
- Create an extension that uses the working directory in any lifecycle hook:
export function joinSession(session) {
return {
hooks: {
onSessionStart: (input) => {
// input.workingDirectory is "" instead of the actual path
if (!input.workingDirectory) {
throw new Error("workingDirectory is empty");
}
}
}
};
}
- Start a Copilot CLI session (v1.0.51+) in any directory
input.workingDirectory is "" (empty string)
Expected behavior
input.workingDirectory should contain the actual working directory path (e.g., C:\Users\me\my-project or /home/me/my-project), matching the BaseHookInput type definition in the SDK.
Additional context
- Operating system: Windows 11, x86_64
- Terminal emulator: Windows Terminal
- Shell: PowerShell
Describe the bug
Starting around CLI version 1.0.51, extension lifecycle hooks (
onSessionStart,onPreToolUse,onUserPromptSubmitted) receive an empty string""forworkingDirectoryin the hook input.Previously (CLI 1.0.49 and earlier), the hook input contained the actual working directory path where the CLI session was started.
Affected version
1.0.51, 1.0.52, 1.0.53, 1.0.54
Steps to reproduce the behavior
input.workingDirectoryis""(empty string)Expected behavior
input.workingDirectoryshould contain the actual working directory path (e.g.,C:\Users\me\my-projector/home/me/my-project), matching theBaseHookInputtype definition in the SDK.Additional context