Skip to content

fix(codex): skip bash-only write gate on Windows#149

Open
Classy-Bear wants to merge 1 commit into
PostHog:mainfrom
Classy-Bear:fix/codex-windows-pretooluse-hook
Open

fix(codex): skip bash-only write gate on Windows#149
Classy-Bear wants to merge 1 commit into
PostHog:mainfrom
Classy-Bear:fix/codex-windows-pretooluse-hook

Conversation

@Classy-Bear

Copy link
Copy Markdown

Summary

  • add a Windows-specific command override for the PostHog PreToolUse write gate
  • skip the Bash-only gate on Windows Codex, matching the gate script's existing Codex early-exit behavior
  • add a regression test for the hook configuration

Why

On Windows, Codex attempts to launch hooks/gate-exec-write.sh before the script can inspect PLUGIN_ROOT and take its intended Codex no-op path. Depending on shell resolution, that surfaces as:

PreToolUse hook (failed)
hook exited with code 1

The script already deliberately exits successfully under Codex because Codex uses its own approval flow and does not support the hook's permissionDecision: ask response. commandWindows makes that no-op explicit and avoids requiring Bash just to reach the early exit. Claude Code and non-Windows behavior remain unchanged.

Related: #115 proposes a dedicated Codex approval hook. This change is a narrow fix for the current hook configuration and Windows installations.

Validation

  • Windows Codex 0.144.1 live smoke: PreToolUse Completed, followed by a successful PostHog MCP exec call
  • tests/test_gate_exec_write.sh: 45 passed
  • Python suite including the new config regression: 72 passed
  • JSON parse and git diff --check: passed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant