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

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 ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