Codex turns that complete with no output show nothing in the UI — surface an explicit "turn produced no response" state

Author: pfedotovskyCreated Jul 12, 2026Updated Sep 28, 2026
LabelsenhancementNP

Environment: CloudCLI 1.36.1, macOS arm64. Companion to #1011, but independently useful.

Symptom

When a Codex turn ends without producing any assistant output, the chat UI gives the user no feedback at all: the user bubble renders, then nothing changes. In our case (#1011: vendored CLI rejected the configured model with HTTP 400) users re-sent the same message three times, spawning three orphaned Codex sessions, because the UI was indistinguishable from "still thinking" / "message not sent".

Why the existing error mapping doesn't cover it

server/openai-codex.js correctly maps turn.failed and error items to client events. But codex-cli (at least 0.141 in --experimental-json mode) can fail a turn upstream and still emit a clean turn.completed — the rollout ends with task_complete, last_agent_message: null, no error event in the stream. From the server's point of view the turn "succeeded" with zero items.

Suggested fix

Track whether any agent output item (message / tool call / file change …) was emitted during the turn. If turn.completed arrives with none, send a synthetic error/warning message to the client, e.g.:

Codex completed the turn without producing a response. This usually means the request was rejected upstream (model/CLI mismatch, auth, or rate limit) — check the host's codex logs.

A one-boolean change in the event loop, and it converts every silent-failure mode in this family (present and future) into an actionable message instead of a dead chat.