entireio / entireio/cli

Copilot CLI generated hooks are bash-only and failed silently on Windows with WSL installed

Open Beginner friendly
#1,675 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
5.1k
Forks
475
Avg merge
1d 11h
Merged PRs (30d)
178

Description

What happened?

Copilot CLI: generated hooks are bash-only — on Windows with WSL installed they execute inside WSL, and commits never get the Entire-Checkpoint trailer

What happened?

entire agent add copilot-cli writes .github/hooks/entire.json entries with only a bash key:

{
  "type": "command",
  "bash": "sh -c 'if ! command -v entire >/dev/null 2>&1; then exit 0; fi; exec entire hooks copilot-cli agent-stop'",
  "comment": "Entire CLI"
}

Copilot CLI hooks support a powershell key for Windows, and Copilot picks the key matching the OS. With no powershell key, Copilot on Windows falls back to the bash command. On a machine with WSL installed, bash resolves to C:\Windows\System32\bash.exe (WSL launcher, precedes Git Bash on PATH), so the hook runs inside the WSL distro — different entire binary, different HOME, different path namespace.

Consequences, all silent:

  • Session state gets worktree_path: /mnt/c/Users/... while git commit invokes Windows entire.exe, which computes C:/Users/.... The exact-string match in findSessionsForWorktree never matches → PrepareCommitMsg logs "no active sessions" (debug only) → Entire-Checkpoint trailer never attached, no visible error.
  • Transcript ref built against Linux $HOME/.copilot/session-state/... which doesn't exist (real one under C:\Users<user>.copilot...) → failed to initialize session state warnings.

Asymmetry worth noting: on Windows without WSL, bash falls through to Git Bash and everything works. Installing WSL breaks the integration.

Suggested fix — Emit powershell alongside bash:

"powershell": "if (-not (Get-Command entire -ErrorAction SilentlyContinue)) { exit 0 }; $input | & entire hooks copilot-cli agent-stop; exit $LASTEXITCODE"

Verified end-to-end on the affected machine: with that key, session records the Windows path and the trailer attaches. Codex hooks already got Windows-native wrappers (WrapWindowsProductionSilentHookCommand); Copilot's generator (cmd/entire/cli/agent/copilotcli/hooks.go) still emits Bash only.

Follow-up suggestion: normalize /mnt// ↔ :/ in the worktree match, or warn when an active session's path style mismatches the current side — any WSL-mixed workflow currently fails silently.

Steps to reproduce
  1. Windows 11 + WSL installed
  2. entire installed both sides
  3. in a C:\ repo :
    a. entire enable
    b. entire agent add copilot-cli
  4. run copilot from Windows shell, and edit some files
  5. commit;
  • git log -1 --format=%B shows no trailer;
  • .git/entire-sessions/.json shows /mnt/c/... worktree;
  • ENTIRE_LOG_LEVEL=debug shows prepare-commit-msg: no active sessions.

Expected — Hooks on Windows execute native entire.exe so session worktree path matches git's view at commit time.

Entire CLI version

Entire CLI 0.7.7 Go version: go1.26.4 OS/Arch: windows/amd64

OS and architecture

Windows 11 + WSL2 Ubuntu

Agent

Copilot CLI

Terminal

Windows Terminal - Powershell

Logs / debug output

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in cmd/entire/cli/agent/copilotcli/hooks.go and compare the existing Codex Windows-native wrapper with the generated Copilot CLI hook. Add the Windows powershell entry alongside bash, then follow the Windows 11 + WSL2 reproduction steps and confirm the hook uses native entire.exe and the commit receives an Entire-Checkpoint trailer.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, powershell
Domain
cli, devtools
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.