openai / openai/codex-plugin-cc

Stop-review gate hook loops until CLAUDE_CODE_STOP_HOOK_BLOCK_CAP (missing `stop_hook_active` guard)

Open Beginner friendly
#548 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
33.3k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

File: scripts/stop-review-gate-hook.mjs (v1.0.6)

Problem

When stopReviewGate is enabled, main() runs the review and emits {"decision":"block"} whenever the review is not ok — including the non-ok cases where the review task returns no output, times out (15 min), fails, or returns invalid JSON.

After a Stop hook blocks, Claude Code re-runs the turn with stop_hook_active: true in the hook input. This hook never checks that flag, so it re-runs the review and blocks again on every retry. The result is the harness message:

A hook blocked the turn from ending 9 consecutive times — overriding and ending turn. For Stop/SubagentStop hooks, check stop_hook_active in the input and return success while it's true.

The failure is worst in exactly the cases the gate is least useful — a Codex review that errors or times out blocks the session 9× before the cap force-ends it.

Fix

Honor stop_hook_active before running the blocking review:

if (input.stop_hook_active) {
  logNote(runningTaskNote);
  return;
}

const review = runStopReview(cwd, input);

This lets the gate review once; on the harness's forced retry it returns success instead of blocking again.

codex-companion.mjs has the same config.stopReviewGate branch — worth auditing it for the same issue.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in scripts/stop-review-gate-hook.mjs at main() and inspect the stopReviewGate review path, then audit the corresponding branch in codex-companion.mjs. Verify that stop_hook_active is handled before the blocking review and that a forced retry no longer reruns and blocks the review.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
devtools
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.