Repository navigation
If you really want stop hooks in Codex, here's something I tried #14219
DMontgomery40
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I ran into a pretty ugly automation-integrity problem in a real Codex setup and ended up hardening it locally.
Public writeup:
https://gist.github.com/DMontgomery40/f11535bb6e458d8a25018e996504f10e
Short version:
notify, but not a true blocking stop-hook equivalentstop_hookconfig that runs synchronously before turn completion, receives the full hook payload JSON on stdin, and aborts completion on nonzero exitcodexbinary would reject an unknown global config key, I had to inject the hook throughcodex exec -c 'stop_hook=[...]'instead of safely dropping it straight into~/.codex/config.tomlcodex exec, while preserving originator identity withexport CODEX_INTERNAL_ORIGINATOR_OVERRIDE="Codex Desktop"The broader point is the one I want to put on the record:
If OpenAI accepted good external PRs instead of rejecting uninvited PRs outright, Codex users as a whole could plausibly be safer from reward hacking and fake-green automation behavior like this. This kind of stop-hook / automation-integrity work is exactly the sort of thing that should have a real path upstream when it is concrete, test-backed, and broadly useful.
Requests:
I have not opened an upstream PR. The gist above documents the local patch, the operational mess around it, the workarounds, and the exact failure modes that motivated it.
All reactions