Make agent-turn notification preview length configurable

Resolved 💬 2 comments Opened Mar 26, 2026 by ignatremizov Closed May 10, 2026

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 ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