Codex 0.137.0 validates every hook response against embedded JSON schemas with `additionalProperties: false`, so any unrecognised key causes "hook returned invalid … JSON output" for the entire response — including `SessionStart`, `PreToolUse`, and `PostToolUse`. The root cause was `_tg_elapsed_ms` (and sibling `_tg_handler`/`_tg_error` fields) added by the internal `dispatch()` function and then emitted verbatim. The `denormalize_response` Codex branch now strips all `_tg_*` keys before output. The same path also injects the required `hookEventName` const field into `hookSpecificOutput` — Codex requires it on every `hookSpecificOutput` shape and token-goat was not emitting it because Claude Code does not require it. A `_codex_hook_event_name()` helper resolves the correct value (e.g. `"pre-read"` → `"PreToolUse"`) from the hook registry. The old camelCase→snake_case key conversion (`_translate_hso_to_codex`) is no longer applied — Codex 0.137.0+ uses camelCase throughout `hookSpecificOutput`.
0 commit comments