Skip to content

Bug: TUI drops MCP image output when text precedes image #9814

@Kbediako

Description

@Kbediako

What Version Of Codex Is Running?

codex-cli 0.89.0

What Subscription Do You Have?

Pro

Which Model Were You Using?

5.2-Codex (MCP tool output ordering)

What Platform Is Your Computer?

Mac Mini M4 - Darwin 25.3.0 arm64 arm

What Terminal Emulator And Version Are You Using (If Applicable)?

Terminal.app 466 (TERM_PROGRAM=Apple_Terminal), shell: /bin/zsh, TERM=xterm-256color

What Issue Are You Seeing?

The TUI only renders an MCP image output cell when the first CallToolResult.content block is an image; image blocks after text are ignored. Users see a caption/placeholder without the image output cell, which hides tool output.

What Steps Can Reproduce The Bug?

  1. Run Codex TUI 0.89.0 (rust-v0.89.0 tag).
  2. Trigger an MCP CallToolResult where content has a text block followed by an image block (caption then image).
  3. Observe the history view.

Example generator:

  • Local repro via a temporary MCP tool or injected events; can share steps on request.

What Is The Expected Behavior?

The TUI renders an image output cell whenever any image block exists, regardless of ordering.

Before/After

Before
Image

After Fix #9815
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displaybugSomething isn't workingmcpIssues related to the use of model context protocol (MCP) servers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions