codex - ✅(Solved) Fix Codex Desktop shows background hook transcript noise, while the TUI does not [1 pull requests, 5 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17479Fetched 2026-04-12 13:27:58
View on GitHub
Comments
5
Participants
3
Timeline
15
Reactions
0
Author
Timeline (top)
commented ×5labeled ×3mentioned ×3subscribed ×3

Root Cause

For integrations like Notchi, hooks are the best technical integration path:

  • push-based
  • low-latency
  • structured
  • much better than polling rollout/session files

If Codex Desktop cannot hide non-user-facing hook activity cleanly, integrations are pushed toward weaker file-monitoring workarounds just to avoid transcript pollution.

Fix Action

Fix / Workaround

If Codex Desktop cannot hide non-user-facing hook activity cleanly, integrations are pushed toward weaker file-monitoring workarounds just to avoid transcript pollution.

PR fix notes

PR #17266: [codex] Improve hook status rendering

Description (problem / solution / changelog)

Motivation

Make hook display less noisy and more useful by keeping transient hook activity out of permanent history unless there is useful output

Also addresses some of the concerns in https://github.com/openai/codex/issues/15497

Changes

Hook Lifecycle Rendering

  • Hook start events no longer write permanent history rows like Running PreToolUse hook.
  • Running hooks now render in a dedicated live hook area above the composer. It's similar to the active cell we use for tool calls but its a separate lane.
  • Running hook rows use the existing animation setting.

Hook Reveal Timing

  • We wait 300ms before showing running hook rows and linger for up to 600ms once visible.
    • This is so fast hooks don't flash a transient Running hook row before user can read it every time.
  • If a fast hook completes with meaningful output, only the completed hook result is written to history.
  • If a fast hook completes successfully with no output, it leaves no visible trace.

Completed Hook Output

  • Completed hooks with output are sticky, for example • SessionStart hook (completed).
  • Hook output entries are rendered under that row with stable prefixes: warning:, stop:, feedback:, hook context:, and error:.
  • Blocked hooks show feedback entries, for example • PreToolUse hook (blocked) followed by feedback: ....
  • Failed hooks show error entries, for example • PostToolUse hook (failed) followed by error: ....
  • Stopped hooks show stop entries and remain visually treated as non-success.

Parallel Hook Behavior

  • Multiple simultaneously running hooks can be tracked in one live hook cell.
  • Adjacent running hooks with the same hook event name and same status message collapse into a count, for example • Running 3 PreToolUse hooks: checking command policy.
  • Running hooks with different event names or different status messages remain separate rows.

Hook Run Identity

  • PreToolUse and PostToolUse hook run IDs now include the tool call ID which prevents concurrent tool-use hooks from sharing a run ID and clobbering each other in the UI.
  • This ID scoping applies to tool-use hooks only; other hook event types keep their existing run identity behavior.

App-Server Hook Notifications

  • App-server HookStarted and HookCompleted notifications use the same live hook rendering path as core hook events.
  • UserPromptSubmit hook notifications now render through the same completed hook output format, including warning and stop entries.

Changed files

  • codex-rs/hooks/src/events/common.rs (modified, +26/-0)
  • codex-rs/hooks/src/events/post_tool_use.rs (modified, +68/-6)
  • codex-rs/hooks/src/events/pre_tool_use.rs (modified, +66/-6)
  • codex-rs/tui/src/chatwidget.rs (modified, +155/-36)
  • codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__completed_hook_output_precedes_following_assistant_message_snapshot.snap (added, +11/-0)
  • codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__completed_hook_with_output_flushes_immediately_snapshot.snap (added, +16/-0)
  • codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__completed_same_id_hook_output_survives_restart_snapshot.snap (added, +9/-0)
  • codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__hook_blocked_failed_feedback_history_snapshot.snap (added, +9/-0)
  • codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__hook_completed_before_reveal_renders_completed_without_running_flash_snapshot.snap (added, +9/-0)
  • codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__hook_live_running_then_quiet_completed_snapshot.snap (added, +21/-0)
  • codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__hook_runs_while_exec_active_snapshot.snap (added, +25/-0)
  • codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__identical_parallel_running_hooks_collapse_to_count_snapshot.snap (added, +9/-0)
  • codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__overlapping_hook_live_cell_snapshot.snap (added, +43/-0)
  • codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__post_tool_use_hook_events_render_snapshot.snap (modified, +2/-4)
  • codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__pre_tool_use_hook_events_render_snapshot.snap (modified, +2/-4)
  • codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__session_start_hook_events_render_snapshot.snap (modified, +2/-4)
  • codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__user_prompt_submit_app_server_hook_notifications_render_snapshot.snap (modified, +2/-5)
  • codex-rs/tui/src/chatwidget/tests/helpers.rs (modified, +52/-0)
  • codex-rs/tui/src/chatwidget/tests/status_and_layout.rs (modified, +527/-0)
  • codex-rs/tui/src/history_cell.rs (modified, +6/-0)
  • codex-rs/tui/src/history_cell/hook_cell.rs (added, +779/-0)
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From “About Codex” dialog)?

