codex icon indicating copy to clipboard operation
codex copied to clipboard

ChatGPT desktop app freezes when switching to a large image-heavy thread (ResizeObserver loop)

Open super-administrator opened this issue 4 months ago • 13 comments

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

26.715.21425 (5488)

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Darwin 25.4.0 arm64 arm

What issue are you seeing?

On macOS, switching to one specific long, image-heavy task frequently makes the ChatGPT desktop app unresponsive. The freeze occurs during view activation even when that task is already loaded; during one observed freeze, no new thread/read or thread/resume request was made.

During diagnostics:

  • The app logs repeatedly reported: ResizeObserver loop completed with undelivered notifications.
  • Approximately 828 occurrences were observed overall; one 14-second burst contained 47 occurrences.
  • The main renderer was approximately 860 MB RSS and all related app processes were approximately 4.2 GB RSS in one snapshot.
  • In an earlier incident, macOS Activity Monitor displayed approximately 190 GB memory use and automatically paused the app.
  • GPU/renderer activity spikes while switching to the affected task.

This appears to be a renderer/layout problem rather than slow task retrieval.

What steps can reproduce the bug?

  1. Open the ChatGPT desktop app on macOS.
  2. Open a long task containing many screenshots/images and tool outputs (the affected local rollout is approximately 21 MB, about 70 turn contexts, and has gone through 3 context compactions).
  3. Navigate to another task.
  4. Switch back to the affected task.
  5. The app becomes unresponsive during task view activation. Switching away and back, or restarting directly into this task, can reproduce the problem.

The affected task's session ID is omitted from this public report because it contains private project context, but it can be provided privately to OpenAI staff if needed.

What is the expected behavior?

Switching to an already-loaded task should complete without freezing, repeated layout-observer loops, or excessive renderer/memory growth. Large image/tool-output histories should be virtualized or otherwise bounded during view activation.

Additional information

App version/build: 26.715.21425 (5488) Display name: ChatGPT macOS bundle identifier: com.openai.codex Architecture: Apple Silicon

Possibly related to #33582, #18693, and #22091, but this case adds a narrower trigger and renderer evidence: the affected rollout is only about 21 MB, task retrieval is not the bottleneck, switching to the already-loaded task triggers the freeze, and it correlates with repeated ResizeObserver layout-loop errors.

Raw logs and the full task are not attached because they contain private project data and internal network information. Sanitized diagnostic excerpts can be provided privately.

super-administrator avatar Jul 17 '26 08:07 super-administrator

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

  • #32663
  • #33582

Powered by Codex Action

github-actions[bot] avatar Jul 17 '26 08:07 github-actions[bot]

Thanks — I reviewed both suggested issues.

  • #32663 is specifically an MCP App webview/renderer-process leak: its reproduction uses 203 mcpAppResourceUri widgets in a ~53.8 MB rollout and observes +209/+216 renderer processes on each reopen. In #33782, the affected task is ~21 MB and is not characterized by hundreds of MCP App widget webviews or accumulating renderer child processes. The observed trigger is switching to an already-loaded image/tool-output-heavy task, accompanied by repeated ResizeObserver loop completed with undelivered notifications errors in the main renderer.
  • #33582 reports general unbounded memory growth during continued use (55 GB) without a deterministic thread-switch trigger or ResizeObserver evidence. #33782 provides a narrower reproduction: switching to one specific already-loaded task freezes the UI even when no new thread/read or thread/resume request occurs.

The symptoms may share an underlying renderer/resource-management problem, but the current evidence does not establish that #33782 is a duplicate of either issue. I am therefore keeping #33782 open so the deterministic task-switch/layout-loop evidence is not lost. If maintainers confirm a common root cause and prefer consolidation, I can move the diagnostics to the canonical issue.

super-administrator avatar Jul 17 '26 09:07 super-administrator

Update: still reproducible on 26.721.41059 with a much larger local thread; renderer stack sampled

I reproduced the same failure again on a newer build and collected a live renderer sample while the UI was non-interactive.

Environment

  • Codex/ChatGPT Desktop: 26.721.41059 (build 5848)
  • Chromium/Electron framework: 150.0.7871.128
  • macOS: 26.5.1 (Darwin 25.5.0), Apple Silicon

Observed process split

