Skip to content

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

Open

Description

@MaxHastings

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.

Activity

  1. added
    bug
    app
    on Sep 3, 2026
  2. github-actions commented on Sep 3, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. MaxHastings commented on Sep 3, 2026

    @MaxHastings
    Author

    Follow-up: a synthetic input now reproduces a long synchronous stall in the actual bundled title builder, without any private conversation data.

    const preview = 'word '.repeat(Math.ceil(24_800_241 / 5)).slice(0, 24_800_241);
    const record = { cwd: '/synthetic', name: null, preview, threadId: 'synthetic' };

    Calling the unguarded bundled kb on this record in the isolated instrumented app exceeded a 10-second inspector timeout. Four million characters took ~2.14 seconds. Applying the 8,192-character input bound to the same generated 24.8M-character string completed in ~17.35 ms and returned an 80-character title. Input generation was excluded from timing.

    This is a function-level synthetic reproduction of a main-thread stall, not a standalone end-to-end app fixture or proof of an infinite loop. The original private-data reproduction remains separately documented.

    The input generator/test wrapper and detailed measurements are now in the existing evidence Gist:
    https://gist.github.com/MaxHastings/1e4dbc655ba836ef4e37a0b47eb7ca9a

    I also checked the app's configured public production update feed on September 3, 2026:
    https://persistent.oaistatic.com/codex-app-prod/appcast.xml

    Its newest ARM64 entry is 26.901.22334 (7746), published September 3 at 17:50:06 UTC—the same build already reproduced and used for this synthetic test. The installed app passes strict/deep code-signature verification with OpenAI team ID 2DC432GLL2. No newer version was listed in that public feed; this does not make a claim about private/account-specific rollout channels.

    The in-app feedback submission ID is still pending. We are keeping #42630 open because we have a confirmed specific cause and mitigation; whether #42333 shares that cause remains unconfirmed.

  4. MaxHastings commented on Sep 3, 2026

    @MaxHastings
    Author

    Session reference supplied for in-app feedback correlation: 01a0695c-4a79-7a11-b546-6fa3ddd838a6. This is the diagnostic investigation session associated with this report and its evidence package.

  5. spirosrap commented on Sep 7, 2026

    @spirosrap

    Additional reproduction on Linux with desktop build 26.901.51231, investigated with Codex on September 7, 2026. The observed hot path and successful mitigation match this report.

    Environment

    • Omarchy / Arch Linux, x86_64, kernel 7.1.9-arch1-2, Hyprland / Wayland.
    • Installed package: openai-codex-desktop 26.901.51231-1, supplied through Omarchy packaging.
    • Bundled CLI: codex-cli 0.153.4.
    • Intel UHD Graphics 620.

    Findings

    Starting the app with the existing local history displayed the home window, but it stopped responding while the local thread catalog was being built. Hyprland displayed Application Not Responding. Leaving the process running for more than a minute did not resolve the stall.

    A late-startup V8 profile pointed to Markdown tokenization in .vite/build/main-BT6ViFC-.js. Inspection of the bundled code found the same kb({cwd, name, preview, threadId}) title builder and ub Markdown-to-text helper described above. It eagerly evaluates both the name and preview candidates before choosing one and limiting the final display label to 80 characters.

    In that build, the relevant original expression is:

    for (let n of [ub(t ?? ``), ub(_b(i ?? ``)), e, r])

    The locally tested change bounds only these sidebar-label parsing inputs:

    for (let n of [
      ub((t ?? ``).slice(0, 4096)),
      ub(_b(i ?? ``).slice(0, 4096)),
      e,
      r,
    ])

    The notification use of ub was left unchanged. Full conversations and original history metadata were retained. This is a local mitigation, not a proposed universal choice of input limit; lazy evaluation of fallback candidates would also avoid unnecessary work.

    Controlled comparison

    After the patched app became responsive, I initially suspected that switching the machine's power mode had helped. We therefore checked the actual OS power profile and compared the original and patched application code under the same setting:

    Application code Observed result
    Patched sidebar input bounds Full home UI loaded; I confirmed that the app responded to interactions
    Original archive restored, same power setting and history Freeze returned, a new Not Responding dialog appeared, and main-process CPU measured approximately 103.6%
    Patched archive restored again App remained running; main-process CPU measured approximately 0.8% after startup

    powerprofilesctl get reported power-saver during this comparison, including the final patched measurement. The CPU values are process CPU deltas over 10-second observation windows, not a standardized performance benchmark.

    The comparison did not require disabling pets, deleting conversations, or retaining the earlier experimental settings/history edits. Those diagnostic edits had been reverted. No raw transcripts, credentials, database files, or unredacted profiles are attached.

    This supplies another affected platform and a newer build for the existing desktop-team investigation into bounded sidebar-title generation.

  6. DingHungD commented on Oct 24, 2026

    @DingHungD

    Additional Windows confirmation: build 26.1021, large unnamed previews, and an API-only workaround

    Investigated with Codex on 2026-10-25 (Asia/Taipei). This adds a newer Windows occurrence, a synthetic function-level stress case, and a mitigation that only sets explicit thread names. The sampled call path closely matches this issue. Related Windows metadata report: #32371.

    Environment and impact

    • Microsoft Store package: OpenAI.Codex 26.1021.3705.0.
    • App version in the shipped package metadata: 26.1021.31345.
    • Desktop startup log reports local app-server 0.164.0-alpha.11.1.
    • Windows 11 Home x64, 10.0.26200 / build 26200.
    • Intel Core i5-13400, 10 cores / 16 logical processors; approximately 63.7 GiB RAM, with 35.1 GiB free during the hang.

    The desktop repeatedly stopped responding after launch and eventually recovered after several minutes. A four-second process CPU sample measured 97.4% of one core while Windows reported the main process as not responding. This is a one-core-normalized figure, not 97.4% of the entire machine.

    The local Work executor's recovery log recorded 578,440 ms from its initial startup observation to rendezvous recovery, after three attempts. That is a correlated component-recovery measurement, not a stopwatch measurement of the exact UI-freeze duration.

    History characteristics

    Read-only SQLite inspection of threads in the pre-repair state database found:

    Metric Value
    Total thread rows 1,836
    Total preview characters 100,227,174
    Active unnamed rows with preview length > 4,096 851
    Preview characters across those 851 rows 99,093,695
    Active unnamed rows with preview length > 100,000 235
    Maximum preview length 974,622

    Lengths are SQLite length() character counts. Affected rows had archived=0 and a null or blank explicit name. Several of the largest rows had equally large title, preview, and first_user_message values. Many were historical structured CAD/geometry tasks produced by an app-server integration; private prompts are not included here. A consistent SQLite backup passed PRAGMA quick_check.

    Useful read-only diagnostic query:

    SELECT count(*) AS affected,
           sum(length(preview)) AS preview_characters,
           max(length(preview)) AS maximum_preview_characters
    FROM threads
    WHERE archived = 0
      AND coalesce(trim(name), '') = ''
      AND length(preview) > 4096;

    Sampled main-thread path and current-build behavior

    A 40-second startup launch using V8's statistical profiler pointed to this caller-to-callee path in the shipped main-BPBEjAxi.js:

    listPage [line 1411]
      -> Jh [line 249]
      -> Yh [line 249]          display-title construction
      -> Wh [line 145]         Markdown-to-text helper
      -> Ahe -> The -> cme -> lme -> Wm
      -> ah resolver [line 143], including data-token coalescing/splicing
    

    Read-only inspection of an extracted copy of the shipped code shows that local catalog pages synchronously map thread records through Jh/Yh. In this build, Yh first parses the explicit name; only if that is empty does it parse the preview. The final short display label is selected/truncated afterward. Thus, unlike the earlier eager-fallback version described above, a nonempty short explicit name avoids the preview parse in this build. The unnamed-preview path still accepts the entire large string.

    Diagnostic limitation: the raw V8 log identifies V8 15.6, while the available analysis runtime was Node 24.22.1. An analysis copy normalized the newer o+/o* code-state prefixes to the corresponding older parser states; the original log was retained locally. The call-path diagnosis is supported by both the sampled stacks and the code inspection. Raw profiles and application code are not attached because they can contain source text and local paths.

    Synthetic function-level reproduction, using no private data

    This generator creates a dense JSON-shaped paragraph similar in structure to the large previews:

    function createSyntheticPreview(length) {
      const row = '{"id":"synthetic-object","outline":[[0,0],[1,0],[1,1],[0,1]],"refs":["synthetic-edge-a","synthetic-edge-b"]}, ';
      return row.repeat(Math.ceil(length / row.length)).slice(0, length);
    }
    const preview = createSyntheticPreview(974_622);
    // In a developer harness, call the current Markdown-to-title helper (Wh in
    // this bundle), or the title builder with name:null and this preview.

    For a local function-level test, we dependency-extracted the unchanged shipped Wh helper and its pure dependencies, without executing the application entrypoint. We ran that helper under Node 24.22.1, warmed it with a short string, excluded input generation from timing, and truncated the output to 80 characters after parsing:

    Synthetic input Input bound before parsing Observed result
    4,096 characters none 6.807 ms
    65,536 characters none 138.059 ms
    974,622 characters none did not finish within a 30,000 ms child-process timeout
    Same 974,622-character input first 4,096 characters 6.939 ms

    These are single-run function-level stress measurements in a different JS runtime, not an end-to-end synthetic desktop-history fixture or standardized benchmark. The dense synthetic input is not claimed to be byte-for-byte representative of the private data. It supplies a privacy-safe input for testing the bounded-work requirement in the desktop team's internal title-builder harness. The actual desktop startup hang was separately observed with the original local history on repeated launches. No infinite loop or security impact is claimed.

    Verified metadata-only workaround

    1. Create a consistent database backup with SQLite's backup API and verify it.
    2. For the 851 active unnamed rows whose previews exceed 4,096 characters, add concise explicit names using the supported Codex task-rename tool.
    3. Verify each expected name and compare the rows with the pre-repair backup.
    4. Restart the normal, unmodified desktop application and sample process responsiveness about every two seconds.

    All 851 names were set and verified; the longest generated name is 63 characters. The affected rows' preview, first_user_message, original title, rollout paths, and archive flags matched the backup. No conversations were archived or deleted, and the installed app bundle was not patched.

    After the change, a responsive main window was first observed 4.52 seconds after activation. Sampling continued through 43.0 seconds of a roughly 45-second verification run, with zero non-responsive-window samples. Main-process cumulative CPU was approximately 28.922 seconds by the final sample and had largely leveled off after initial startup. This supports the name-based workaround; it does not establish a directly comparable “578 seconds to 4.52 seconds” startup-speed benchmark.

    The original unrenamed database backup remains local for further investigation. Retesting the private-data path requires an isolated copy of that backup; the production history now has explicit names.

    Suggested engineering follow-up

    • Bound every title/preview-derived parsing input before Markdown/envelope processing; truncating only the final label does not bound the work.
    • Preserve the current short-name fast path and consider a cheap bounded plain-text excerpt for unnamed records.
    • Keep catalog page processing interruptible or off the main thread so one record cannot starve desktop IPC.
    • Add regression coverage for large unnamed JSON/Markdown previews, many medium-sized previews, and a short explicit name paired with a huge preview.
    • Keep full first messages and transcripts separate from display metadata. The 4,096-character bound here is an illustrative tested mitigation, not a proposed universal product limit.

    Startup logs also showed plugin/installed timeouts, delayed app-server responses, WebSocket handshake timeouts, and a later pong timeout. These may be downstream effects of main-event-loop starvation; the measurements do not independently prove that every connection error has the same cause. An earlier Browser is not available: iab / stale native-pipe error also occurred, but it is not claimed to be caused solely by this title-parser issue.

    Only aggregate statistics, the sanitized call path, synthetic input, and the verified workaround are being shared. No customer CAD files, conversation bodies, credentials, account identifiers, database backups, or raw V8 logs are attached. Please route this additional Windows evidence to the desktop local-thread-catalog/sidebar-title team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugperformance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions