LearnNewsExamplesServices
Frontmatter
titlefix(codex): activate stop hook blocking (#13661)
authorneo-gpt
stateMerged
createdAtJun 20, 2026, 10:42 PM
updatedAtJun 20, 2026, 10:53 PM
closedAtJun 20, 2026, 10:53 PM
mergedAtJun 20, 2026, 10:53 PM
branchesdevcodex/13661-codex-stop-blocking
urlhttps://github.com/neomjs/neo/pull/13662
Merged
neo-gpt
neo-gpt commented on Jun 20, 2026, 10:42 PM

Resolves #13661

Summary: Activates the Codex Stop hook in enforcement mode instead of dry-run mode. The committed hook config now exports NEO_CODEX_LANE_STATE_ENFORCE=1, the Codex hook reports real decision: "block" output when a turn-terminal message lacks operator-prompt evidence, and the focused Codex hook tests assert the blocking path through the spawned hook.

Related: #13623, #13624, #13655, #13657, #13659, #13660

Evidence: L2 (focused unit coverage + spawned-hook stdout/block-log validation in sandbox) -> L3 required post-merge, because final proof is a restarted Codex harness receiving a Stop event and refusing an invalid autonomous turn-end.

Deltas

  • None. This is the direct P0 activation lane for Codex Stop-hook blocking; hook-internal read/parse failures remain fail-open and audit-only.

Test Evidence

  • node --check .codex/hooks/codex-lane-state-stop.mjs
  • node --check test/playwright/unit/hooks/codexLaneStateStopHook.spec.mjs
  • npm run test-unit -- test/playwright/unit/hooks/codexLaneStateStopHook.spec.mjs
  • npm run test-unit -- test/playwright/unit/hooks/codexLaneStateStopHook.spec.mjs test/playwright/unit/hooks/laneStateStopHook.spec.mjs
  • npm run test-unit -- test/playwright/unit/hooks/codexLaneStateStopHook.spec.mjs test/playwright/unit/hooks/laneStateStopHook.spec.mjs test/playwright/unit/ai/scripts/lifecycle/stopHookDecision.spec.mjs
  • Manual enforced spawned-hook check:
    • NEO_CODEX_LANE_STATE_ENFORCE=1 NEO_AI_DAEMON_DIR=/private/tmp/codex-stop-hook-manual-13661-rebased node .codex/hooks/codex-lane-state-stop.mjs
    • Invalid payload emitted stdout {"decision":"block",...} and wrote BLOCK to the Codex Stop-hook audit log.

Post-Merge Validation

  • Restart Codex from dev, trigger an invalid autonomous Stop, and confirm the hook blocks the turn instead of accepting dry-run termination.

Commit:

  • 0e77b9010 - fix(codex): activate stop hook blocking (#13661)

Authored by Euclid (GPT-5 Codex, Codex Desktop). Session 810318e6-b644-474e-a255-a07d19825aa5.

github-actions commented on Jun 20, 2026, 10:42 PM

🚨 Agent PR Body Lint Violation

@neo-gpt — your PR body on PR #13662 does not match the pull-request template structure.

Required action: read .agents/skills/pull-request/SKILL.md BEFORE editing the PR body. The skill points at:

  • Minimum-viable PR body structure: .agents/skills/pull-request/references/pull-request-workflow.md §9
  • Self-Identification mandate: .agents/skills/pull-request/references/pull-request-workflow.md §5

Do NOT compose a substitute template or hallucinate section headings. The validator checks more structural anchors than this comment names. The only reliable path to passing is reading the actual workflow file and following its structure.

Diagnostic hint: at least one recognized anchor like ## Test Evidence is missing.

Visible anchors missing (full list)
  • ## Test Evidence
  • ## Post-Merge Validation

This is the CI tool-boundary lint companion to PR #11494's MCP manage_pr_review validator and PR #11502's agent-pr-review-body-lint.yml reviewer-side lint. Resolves #11501.


tobiu
tobiu APPROVED reviewed on Jun 20, 2026, 10:53 PM

No review body provided.