fix(run): stop registering the noisy gateway hook for Codex - #110
Merged
Conversation
johnnyfish
force-pushed
the
fix/codex-gateway-hook-noise
branch
from
July 30, 2026 21:00
72b93e4 to
08e9484
Compare
Codex renders injected hook context in its transcript (Claude injects the same JSON envelope silently), so the UserPromptSubmit gateway hook printed a block on every prompt. The auto-loaded onecli-gateway skill already carries identical guidance, so the hook is redundant there. Codex spec gets skipHook=true — no registration on new runs. Claude keeps the hook (silent injection there). Existing installs that already have the hook can drop it by removing the entry from ~/.codex/hooks.json. Tests: Codex-skips-hook spec assertion; agent-spec table updated.
johnnyfish
force-pushed
the
fix/codex-gateway-hook-noise
branch
from
July 30, 2026 21:09
08e9484 to
724a66d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Codex was printing a noisy OneCLI gateway block on every prompt:
Root cause:
onecli runregisters aUserPromptSubmitgateway-detect hook that emits a{"hookSpecificOutput":{"additionalContext":...}}envelope. Claude Code injects that context silently; Codex renders it in the transcript. There is no Codex flag to hide it. The auto-loadedonecli-gatewayskill already carries identical guidance, so the hook is redundant on Codex.Change
skipHook: true— no hook registered on new runs. Claude keeps it (silent + useful there).skipHookagents now de-register a gateway hook a prior CLI version wrote into~/.codex/hooks.json, so existing installs go quiet too, not just fresh ones. Removes only our entry (command referencing the detect script), preserves third-party hooks, and prunes an emptiedUserPromptSubmitarray. No-op when absent/missing.Verification
go test ./... -count=1green;go vet+gofmtclean.onecli run -- codexon a real~/.codex/hooks.json— printedremoved the stale gateway hook for Codex, and the file now contains only the pre-existing Superset hooks (SessionStart/Stop/UserPromptSubmit all intact), onecli entry gone.Out of scope
The longer SessionStart block ("Call external APIs directly (curl/gh)...") comes from a different repo (
onecli-codex-plugin/src/codex/session-start.mts), not this CLI. Same Codex-renders-hooks root cause; needs a matching fix there.Review
Fast path (small, isolated fix). Self-reviewed for: scope (only Codex spec + a new cleanup helper), regression safety (Claude/Cursor/OpenCode hook paths unchanged;
hooksFilemachinery retained), and data safety (JSON round-trip preserves unrelated hooks, 0600 perms, no-op on parse/no-match). Verified live against the real config file.