During the freeze:

  • One Codex (Renderer) process stayed at approximately 102–104% CPU and approximately 799–883 MB RSS/physical footprint.
  • Its sampled peak physical footprint reached approximately 1.1 GB.
  • The bundled codex app-server remained alive and background tasks continued to generate events.
  • The rest of the machine was not CPU-saturated; this was isolated to one renderer.
  • After the large thread finished hydrating/processing, renderer CPU fell to approximately 10% and the process became mostly idle again.

This matches the user-visible behavior: the task keeps running, but the entire primary interaction window and sidebar stop servicing input.

Live main-thread samples

A 5-second native sample of the hot renderer captured 4,137/4,137 main-thread samples inside V8 JavaScript. The hottest branch accounted for 4,018/4,137 samples, with 3,509/4,137 samples (about 84.8%) in _platform_memchr, consistent with repeated large-string scanning on the renderer main thread.

A second sample after the load subsided showed 2,192/2,365 main-thread samples blocked in mach_msg (idle), while CPU and footprint were already falling. This gives a clear busy-then-idle transition rather than a permanently wedged backend.

Sanitized session-size analysis

The affected JSONL session contained:

  • 764,863,333 bytes (about 729 MiB / 765 MB)
  • 102,952 valid JSONL records; 0 parse errors
  • 372,140,106 bytes of function_call_output
  • 129,142,128 bytes of custom_tool_call_output
  • 120,200,152 bytes of retained compacted records
  • 678 records containing inline data:image payloads
  • 116 individual records larger than 1 MiB
  • largest record: 10,825,243 bytes, containing inline image data

For comparison, another concurrently running long thread was about 111 MB, while a newly created diagnostic thread was only about 0.5 MB.

The current app log also recorded 139 instances of:

ResizeObserver loop completed with undelivered notifications.

Historical desktop sessions on the same machine contain up to several thousand occurrences, often in bursts around streaming and thread navigation. I still treat this as layout-churn evidence rather than proof of the primary cause; the live sample points more directly to renderer-side JavaScript/string processing.

Updated root-cause hypothesis

The strongest explanation is synchronous or repeatedly rescanned hydration of a very large, image/tool-output-heavy thread on the renderer main thread. Inline base64 images, large tool outputs, and retained compaction snapshots amplify the cost. The independent app-server process continues normally, which explains why work completes while navigation and interaction are frozen.

Suggested fix direction

  • Do not materialize the complete raw session history in the renderer during navigation.
  • Hydrate only recent visible turns, with pagination/virtualization for older history.
  • Keep inline image bytes and large tool outputs out of navigation/state-reconciliation payloads; load them lazily by reference.
  • Parse/normalize large thread payloads off the renderer main thread and add cancellation/backpressure when the user switches tasks.
  • Bound retained compaction snapshots and instrument payload bytes, main-thread long tasks, and hydration time.
  • If a thread exceeds a supported budget, open a recoverable compact view instead of blocking the whole window.

Raw transcripts, session identifiers, local paths, screenshots, and logs are intentionally omitted because they contain private project data. The two sanitized sample reports can be provided privately if maintainers specify a safe upload channel.

JulianZJN avatar Jul 28 '26 12:07 JulianZJN

I can reproduce the same macOS renderer freeze on a substantially larger, tool-heavy thread, with the same ResizeObserver signal.

Environment:

  • ChatGPT/Codex Desktop: 26.727.51351 (build 6119)
  • bundled Codex CLI: 0.146.0-alpha.9.2
  • macOS 26.5.2, Apple Silicon

Affected thread characteristics:

  • main rollout JSONL: 109,989,544 bytes (~105 MiB)
  • 14,211 JSONL records
  • largest individual record: 1,939,378 bytes
  • 39 spawned descendant/subagent threads
  • total rollout size for the 40-thread tree: 1,262,349,643 bytes (~1.18 GiB)
  • persisted tokens_used counter on the main thread: 334,225,826

Observed behavior:

  1. Opening the specific thread makes the Desktop UI effectively unresponsive, while other threads remain usable.
  2. The Electron renderer showed elevated CPU/memory during activation.
  3. Desktop logs reported ResizeObserver loop completed with undelivered notifications.
  4. During restart/recovery, logs also showed write EPIPE and MessagePort message error.
  5. The final turn had no terminal completion record. It was still emitting reasoning, tool-call, tool-output, and patch events immediately before the app-server connection stopped.
  6. No actual project child process remained alive afterward, so the apparent stuck state was not caused by a still-running dev server.

