Skip to content

Add Windows hook command overrides#22159

Merged
abhinav-oai merged 7 commits into
mainfrom
abhinav/platform-hook-commands
May 11, 2026
Merged

Add Windows hook command overrides#22159
abhinav-oai merged 7 commits into
mainfrom
abhinav/platform-hook-commands

Conversation

@abhinav-oai
Copy link
Copy Markdown
Collaborator

@abhinav-oai abhinav-oai commented May 11, 2026

Why

Managed hook configs need a shared cross-platform shape without making the existing command field polymorphic. The common case is still one command string, with Windows needing a different entrypoint only when the runtime is actually Windows.

Keeping command as the portable/default path and adding an optional Windows override keeps the config easier to read, preserves the existing scalar shape for non-Windows users, and avoids forcing every caller into a { unix, windows } object when only one platform needs special handling.

What

  • Add optional command_windows / commandWindows alongside the existing hook command field.
  • Resolve command_windows only on Windows during hook discovery; other platforms continue to use command unchanged.
  • Keep trust hashing aligned to the effective command selected for the current runtime.

Docs

The Codex hooks/config reference should document command_windows as the Windows-only override for command hooks.

@abhinav-oai abhinav-oai changed the title [codex] Add platform-specific hook commands Add platform-specific hook commands May 11, 2026
@abhinav-oai abhinav-oai marked this pull request as ready for review May 11, 2026 14:49
@abhinav-oai abhinav-oai requested a review from a team as a code owner May 11, 2026 14:49
@abhinav-oai
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@abhinav-oai abhinav-oai changed the title Add platform-specific hook commands Add Windows hook command overrides May 11, 2026
@eternal-openai
Copy link
Copy Markdown
Contributor

#[serde(default, rename = "commandWindows", alias = "command_windows")]

Please add camelCase / hooks.json friendly commandWindows as an alias for this, since we allow camelCase in our tomls

@abhinav-oai abhinav-oai enabled auto-merge (squash) May 11, 2026 21:59
@abhinav-oai abhinav-oai merged commit 9ab7f4e into main May 11, 2026
26 of 27 checks passed
@abhinav-oai abhinav-oai deleted the abhinav/platform-hook-commands branch May 11, 2026 22:22
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants