openai / openai/codex

TUI ignores suppressOutput for prompt hook context

Open
#40,861 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug CLI hooks TUI windows-os
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of Codex CLI is running?

codex-cli 0.149.1; the behavior is also present on main at 9dea1f709f.

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64, Codex TUI.

What issue are you seeing?

A successful UserPromptSubmit hook that returns model-facing additionalContext
is rendered in the TUI even when the structured output sets suppressOutput to
true:

UserPromptSubmit hook (completed)
  hook context: commit-commands runtime metadata for this turn: ...

The hook output parser preserves suppressOutput, but the session-start and
user-prompt-submit event parsers currently discard it. The context therefore
becomes both model input and a visible HookOutputEntryKind::Context entry.

What steps can reproduce the bug?
  1. Configure a synchronous UserPromptSubmit command hook.
  2. Have the hook print this structured output:
{
  "suppressOutput": true,
  "hookSpecificOutput": {
    "hookEventName": "UserPromptSubmit",
    "additionalContext": "quiet model context"
  }
}
  1. Submit a prompt in the Codex TUI.
  2. Observe that the successful hook and its context are displayed.

The same parsing issue applies to SessionStart and SubagentStart context.

What is the expected behavior?

The additional context should still reach the model, but a successful hook
with suppressOutput: true should not produce a visible context entry in the
TUI. Block, stop, warning, and error feedback should remain visible.

Additional information

The TUI already omits completed hook runs whose output entry list is empty, so
the event parser can implement this without a protocol change: keep the
model-facing context while omitting only the visible context entry.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the session-start and user-prompt-submit event parsers, then trace how the hook output parser preserves suppressOutput and how the TUI builds HookOutputEntryKind::Context entries. Keep additionalContext in model input while omitting only the visible context entry when suppressOutput is true; block, stop, warning, and error feedback should remain visible.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.