fix(codex): shrink the SessionStart gateway banner to one line - #8
Open
johnnyfish wants to merge 1 commit into
Open
fix(codex): shrink the SessionStart gateway banner to one line#8johnnyfish wants to merge 1 commit into
johnnyfish wants to merge 1 commit into
Conversation
Codex renders hook output verbatim in the thread and has no silent model-only channel (unlike Claude's additionalContext / systemMessage split), so the SessionStart gateway message is unavoidably user-visible. It was a 4-line briefing printed on every session start — intrusive. Collapse it to a single terse line that still does its two jobs: signal the gateway is active and cue the onecli-gateway skill (which the skill's own description says loads on this prompt). The detailed rules (no auth headers, curl-not-MCP, connect_url/blocked_by_policy/rate_limited error shapes) already live in that skill, so restating them in the transcript was pure duplication. Verified: npm run build + typecheck + full test suite green; the built hook now emits one line.
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
The Codex SessionStart hook printed a 4-line OneCLI gateway briefing into the thread on every session start:
Intrusive: it's model-facing instruction leaking into the human's view, every session.
Why it can't just be hidden
Claude's SessionStart hook has two channels —
systemMessage(user-visible one-liner) andhookSpecificOutput.additionalContext(model-only, invisible). Codex has no silent channel: it renders all hook output in the transcript, includingadditionalContext(confirmed — even our structured-envelope UserPromptSubmit hook shows as "hook context" in Codex). So the message is unavoidably user-visible.Change
Collapse the banner to one terse line that still does its two real jobs:
onecli-gatewayskill — whose own description says it loads on this prompt.The detailed rules (no auth headers, curl-not-MCP,
connect_url/blocked_by_policy/rate_limitederror shapes) already live in that skill, so printing them in the transcript was pure duplication. New line:Verification
npm run build(regeneratedplugins/codex/hooks/session-start.mjs),npm run typecheck,npm run test— all green (12 workflow groups incl.codex_setup_status_cleanup,gateway_workflow_guidance).Companion
Pairs with onecli-cli #110, which removed the other (UserPromptSubmit) gateway block from Codex. Together they take Codex from two multi-line blocks per prompt down to one line per session.
Review
Fast path (one-line runtime-string change + rebuild). Self-reviewed for: behavior preservation (skill still cued; PreToolUse auto-source path untouched), scope (only
printActiveMessage; setup/error messages unchanged), and build integrity (regenerated the committed.mjsartifact, not hand-edited). Full suite + typecheck green.