26.409.20454

What subscription do you have?

Pro

What platform is your computer?

25.0.0 arm64 arm

What issue are you seeing?

I’m integrating Codex into a notchi and found an inconsistency between the Codex TUI and Codex Desktop.

Problem

The same background hooks behave cleanly in the Codex TUI, but Codex Desktop still surfaces hook-related transcript noise in the conversation UI.

This makes Desktop much harder to integrate with for background apps that use hooks only as an internal event bridge.

What I observed

Using the same Notchi integration hooks:

In the terminal TUI

The conversation looks nice without hooks. Example:

<img width="1086" height="586" alt="Image" src="https://github.com/user-attachments/assets/c4859bce-be4e-49ea-ba12-5746eacf4b0d" />

In Codex Desktop

The Desktop thread still surfaces hook-related noise / behavior that makes hook-based background integrations feel much worse.

<img width="1214" height="634" alt="Image" src="https://github.com/user-attachments/assets/a9c8de3e-0621-46ee-a118-785fb7372a4f" />

Why this matters

For integrations like Notchi, hooks are the best technical integration path:

  • push-based
  • low-latency
  • structured
  • much better than polling rollout/session files

If Codex Desktop cannot hide non-user-facing hook activity cleanly, integrations are pushed toward weaker file-monitoring workarounds just to avoid transcript pollution.

Expected behaviour

Codex Desktop should handle background/internal hooks at least as cleanly as the TUI does.

Ideally there should be a supported way for Desktop to suppress non-user-facing hook transcript entries, for example:

  • honoring a hook-level suppression flag
  • or otherwise not rendering background hook lifecycle rows into the chat UI

Additional context

There is prior work related to hook-status rendering here for TUI:

What steps can reproduce the bug?

  1. Configure Codex with a local hook intended only for background/internal integration.
    Example: any simple hook script that forwards Codex events to another process without intending to show user-facing output.

  2. Use that same hook configuration in both:

    • terminal codex TUI
    • Codex Desktop
  3. Start a conversation in each client.

  4. Send a few normal prompts that trigger the configured hook events during ordinary usage.

  5. Compare how the transcript is rendered in each surface.

What is the expected behavior?

No response

Additional information

No response

extent analysis

TL;DR

The issue can be mitigated by exploring a way for Codex Desktop to suppress non-user-facing hook transcript entries, similar to how the TUI handles background hooks.

Guidance

  • Review the prior work related to hook-status rendering in the TUI, specifically pull request #17266, to understand how the TUI handles background hooks.
  • Investigate the possibility of adding a hook-level suppression flag in Codex Desktop to prevent non-user-facing hook activity from being rendered in the chat UI.
  • Compare the configuration and behavior of the hook in both the TUI and Codex Desktop to identify any differences that might be causing the inconsistency.
  • Consider reaching out to the developers of the Notchi integration or the Codex App for further guidance on how to handle background hooks in Codex Desktop.

Example

No specific code example can be provided without more information about the hook script or the Codex App's API.

Notes

The solution to this issue may require changes to the Codex Desktop application or the hook script, and may involve collaborating with the developers of the Notchi integration or the Codex App.

Recommendation

Apply a workaround by exploring the possibility of adding a hook-level suppression flag or modifying the hook script to prevent non-user-facing hook activity from being rendered in the chat UI, as the TUI's handling of background hooks suggests that this approach may be effective.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING