openai / openai/codex

Codex Desktop: fenced block visible while streaming can be absent from finalized message state

Open
#41,545 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug session windows-os
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Version

Codex desktop package 26.825.4187.0
Internal app build 26.825.32147

Platform

Windows 11 x86-64

Summary

On two affected turns, a fenced block was visible while the assistant response was streaming but was absent from the finalized message state. The finalized state contained no fence delimiters, no code-block metadata, and no corresponding rendered block. A preceding turn and a later control turn retained one fenced block each.

The evidence establishes stream-visible-to-final-state content loss. It does not establish whether the loss occurs in the final server payload, the desktop finalization reducer, persistence, or hydration.

Steps to reproduce

The issue is intermittent:

  1. In a long Codex desktop conversation, request a response containing a fenced code block.
  2. Observe the fence and its content while the response streams.
  3. Wait for the turn to finalize.
  4. Check whether the finalized visible message still contains the fenced block.
  5. If diagnostic access is available, compare fence delimiters and code-block metadata between streaming and finalized state.

Expected behavior

Substantive content shown during the assistant stream should remain in the finalized message unless it is explicitly identified as ephemeral activity/status output. Fenced content should preserve its text and block metadata.

Actual behavior

In the affected turns, the fenced material disappeared after finalization. The final message structure lacked the fence text and code-block metadata; this was not merely a hidden rendered element. Nearby control turns finalized normally.

Additional technical evidence

Turn group Stream observation Final delimiters Final code metadata Final rendered block
Preceding control Fence present 1 1 1
Affected turn A Fence visible 0 0 0
Affected turn B Fence visible 0 0 0
Later control Fence present 1 1 1

A long-lived monitor was prepared to capture the exact stream-to-final transition, but no later failing candidate occurred during its run. I therefore cannot identify the exact server/client finalization boundary.

Related issues #24287 and #36697 describe different behavior: restart visibility and a transient TUI streaming tail. Here, fenced content remained absent from finalized desktop message state.

Proposed fix direction

Instrument privacy-safe text hashes and code-block counts at the stream accumulator, final response, desktop finalization reducer, persistence write, and hydration boundaries. Finalization should not silently replace accumulated substantive content with an unmarked partial state.

Privacy note

The report uses only structural counts and sanitized version information. No prompts, conversation text, account identifiers, task IDs, local paths, credentials, or preserved database contents are included.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the intermittent loss in a long Codex desktop conversation and instrument the named stream accumulator, final response, desktop finalization reducer, persistence write, and hydration boundaries using privacy-safe hashes and code-block counts. Done means substantive streamed fenced content remains in finalized message state with its text and code-block metadata preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.