openai / openai/codex

Desktop freezes near 100% CPU: unbounded Markdown parsing of 24.8M-character task previews for sidebar titles

Open
#42,630 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

app bug performance
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

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

26.901.22334 (7746), branded ChatGPT desktop app, not ChatGPT Classic.

What subscription do you have?

Plus at the time of the captured investigation.

What platform is your computer?

Apple M1 Pro; macOS 26.6.2 (25G83).

uname -mprs: Darwin 25.6.0 arm64 arm

What issue are you seeing?

The desktop main process becomes unresponsive near 99% CPU while building the local task catalog. Two historical tasks contain preview strings of 24,800,241 characters each. The sidebar display-title builder synchronously parses the entire preview as Markdown on the main JavaScript thread before truncating the resulting title.

Investigated with Codex. A debugger pause identified an affected task with preview.length === 24800241 inside this main-thread stack in main-7G1VcsUF.js:

w5.listPage → Ob → kb → ub → sce → Markdown tokenizer/resolvers

kb also eagerly evaluates its array of fallback candidates, including parsing the preview even when a prior candidate could supply the title.

Sanitized report, before/after CPU profiles, and exact tested guard generator:
https://gist.github.com/MaxHastings/1e4dbc655ba836ef4e37a0b47eb7ca9a

What steps can reproduce the bug?
  1. Use this build with the affected historical task data. Both offending records are local tasks with source vscode, archived false, name null, and 24,800,241-character previews.
  2. Allow the local task catalog scan to reach these records during startup.
  3. Observe sustained main-process CPU near 99% and an unresponsive interface. Capture the main JavaScript CPU profile to see the stack above.

Reproduction was confirmed in an isolated instrumented app using copies of the task store, account/configuration, and app catalog database. The exact preview content is private; a minimal synthetic reproducer has not been established. Latest-build reproduction has not yet been verified. Cache clearing and restarting did not fix the original problem.

Controlled comparisons:

Case Result
Original title builder and affected copied data Reproduced freeze; 0% idle in a 12.96-second profile
Same data, name/preview input bounded to 8,192 characters Catalog completed; 90.1% idle in a 12.17-second profile; subsequently ~0.1% process CPU
Original title builder, only two pathological preview fields shortened Catalog completed; subsequently ~0.8% process CPU

These captures cover different startup stages and are diagnostic comparisons, not standardized benchmarks. Account/configuration/catalog state enabled the failing scan in the reproduction; the tests do not isolate which setting initiates it.

What is the expected behavior?

Generating short sidebar titles should perform bounded work and should not parse tens of millions of characters synchronously on the main thread. Large historical messages should not make the entire desktop interface unresponsive.

Additional information

Preview size distribution across all 2,488 tasks in the pre-repair backup, nearest-rank percentiles using SQLite length(preview) in characters:

Metric Characters
p50 665
p95 13,880
p99 47,813
max 24,800,241

Exactly two previews exceed one million characters.

The tested guard adds the following at entry to kb({cwd:e,name:t,preview:n,threadId:r}), before existing metadata/Markdown processing:

t = (t ?? ``).slice(0, 8192); // name
n = (n ?? ``).slice(0, 8192); // preview

For a production fix, please bound input before Markdown parsing and evaluate fallback candidates lazily. The guard is a tested mitigation, not a claim that 8,192 is the ideal product limit or a comprehensive parser complexity fix.

The installed app is usable after shortening only the two preview metadata fields. Full first messages and transcript files remain intact; no projects or conversations were deleted. The installed application bundle was not modified. Retesting the underlying bug requires the unrepaired isolated data, since the production profile now has this workaround.

Support requested the size distribution and in-app feedback correlation. A feedback submission/session ID is not available yet. The Gist includes execution profiles with local app paths replaced; it excludes raw conversations, credentials, and database files.

Please route to the desktop team responsible for local task-catalog indexing and sidebar title generation. No infinite loop, security impact, or first affected version is claimed.

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 with the affected main-7G1VcsUF.js stack, especially kb({cwd:e,name:t,preview:n,threadId:r}), and review the linked profiles and tested guard generator. Verify how sidebar titles reach Markdown tokenization and how fallback candidates are evaluated. Done means large task previews no longer make catalog indexing unresponsive while title generation remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, markdown
Domain
desktop, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.