Codex Desktop sometimes shows local Markdown files as raw text instead of rendered preview
What happened
Codex Desktop sometimes displays a local .md file as raw source text instead of using the Markdown-rendered preview, while other Markdown files in the same workspace render correctly.
The file I hit this with was a normal small Markdown document: headings, bullets, and GitHub-style tables. It was not malformed, was ASCII-only, and was about 3.5 KB. file -I reports text/plain; charset=us-ascii, which is normal for a local Markdown file on macOS but may be related if the viewer is using MIME detection instead of the .md extension.
I am intentionally not attaching the original file because it contained workspace/client-sensitive content, but the file shape was ordinary Markdown.
Expected behavior
Local files with a .md extension should render consistently in the Markdown preview path, regardless of whether OS MIME detection reports text/plain. Headings, bullets, and tables should render like other Markdown files do in Codex Desktop.
Actual behavior
The same class of local Markdown file sometimes appears as raw text, showing literal # headings and pipe-table syntax. Other Markdown files preview with the expected formatting.
Notes / possible cause
This may be a viewer-path inconsistency rather than a Markdown parser issue:
- Markdown shown as assistant output or artifact preview renders correctly.
- Markdown surfaced through prior-thread context, tool output, or a generic local-file viewer path appears to fall back to raw text.
- The affected file was valid Markdown and small enough that size should not be forcing a raw fallback.
Environment
- Codex Desktop on macOS
- macOS: 26.4.1 (25E253)
codex --version:codex-cli 0.124.0
Sanitized repro shape
Create a small local file such as /Users/<user>/workspace/context/proj-example/2026-05-17-example.md with headings, bullets, and a Markdown table:
# 2026-05-17 Example Report
## TL;DR
This is a normal Markdown report.
## Table
| Client | Total | Flag |
|---|---:|---:|
| Example | 78,553 | 0 |
Then open/reference it from a Codex Desktop thread and compare against other .md files opened in the same workspace. The bug is that some are shown as raw text instead of rendered Markdown, despite having a .md extension and valid Markdown content.