Desktop renderer can show raw {"detail":"Unsupported content type"} after patch-only turn and stream-state desync

Open 💬 3 comments Opened Jun 23, 2026 by astelmach20
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Summary

Codex Desktop displayed a raw error pill:

{"detail":"Unsupported content type"}

after a successful patch-only turn. The turn itself completed and the patch operations succeeded. Local evidence points to a Desktop renderer thread-state synchronization failure, not a CLI failure or a model/backend sampling failure.

PII scrubbed: local usernames, account IDs, email addresses, exact home paths, private repo names, and private task identifiers are omitted or generalized.

Environment

  • App: Codex Desktop
  • Bundled Codex CLI: 0.142.0-alpha.1
  • Shell/PATH Codex CLI: 0.141.0
  • Platform: macOS arm64
  • Originator in rollout metadata: Codex Desktop

What Happened

  1. A turn performed only file edits via apply_patch.
  2. The rollout recorded three successful patch calls.
  3. The rollout then recorded task_complete with last_agent_message: null.
  4. The Desktop UI showed the patch summary card, followed by a raw error pill containing {"detail":"Unsupported content type"}.
  5. On the next interaction, Electron logs showed renderer state-sync failures for the same conversation:
  • Item not found in turn state itemId=...
  • Failed to apply patches for conversationId=... errorMessage="[Immer] minified error nr: 18..."

Evidence

The persisted rollout shows the patch-only turn completed successfully:

response_item custom_tool_call apply_patch status=completed
patch_apply_end success=true
response_item custom_tool_call_output
...
event_msg task_complete last_agent_message=null

The Electron Desktop log then shows the renderer losing incremental turn state:

error [electron-message-handler] Item not found in turn state itemId=<tool-call-id>
warning [electron-message-handler] Failed to apply patches for conversationId=<conversation-id> errorMessage="[Immer] minified error nr: 18..."

The bundled renderer code path applies follower patches and only logs on failure:

handleThreadStreamStateChanged(...) {
  ...
  let conversation = this.params.threadStore.getConversation(conversationId);
  if (conversation) try {
    let next = applyPatches(conversation, change.patches);
    this.params.threadStore.setConversation(next);
    ...
  } catch (error) {
    logger.warning(`Failed to apply patches for`, ...)
  }
}

Ruled Out

  • codex --help works with both PATH CLI and bundled Desktop CLI.
  • codex doctor reports no content-type or app-server failure; only terminal TERM=dumb is flagged in this shell context.
  • The model sampling request around the later observed recurrence completed with HTTP 200 in core logs.
  • Searching the OSS source and bundled app assets did not find Unsupported content type as a hardcoded Desktop string, which suggests it is a surfaced response body rather than frontend copy.

Expected Behavior

A successful patch-only turn should render as completed without a raw JSON error pill. If a renderer follower falls out of sync, Desktop should recover by requesting or broadcasting a full conversation snapshot instead of leaving the UI in a partial/error state.

Actual Behavior

The UI showed a raw backend-style JSON body as a transcript error after the successful patch summary. Subsequent logs show renderer follower patch application failures for missing turn items and an Immer patch failure.

Suggested Fix Direction

  • On thread-stream-state-changed patch application failure, fall back to a full snapshot/resync for that conversation.
  • Avoid rendering raw JSON response bodies such as {"detail":"..."} directly as transcript/system-error content when the error is renderer-local or bridge-local.
  • Consider a regression test for a patch-only turn where no final assistant message exists and a follower client receives incremental patches out of order or against stale turn state.

Repro Notes

I could not reproduce via CLI-only commands; the issue appears Desktop-specific and tied to multiple renderer/client stream synchronization. The local app process had multiple renderer processes plus the app-server sidecar active when the error occurred.

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 2 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #29678

Powered by Codex Action

danphenderson · 2 months ago

I am seeing what looks like the same raw {"detail":"Unsupported content type"}
Codex App symptom on:

  • App version: 26.616.71553 (About dialog says Released Jun 22, 2026)
  • App build: 4265
  • Platform: Darwin 25.5.0 arm64 arm
  • Bundled CLI: codex-cli 0.142.0

I have two additional observed UI paths that may help narrow it:

  1. Rich-paste path, tentative:
  • After copying and pasting transcript content that included rich Codex cards,

the app later showed the raw {"detail":"Unsupported content type"} card
directly under an edited-file entry.

  • Screenshot text:

``text
Edited section-4-1-production-validation-plan.md +11 -2
{"detail":"Unsupported content type"}
``

  1. Searched code tool-card path, observed but not minimized:
  • In a separate long thread, the app showed the same raw card directly below

a Searched code tool-card area.

  • In the saved rollout tail slice for that incident, the final saved events

were tool_search_call, tool_search_output, and then task_complete
with last_agent_message = null; I did not see a normal final saved
transcript item in that tail slice carrying the raw card.

Expected behavior:

  • unsupported rich pasted content should be normalized, dropped, or rejected

with a user-facing validation message;

  • tool-card/render failures should not surface raw backend JSON as transcript

content.

I did not attach clipboard payloads, local log contents, or path inventories
because they may contain private text or machine details. If you want these
rich-paste and Searched code variants split into a separate issue from this
one, I can do that and use the app-bug form.

SocialK · 2 months ago

will you be surprise that you face it Bundled Codex CLI: 0.142.0-alpha.1, now it is Bundled Codex CLI: 0.142.0-stable , and they have already 143 alpha, but the problem still there!!