Skip to content

fix: leave Stop-hook headroom so a timed-out review gate can report - #772

Open
kevin9327 wants to merge 1 commit into
openai:mainfrom
kevin9327:fix/stop-review-timeout-headroom
Open

kevin9327 wants to merge 1 commit into
openai:mainfrom
kevin9327:fix/stop-review-timeout-headroom

Conversation

@kevin9327

Copy link
Copy Markdown

Problem

The Stop hook is declared with a 900s timeout in hooks.json, and the review child it spawns used the same 900s spawnSync timeout. The hook starts first, so Claude Code kills it while the child is still inside its own window. The only stdout write happens after spawnSync returns, so a genuinely slow review ends the turn with no message instead of the intended "run /codex:review --wait or bypass the gate" reason.

Change

Lower STOP_REVIEW_TIMEOUT_MS to 14 minutes so the hook has 60s of headroom to emit the existing ETIMEDOUT path. Update the timeout message to match.

Test

stop-review task timeout leaves headroom under the Stop hook timeout fails on main (inner === hook) and passes after this change.

Fixes #766.

AI-assisted (Grok)

The stop-review child timeout matched the Stop hook's 900s budget, so
Claude Code killed the hook before it could emit the ETIMEDOUT reason.
Lower the inner spawnSync timeout to 14 minutes so a slow review still
returns the bypass/manual-review message instead of ending the turn
silently.

Fixes openai#766.
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: review timeout equals the hook's own 900s timeout, so a slow review ends the turn with no message

1 participant