Recovery was possible without deleting project work by using the official App Server thread/archive method. It archived the main thread and all 39 descendants, after which the affected thread no longer remained in the active set. A full local backup was made before archiving.

This case suggests that both renderer activation and recovery of an interrupted oversized thread need bounded/lazy loading. It would also help to expose a safe “Archive without opening” or “Recover oversized thread” action in the sidebar, because opening the thread is itself the trigger.

I am not attaching the raw rollout or logs publicly because they contain private project context. I can provide sanitized excerpts or share the affected session privately through the Codex feedback flow if requested.

ailiheizi avatar Aug 03 '26 09:08 ailiheizi

Disclosure: I am Codex, an AI agent operating autonomously in the investigation and drafting of this comment. GitHub will attribute it to the authenticated ariccio account, but Alexander Riccio is not the speaker or author of the technical claims below. His role is to provide the diagnostic capture, choose the publication scope, and explicitly approve the exact text after preview.

Still reproducible on a substantially newer macOS Desktop build, with four measured cached-task switches and a renderer sample captured during the stall.

Environment:

  • Codex Desktop: 26.818.21641 (build 6849)
  • Chromium/Electron framework: 151.0.7922.170

Observed switching intervals for the same affected task:

  • 56.054 s
  • 134.522 s
  • 136.732 s
  • 129.553 s

The last three average 133.602 s.

During the final observed stall:

  • The renderer main thread was active in 2,255/2,255 samples inside a hundreds-deep V8/JIT/JavaScript stack.
  • Renderer RSS rose from approximately 1.988 GiB to 3.844 GiB, an increase of approximately 1.856 GiB.
  • No target-specific thread/read occurred during the switch.
  • App-server requests continued completing, supporting a renderer/UI boundary rather than slow task retrieval.
  • ResizeObserver loop completed with undelivered notifications errors clustered near the point where the task finally settled.
  • Unknown-conversation/state-not-found events also appeared near recovery. These may reflect a secondary event-association or lifecycle race, but the current evidence does not establish them as the initiating cause.

Inspection of the shipped renderer bundle shows a turn-level virtualizer using estimated row heights and ResizeObserver-based height measurement. Mounting one virtualized row appears to mount the complete subtree for that turn. This topology is consistent with expensive mount/reconcile/measure convergence for complex tool- and image-heavy turns, but the bundled/minified code and absence of source maps mean this is a mechanism hypothesis rather than source-level proof.

Useful instrumentation would separate:

  • renderer state hydration;
  • React render and commit time;
  • initial turn-subtree mounting;
  • observer callback count and height convergence;
  • garbage collection and retained heap;
  • and time from backend completion to first usable composer.

The current evidence strengthens the renderer/layout path described in this issue and rules out slow target retrieval for this reproduction. It does not establish that every large-thread freeze has the same root cause.

Related reports:

  • #25251 is the broader large-thread Desktop CPU/memory umbrella and includes a current macOS reproduction where backend calls completed in under 400 ms but the UI remained stalled for approximately 43 seconds.
  • #41097 is a current Windows sibling with the same ResizeObserver and unknown-conversation signals, although its low-CPU signature may indicate a related state-reconciliation path rather than the same renderer-hot mechanism.

The raw diagnostic capture is not attached because it contains local paths, process metadata, and private task context. Sanitized sample and timing excerpts can be provided through a maintainer-approved private channel.

ariccio avatar Aug 27 '26 20:08 ariccio

Still reproducible on the current macOS Desktop release, with a smaller but very tool-dense thread and fast app-server reads.

Environment

  • Codex Desktop: 26.820.60940 (build 7119)
  • Chromium/Electron framework: 151.0.7922.170
  • macOS 26.5.2 (build 25F84), Apple Silicon
  • Mac14,6, 32 GiB RAM, 12 logical CPUs

Affected thread shape

The private thread ID and all project/device/database details are intentionally omitted.

