Skip to content

Codex activity hooks fail on Windows because bare bash resolves to WSL #4007

Description

@McNultyyy

Summary

The Codex-native activity hooks added via #3364 can fail repeatedly on Windows because the plugin manifest invokes bare bash and provides no commandWindows override.

Affected lifecycle events can surface:

Hook failed
  └ hook exited with code 1

Reproduction

The active inline hooks in plugins/worktrunk/.codex-plugin/plugin.json use commands shaped like:

bash $PLUGIN_ROOT/hooks/wt.sh config state marker set 🤖 || true

On Windows, bare bash can resolve to the WSL launcher rather than Git Bash. In a sandboxed Codex session, that launcher fails to start with:

Access is denied.
Error code: Bash/Service/CreateInstance/E_ACCESSDENIED

Git Bash works when addressed explicitly. Because the hooks are trusted and enabled, the failure repeats across prompt, permission, stop, and session lifecycle events.

Expected

The Codex plugin hooks should work on Windows without depending on which bash.exe wins PATH resolution. Optional marker failures should not produce repeated hook-failure banners.

Codex supports a Windows-only commandWindows override for command hooks: https://learn.chatgpt.com/docs/hooks

A Windows handler could use PowerShell/direct git-wt.exe, or explicitly launch Git Bash. It should avoid bare wt.exe, since that name resolves to Windows Terminal on Windows, and preserve the current best-effort/non-blocking marker behavior.

Relationship to existing issues

#3362 identified accidental Claude-hook discovery in Codex, and #3364 introduced the current Codex-native inline hooks. This is a follow-up specific to Windows command execution; neither issue covers commandWindows, WSL Bash resolution, or this failure mode.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions