Make agent-turn notification preview length configurable

Resolved 💬 2 comments Opened Mar 26, 2026 by ignatremizov Closed May 10, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

CLI v0.116

What feature would you like to see?

Make the TUI desktop notification preview length configurable instead of hard-coded.

Today, Codex truncates the notification body used for TUI/terminal desktop notifications to a fixed preview length before Ghostty/GNOME ever render it.

In current main, both TUI codepaths hard-code at least these preview limits:

  • agent-turn completion preview: 200 graphemes
  • exec approval command preview: 30 graphemes
  • user-input/question summary preview: 30 graphemes

That means terminals / desktop environments only ever receive the shortened preview string, often ending in ..., even when the notification UI itself has room to show more.

A configurable limit would let users tune this for their notification environment. For example, Ghostty + GNOME users may want a much larger preview because the shell can already render wider or expanded notifications.

Potential shapes for the feature:

  • config keys for the desktop-notification preview grapheme limits
  • separate config for completion vs approval/question notifications
  • a higher default may also be reasonable, but configurability is the main request

Additional information

I traced this end-to-end locally while debugging Ghostty/GNOME notification truncation.

The important finding is that the visible ... in the desktop notification body is introduced by Codex before Ghostty/GNOME render the popup.

Relevant locations on current main:

  • codex-rs/tui/src/chatwidget.rs
  • codex-rs/tui_app_server/src/chatwidget.rs

Specifically:

  • Notification::agent_turn_preview() normalizes whitespace, then calls truncate_text(...) with a hard-coded completion preview limit
  • Notification::ExecApprovalRequested display formatting truncates the command preview with a hard-coded limit
  • Notification::user_input_request_summary() / notification display formatting truncates the question summary with a hard-coded limit

This is a feature request, not a bug report, because the current behavior is consistent with the code — it just needs to be configurable.

View original on GitHub ↗

2 Comments

ignatremizov · 5 months ago

Related issues for notification context:

  • #3962 covers completion notifications/sound more broadly
  • #12492 covers built-in sound notification for interactive turn completion
  • #11097 covers notification support for plan mode questions
  • #13019 covers completion notification config in app-server mode
  • #8189 covers notification/notify-hook failures on WSL2

This issue is narrower than those: it is specifically about the agent-turn notification body being truncated in Codex before the terminal / desktop environment renders it, and making that preview-length limit configurable.

etraut-openai contributor · 3 months ago

This feature request hasn't received enough upvotes, so I'm going to close it.