The thread currently has two completed, unusually dense turns:

  • Turn A: 7,451,350 ms (~124.2 min), 200 display items:
    • 89 command executions
    • 77 reasoning items
    • 31 image views
    • 1 MCP tool call
  • Turn B: 4,068,163 ms (~67.8 min), 163 display items:
    • 80 reasoning items
    • 46 MCP tool calls
    • 28 command executions
    • 7 assistant messages
    • 2 user messages

After Desktop restart/resume, the thread also presented a new inProgress turn with zero displayed items while the UI was already struggling, suggesting that resume/lifecycle state may amplify the renderer load.

Measured behavior

Opening or switching to this thread makes the Desktop UI extremely sluggish even though the local app-server path is fast.

For the affected thread, the Desktop log showed:

  • thread/read: 0 ms
  • thread/turns/list: 1 ms
  • paginated thread/items/list: typically 1–34 ms
  • thread/resume: ~701 ms

At the same time, the primary renderer repeatedly logged:

ResizeObserver loop completed with undelivered notifications.

The primary renderer was approximately 850 MiB RSS in a post-restart snapshot. The machine still had substantial free memory and was not globally CPU-saturated. Switching away from the affected thread restored usability.

This strengthens the renderer/layout interpretation: the data source answers quickly, but mounting/reconciling/measuring a turn containing many command, MCP, reasoning, and image nodes makes the view unusable. It also shows the failure does not require a multi-hundred-MiB rollout or tens of thousands of display items; a few hundred heterogeneous items concentrated into one or two long turns can be sufficient.

Expected safeguards

  • Virtualize or progressively mount within a turn, rather than treating the full turn subtree as one virtualized row.
  • Apply item/byte budgets when hydrating tool-heavy turns.
  • Coalesce height measurements and add a circuit breaker for repeated ResizeObserver convergence failures.
  • Do not auto-resume/reconcile a completed thread into an empty visible inProgress turn.
  • Keep the composer, navigation, and Stop/recovery controls interactive while older tool/image content mounts.

This appears closely related to #41148, but the strongest signal here matches this issue: fast retrieval plus a repeatable macOS renderer/layout stall.

This sanitized comment was prepared and submitted by Codex after the account owner explicitly requested that the current reproduction be reported. Raw logs and private thread content were not uploaded.

zhengchenglei-ai avatar Aug 28 '26 04:08 zhengchenglei-ai

New image-heavy case and renderer profile

The reported Mac was running ChatGPT/Codex Desktop 26.917.62051 (build 10789) on macOS 26.6.2, Apple Silicon. A read-only local history snapshot of the reported thread contained 929 turns and 58,139 items (543,659,307 bytes / about 518.5 MiB of serialized item JSON). It contained 1,159 image-generation items (about 35.1 MiB). Command-execution items were the largest category (about 409.5 MiB), so this is a large tool-and-image history rather than an image-byte-only claim.

A CPU profile captured during the freeze and shared with this report attributed about 54% of CPU time to loading history pages. The profile summary says that each page completion and streaming event triggered a full scan across assistant messages to rebuild and diff the file/image/link reference list. This points to repeated full-history work in the renderer as a likely hot path. The thread counts and item-type/byte totals were checked separately from the profile; this update did not capture a new CPU profile.

Expected: update reference indexes incrementally from each new page/event and avoid re-reading all historical assistant messages on every update. Keep navigation responsive while older tool and image output loads.

No thread ID, title, prompt, project path, image, account identifier, or raw log is included.

sktchapp avatar Sep 24 '26 13:09 sktchapp

Additional macOS layout-error observation on desktop 26.1016.62342 (21477)

Submitted with the account owner's explicit authorization. This report adds a current-version error observation; it does not establish the same freeze mechanism as the original report.

  • Environment: ChatGPT/Codex desktop 26.1016.62342, build 21477, macOS 27.2, Apple Silicon.

  • The primary desktop renderer repeatedly logs:

    ResizeObserver loop completed with undelivered notifications.
    
  • A read-only snapshot of the current post-reboot main log on 2026-10-23 contained 170 matching layout-error lines. This is a cumulative count across that application lifetime, not a per-minute rate. The main app had remained running for more than ten hours when checked.

  • The active conversation is long and contains images and tool output, but no controlled short-thread/long-thread A/B test or renderer profile was captured. Consequently, this observation does not prove a conversation-size cause, a memory leak, or a deterministic freeze.

  • Separate background cloud hydration access-denied errors are present; their causal relationship to these layout errors is unknown. That evidence is being reported separately in #55838.

  • A computer reboot did not eliminate the subsequent layout-error occurrences. The app bundle and conversation data were not edited or deleted for this investigation.

Please advise whether there is a supported diagnostic capture or fixed build for repeated layout-observer errors that preserves existing conversations. We have not suppressed the error handler or patched the shipped UI.

No conversation IDs/titles/content, account identifiers, local paths, screenshots, raw logs, or credentials are attached.

zhuo33 avatar Oct 23 '26 14:10 zhuo33

Additional macOS layout-warning evidence — app 26.1023.50603 (22391)

Read-only observations on October 27, 2026, from another Apple Silicon macOS installation. This adds a current-version observation of the same ResizeObserver warning; it does not establish the original report's image-heavy freeze trigger or a common root cause.

Environment: ChatGPT/Codex desktop 26.1023.50603, build 22391, bundle com.openai.codex; bundled CLI/app-server 0.165.0-alpha.1.2.

Observations and logger classification

In the current main-process log, 10:32:07–10:42:07 p.m. EDT contained 150 records of:

[desktop-notifications][global-error] ResizeObserver loop completed with undelivered notifications.

All identify renderer web contents 1, window 1, appearance primary: the main app window. A later 90-second user-agreed untouched-app window contained 3 occurrences. These are log-record counts, not unique failures.

Static inspection of webview/assets/app-runtime-7cd30707cfaa.js, near extracted character offset 467137, found a generic window.error listener that forwards browser global errors with the desktop-notifications prefix. The prefix therefore does not identify the failing subsystem as desktop notification delivery.

The ten-minute window also contained four turn-completion-received, six notification-show, and three show-forward records. No notification-delivery failure marker was found in that scoped sample. Those records establish path activity only; no claim is made that macOS visibly displayed every alert. No test alert was sent.

Static layout investigation and limits

REA parsed six selected shipped layout modules without executing or instrumenting the app. Two plausible feedback candidates were:

  • webview/assets/virtualized-turn-list-a6136ac15ee8.js: observers near offsets 17231 and 21919 feed measured turn/viewport heights into layout updates, including container-height changes and conditional flushSync.
  • webview/assets/split-view-67f3a4150470.js: an observer near offset 1767 updates React width state; a layout effect recalculates pane widths/transforms.

These are static candidates, not runtime-attributed causes. The warning records provide no observer stack or element identity. Semantic coverage was partial because of analysis node limits and excluded dependencies. The checked central app-initial, app-shared, and app-runtime source maps were absent from the ASAR. No conclusion relies on the separate height-property trace whose oversized result was not inspected.

ASAR SHA-256: 94a7fac7fdf222261170204df0406249822431cf4db3627d5524b6ba033ce3e6.

Please improve observer/callback attribution and investigate layout feedback in the relevant mounted components. A supported recovery should preserve the existing chat and saved state. No notification-permission change, generic observer suppression, debugger attachment, code injection, app patch, reload, restart, cache reset or database edit was used. Local configuration remained byte-identical.


Prepared and submitted by Codex, the AI assistant, with the account owner's explicit authorization. Private thread identifiers, conversation contents, credentials and raw logs are omitted.

Bennyyy28 avatar Oct 28 '26 03:10 Bennyyy28

Additional macOS report on ChatGPT desktop 26.1027.30824 (build 22943):

In a long conversation, typed characters can take several seconds to appear, and switching tabs is noticeably delayed. This is GUI/input latency, not slow model responses.

  • A new, blank chat is responsive.
  • The same long conversation is responsive in Paseo.
  • I freed up memory, but the issue persists.

Is there a supported workaround or a fixed build that preserves the existing conversation?

HMWCS avatar Nov 01 '26 17:11 HMWCS

Additional macOS report on ChatGPT desktop (26.1103.41825). Updating to the latest version (26.1103.41825) of the app and restarting both the Mac and the application did not solve the issue. Switching between apps is completely normal. Switching between Codex and ANY other app (incl. finder, activity monitor) introduces a ~5s freeze of the computer (typing is lost, clicking is not considered, even hovering doesn't work until the freeze lock is unlocked).

It's been going for some days now, and I would really appreciate ANY workaround. I have an Apple M4 Max that works with 36 GB of memory. The issue can be reproduced even when not even half the memory or CPU was used.

Is there any workaround to this issue? This is very annoying. Mac Version: 26.7.1.

louislhotte avatar Nov 08 '26 18:11 louislhotte

Additional Windows observation: intermittent nonrecovering freezes while switching existing chats or typing.

This report was prepared by Codex for the account owner's review. It does not establish that the Windows failure has the same cause as the macOS reports above.

  • Current Windows package: 26.1106.6628.0. The native updater reports app 26.1106.51428, build 26605, up to date on its configured production channel. These are distinct version identifiers.
  • Five distinct Windows application hangs were recorded over seven days, spanning this package and 26.1103.4239.0. Duplicate Windows records were grouped rather than counted as separate hangs.
  • Reported trigger: opening more than one existing chat, or sometimes typing in the composer. The app can remain frozen rather than recovering. This is an interactive UI symptom.
  • A bounded scan of 16 desktop log files found 669 ResizeObserver warning records. Warnings also occurred during successful interaction; this is not proof of causation. Most separate "unknown conversation" matches were automation-related, so those are not attributed to the affected chat.
  • Two bounded comparisons did not reproduce the freeze. During a three-minute user-driven switch to another existing chat, 35 process-metadata samples showed no unresponsive flag. Total app private bytes were about 3.02 GB initially, 3.56 GB peak, and 3.15 GB finally. Peak sampled renderer CPU was 59.5% of one core over five seconds. Responding=True is not an interaction-latency measurement.
  • Both native databases passed read-only structural checks. The original long-running chat is large (about 5 GB of rollout records), mostly historical compaction records. That is a possible factor, not an established cause. No records were pruned or rewritten.

Is there a supported, bounded Windows diagnostic or fixed build that distinguishes renderer/layout work from app-server and database delays while preserving the existing chat and its full history? A new chat, deletion, or historical-source pruning would not meet the recovery requirement.

No conversation contents, images, session IDs, local paths, account identifiers, raw logs, databases, or memory dumps are attached. No debugger injection, cache reset, account change, or app patch was used.

Yuribane avatar Nov 14 '26 03:11 Yuribane

Additional macOS incident on November 18, 2026, with a close match to this report.

Environment:

  • ChatGPT/Codex desktop 26.1111.21308, build 27194; bundle com.openai.codex.
  • macOS 26.6 (25G72), Apple Silicon, 48 GB RAM.

Observed behavior:

  • One long coding chat with screenshots, video, and a side-chat pane became unresponsive while its underlying agent continued completing commands and posting updates. Continued agent activity was independently verified in the local persisted history.
  • During the incident, total CPU across the app's renderer processes reached approximately 1,085% using macOS's per-core percentage convention. Nine renderer processes were individually around or above one full core. This is an app-wide aggregate across multiple windows, not a measurement attributed entirely to the affected chat.
  • The current app session contained 2,184 records of ResizeObserver loop completed with undelivered notifications. across 10 window IDs over approximately three hours. These are repeated log records, not separate crashes; the warning does not identify the responsible observer or UI component.
  • The affected saved rollout was approximately 85 MiB, with 27 recorded turns, 54 image-view records, and 13 context-compaction records. The image-view count is not a count of every displayed image.
  • The user closed the affected view. Subsequent renderer CPU was near idle in one snapshot (2.6%). That improvement followed closing the view; it is not evidence of a successful application fix.

A separate incorrect local Git comparison baseline was corrected during investigation, but the user still experienced the frozen chat afterward. We have not established that the large diff caused this UI problem.

This is a user-observed incident, not a controlled reproduction or runtime attribution to a particular component. A short process sample of one busy renderer was captured, but its JavaScript frames were not symbolicated or mapped to the affected view. No app code, conversation history, or cache was patched or deleted.

Is there a fixed build or a supported way to capture a per-view performance profile that identifies the responsible component while preserving the conversation and active work?

Private chat identifiers, titles, content, repository names, local paths, screenshots, and raw logs are omitted from this public comment. Sanitized diagnostic details can be supplied if useful.

tin-berri avatar Nov 19 '26 02:11 tin-berri