Skip to content

fix(review-gate): name disable command in stop-hook infra failure messages - #573

Open
SomSamantray wants to merge 2 commits into
openai:mainfrom
SomSamantray:fix/483-stop-gate-escape-hint
Open

fix(review-gate): name disable command in stop-hook infra failure messages#573
SomSamantray wants to merge 2 commits into
openai:mainfrom
SomSamantray:fix/483-stop-gate-escape-hint

Conversation

@SomSamantray

Copy link
Copy Markdown

When stopReviewGate is 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_HINT and append it to all infra fail-closed paths in stop-review-gate-hook.mjs. Codex BLOCK: findings are unchanged — those require fixing review issues, not disabling the gate. Added an isCliEntry() 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

…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
@SomSamantray
SomSamantray requested a review from a team July 31, 2026 06:36

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@SomSamantray

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: bfc39e1d6c

ℹ️ 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".

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.

stop-review-gate-hook.mjs: fail-closed reason strings do not mention the /codex:setup --disable-review-gate escape valve

1 participant