fix(review-gate): name disable command in stop-hook infra failure messages - #573
fix(review-gate): name disable command in stop-hook infra failure messages#573SomSamantray wants to merge 2 commits into
Conversation
…sages When the stop-review gate blocks on infrastructure failures, operators only see the hook reason string. Include /codex:setup --disable-review-gate in every infra fail-closed path and export parseStopReviewOutput for tests. Guard CLI entry so importing the hook module does not block on stdin. Closes openai#483
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 007c160a5e
ℹ️ 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".
| if (!invoked) { | ||
| return false; | ||
| } | ||
| return path.resolve(invoked) === path.resolve(fileURLToPath(import.meta.url)); |
There was a problem hiding this comment.
Resolve symlinks before checking the CLI entry
When this hook is invoked through a symlink, such as from a symlinked plugin checkout, Node resolves import.meta.url to the real script while retaining the symlink path in process.argv[1]. This comparison therefore returns false, causing the process to exit successfully without reading the hook input or enforcing stopReviewGate. Compare canonical real paths or move the exported parser into a side-effect-free module instead.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in bfc39e1: \isCliEntry()\ now compares realpath-canonical paths via
esolveCanonicalPath(), with symlink regression tests in \ ests/stop-review-gate-hook.test.mjs.
Compare realpath-canonical argv and module paths so symlinked plugin checkouts still run the stop hook. Adds regression tests for isCliEntry.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
When
stopReviewGateis enabled, infrastructure failures (timeout, empty output, bad JSON, task crash) blocked session exit with “bypass the gate” but never named/codex:setup --disable-review-gate, leaving operators stuck in a fail-closed loop.Centralize the escape hint in
STOP_GATE_MANUAL_OR_BYPASS_HINTand append it to all infra fail-closed paths instop-review-gate-hook.mjs. CodexBLOCK:findings are unchanged — those require fixing review issues, not disabling the gate. Added anisCliEntry()guard so importing the hook for tests no longer hangs on stdin.node --test tests/stop-review-gate-hook.test.mjs— 4/4 pass.Fixes #483