Codex App file preview fails to render small TypeScript files above ~739 lines

Resolved 💬 3 comments Opened Jul 6, 2026 by WaterWhisperer Closed Jul 8, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

26.623.101652

What subscription do you have?

ChatGPT Pro 20x

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

I first noticed this with a real TypeScript file in a local project: a file with about 3,400 lines and 140 KB did not render in Codex Desktop's local file preview, while smaller files in the same directory rendered normally.

To avoid sharing private project code, I reduced the issue to synthetic files. The reduced repro suggests this is not caused by private file content or file byte size. It appears to be triggered by the number of rendered lines.

Observed with synthetic files:

  • A 735-line TypeScript file, about 19.8 KB, renders correctly.
  • A 739-line TypeScript file, about 19.9 KB, does not render.
  • A 500-line TypeScript file, about 138 KB, renders correctly.
  • Larger 3,418-line synthetic .ts, .js, and .txt files also did not render.

When the failure happens, the preview area does not show the file content. I did not see a user-visible error message.

Local logs showed fs/readFile responses with errorCode=null when opening generated repro files, so the file read appears to succeed and the failure looks like it happens in the Desktop file preview/rendering path.

What steps can reproduce the bug?

Create a small synthetic TypeScript file with around 739 lines, then open it from Codex Desktop's local file preview.

For example:

mkdir -p /tmp/codex-file-render-repro
node - <<'NODE'
const fs = require("fs");
const root = "/tmp/codex-file-render-repro";

for (const n of [735, 739]) {
  const lines = [];
  lines.push(`// ${n} lines small TypeScript render threshold repro`);
  for (let i = 1; i < n; i++) {
    lines.push(`export const v_${String(i).padStart(4, "0")} = ${i};`);
  }
  fs.writeFileSync(`${root}/lines-${n}-small.ts`, lines.join("\n") + "\n");
}

const largeBytes = [];
largeBytes.push("// about 150KB, only 500 lines");
const payload = "x".repeat(250);
for (let i = 0; i < 499; i++) {
  largeBytes.push(`export const long_${String(i).padStart(3, "0")} = "${payload}";`);
}
fs.writeFileSync(`${root}/bytes-150kb-500lines.ts`, largeBytes.join("\n") + "\n");
NODE

wc -l -c /tmp/codex-file-render-repro/*.ts

Observed locally:

735 lines / ~19.8 KB: renders
739 lines / ~19.9 KB: does not render
500 lines / ~138 KB: renders

Then open these files in Codex Desktop file preview:

/tmp/codex-file-render-repro/lines-735-small.ts
/tmp/codex-file-render-repro/lines-739-small.ts
/tmp/codex-file-render-repro/bytes-150kb-500lines.ts

What is the expected behavior?

Codex Desktop should render local text/code file previews for small files above 739 lines, or show an explicit handled message if a preview limit is intentionally applied.

A small ~20 KB TypeScript file should not silently fail to render because it has around 739 lines.

Additional information

I tested synthetic files. The useful reduction was:

  • 500 lines / ~138 KB renders
  • 735 lines / ~19.8 KB renders
  • 739 lines / ~19.9 KB does not render

This makes the issue look line-count/rendering-related rather than size-related.

I searched existing issues and did not find an exact duplicate for macOS Codex Desktop local file preview failing around this line count.

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 1 month ago

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

  • #30980

Powered by Codex Action

WaterWhisperer · 1 month ago

Note: I narrowed this down with synthetic files to make sure it was not the private project file itself.

The relevant checks were:

500 lines / ~138 KB: renders
700 lines / ~18.8 KB: renders
800 lines / ~21.5 KB: does not render
720 lines / ~19.4 KB: renders
740 lines / ~19.9 KB: does not render
735 lines / ~19.8 KB: renders
739 lines / ~19.9 KB: does not render

So the failure appears to be around the rendered line count, not byte size. I did not include the original private file, but it was about 3,400 lines / 140 KB and exposed the issue first.

WaterWhisperer · 1 month ago
Potential duplicates detected. Please review them and close your issue if it is a duplicate. * Codex desktop app file preview renders valid JSON files as a blank page. #30980 _Powered by Codex Action_

Checked #30980. It looks related at the file-preview symptom level, but I don't think this is an exact duplicate.

#30980 is about valid JSON files rendering as a blank page. This issue is a reduced line-count case for local code/text preview: 500 lines / ~138 KB renders, 735 lines / ~19.8 KB renders, but 739 lines / ~19.9 KB does not render. So the repro here points more specifically to a rendered-line-count threshold rather than JSON parsing or byte size.

They may share the same preview component/root cause, but this issue provides a separate minimal repro for the line-count behavior.