Desktop performance collapses in profiles with a few very large local conversation histories (typing, scrolling, thread list, random exits)
Summary:<br>This is broader than slow thread switching. In profiles that contain a small number of extremely large local conversation histories, Codex desktop becomes slow across multiple surfaces: typing, scrolling inside a conversation, scrolling the thread list, delayed UI updates, slow thread switching, and occasional app exits. My strongest verified signal is not total conversation count, but the presence of a few giant local histories. Some of those heavy histories also had recurring thread heartbeat automations attached, which may amplify the problem, but that variable is not yet fully isolated.
Environment:
- Codex desktop app
26.415.40636 - macOS
26.3 - MacBook Pro (
Apple M3 Max,16CPU cores,128 GBmemory)
Observed
- Typing can become very slow, roughly
~1sfor words to appear. - Scrolling inside an existing conversation can become very slow.
- Scrolling the thread list can become very slow.
- UI updates such as archive notifications can arrive with noticeable delay.
- Switching into some older conversations can take a very long time.
- The app can also exit unexpectedly.
- This appears Codex-specific on my machine: the slowdown can show up immediately inside Codex while the rest of the machine feels normal.
Verified A/B Repro
I tested this by comparing copied local profiles rather than only changing one profile in place.
Verified results:
- A fresh test profile was smooth.
- A copied profile that kept most of my original conversations but excluded the largest bloated ones was also smooth.
- A copied profile that restored only a few very large historical conversations became slow again, even without the rest of my normal active conversations.
What this establishes:
- The strongest correlation I can verify so far is the presence of a few giant local histories, not raw total conversation count by itself.
- This is broader than thread-switch latency. The same profiles also show typing lag, scrolling lag, delayed UI updates, and occasional app exits.
What I have not isolated yet:
- Whether simply archiving those same conversations inside the main profile would be enough to fix it.
- Whether recurring thread heartbeat automations targeting those same heavy conversations are contributing independently, or mainly amplifying an existing history-size problem.
Hypotheses
These are hypotheses, not claims of proof:
- The desktop app may be over-hydrating, resuming, or indexing a few massive local conversation histories.
- Stale stored workspace roots may be adding background churn during startup and/or resume.
- Recurring thread heartbeat automations attached to already-large conversations may amplify the problem by repeatedly waking expensive local histories.
My current read is that the issue is likely caused by some combination of:
- oversized local history payloads
- resume/read/index churn on those histories
- stale workspace-root scanning
- possibly heartbeat-driven repeated wakeups on the same heavy conversations
Diagnostics
Largest local histories on this machine, anonymized:
<!-- linear:table-colwidths:200,200,200,200 -->
| Local history | Rollout size | Turn contexts | Function/tool calls |
| -- | -- | -- | -- |
| [#1](<https://github.com/openai/codex/issues/1>) | 1867.27 MiB | 618 | 21,369 |
| [#2](<https://github.com/openai/codex/issues/2>) | 584.72 MiB | 5,554 | 22,434 |
| [#3](<https://github.com/openai/codex/issues/3>) | 561.02 MiB | 554 | 22,831 |
| [#4](<https://github.com/openai/codex/issues/4>) | 507.22 MiB | 428 | 17,991 |
| [#5](<https://github.com/openai/codex/issues/5>) | 455.84 MiB | 563 | 38,073 |
Additional local signals:
- local state currently has
1767total conversations,777unarchived 40stored workspace roots no longer exist- the desktop backend had
8old session histories open totaling about1.66 GiB - desktop logs showed thread resume/read/unsubscribe operations taking tens of seconds, with worst cases around
82s - startup also repeatedly scanned stale worktree/origin roots with very large expanded counts
Related issues
This may overlap with:
19 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I believe I am having the same issue. I have about 2-3 long running sessions (1 week long sessions). Switching sessions is slow, focusing on the chat box is slow. Things will lock up in all cases.
It's preventing me from enjoying it as much as I used to. Number one feature request is to speed it up. Thanks!
Shot in the dark, but does Codex do any virtualization in the chats? If not, perhaps using something like https://github.com/chenglou/pretext would unlock efficient virtualization by allowing calculating text heights efficiently.
If it helps, I can confirm that archiving the conversations fixes the performance. Once I archived the long sessions and started new ones, things got much faster again.
One of my conversations was a bit over 1GB.
I’m also seeing this multi-thread / large-history slowdown on Codex Desktop for macOS.
Setup:
Local state:
Behavior:
This seems related to large local history hydration/thread switching, possibly made worse when Memory is enabled.
Can I work on these Linear tickets myself @yevin-oai? 😁
Still experiencing the same issues, the most annoying of which being codex dying quickly
Lots of loooove to you and the team
CLI-6413
CLI-6450
Coincidentally have the exact same setup / hardware and with version
Version 26.422.30944 (2080)running into extreme slowness due to an ongoing session that's now lasted 24 hours (and still another 12 hours or more to finish). I cannot archive the session as it's been working for more than 24 hours on a major refactor.I'd love for past messages in the same session to auto-hide / collapse into a single
Load moresection of some kind. Due to this, dictation has stopped working too it seems - taking ~30 seconds to transcribe a short 5 second audio which otherwise is instant.Weird that app does not have hide option or reveal old chat messages only when you scroll. A 3 days of chat is gigantic and freezes app while we don't even need to see most of old content visually in UI, codex can look at it somewhere internally, but app is chocking
Can anyone confirm where the performance bottleneck is? If it's rendering, I think the codex team could add virtualized rendering to make things feel instant. Using a lib like pretext could allow pre-computing message heights in advance.
I got a repro locally and I pointed that to codex, here is what it says :)
I think its solved btw. No longer experiencing this despite the same threads and usage pattern e.g. thread automations for several threads and projects.
I can reproduce what looks like the same large-history / long-session performance failure on a newer Codex Desktop build, with a more specific trigger: after restarting Codex, loading a very long existing session appears to put the desktop app into sustained high CPU.
Environment
26.429.30905(CFBundleVersion2345)26.4.1(25E253)25.4.0arm642026-05-04 18:29-18:30 KSTTrigger observed
This makes it look more tied to long-session hydration/render/resume after restart than to MCP process CPU.
CPU samples
Collected with:
Sample 1
Sample 2
Sample 3
MCP/LSP state
Before collecting the samples, stale duplicate MCP generations were cleaned up. Remaining sidecars were idle:
Notes
This may also overlap with #20435, but the stronger repro signal here is: restart Codex, then load a very long existing session. The high CPU sits in the Codex main process plus renderer while MCP/LSP sidecars are idle.
Expected behavior: loading a large historical session may take some time, but should not leave the main process around ~240% CPU and renderer around ~100% CPU after the session is already visible.
Adding another Windows reproduction signal from Codex Desktop
26.429.3425.0.Environment:
OpenAI.Codex_26.429.3425.0_x64__2p2nqsd0c76g0%USERPROFILE%\.codexLocal size signals:
| Size | Lines | Path |
|---:|---:|---|
|
315.40 MB|10,917|%USERPROFILE%\.codex\sessions\2026\04\28\rollout-2026-04-28T07-40-53-019dd151-3571-7230-ab00-407fad5e5857.jsonl||
67.69 MB|2,059|%USERPROFILE%\.codex\sessions\2026\04\30\rollout-2026-04-30T20-18-06-019dde53-2d23-7063-b325-6b8c61a7e86c.jsonl||
12.07 MB|1,072| next largest rollout |Additional local state:
%USERPROFILE%\.codex\logs_2.sqliteis about301 MB.831.8 MBworking set and high accumulated CPU (~825 CPU seconds) while the app had been running since May 3.Repro pattern:
Expected behavior:
Privacy note: I am intentionally not uploading raw
.jsonl, sqlite databases, auth files, screenshots, or unsanitized logs. The paths above are sanitized to%USERPROFILE%and included only to identify the local storage class involved.I also prepared a forward-looking containment patch branch here:
https://github.com/vorojar/codex/tree/codex/bound-rollout-output-size
Commit: vorojar/codex@d63bd59
What it changes:
ResponseItem::FunctionCallOutput/CustomToolCallOutputtext at the rollout recorder boundaryInputTextcontent items while preserving non-text content itemsExecCommandEnd.aggregated_outputtruncation behavior intactValidation:
cargo fmt --all --checkcargo test -p codex-rollout --no-default-featuresI attempted to open this as a draft PR from the fork, but GitHub rejected PR creation from my account/token for this repository (
CreatePullRequest/Resource not accessible by integration). The branch is pushed and available if maintainers want to import/cherry-pick it.This does not migrate existing giant session files; it only prevents future sessions from being inflated by very large persisted tool output. A true fix for already-large histories still needs indexed/lazy loading in the desktop/app-server path.
Adding another confirmed case that looks like the same class of bug, with one useful isolation detail.
Environment:
26.429.61741codex-cli 0.128.0-alpha.1Observed:
~/.codex.thread/listcalls taking about2.2s-4.8sbefore cleanup.1.6Gunder~/.codex/sessions.1.5Gof that was tied to one generated workspace, roughly<workspace>/aidev/runtime/codex-workspace.Important isolation result:
app/list,plugin/list, andmcpServerStatus/list.What fixed it:
~/.codex/state_5.sqlite,~/.codex/.codex-global-state.json, and~/.codex/session_index.jsonl.state_5.sqlite.~/.codex/sessionsso the app cannot rebuild active rows for deleted/old projects.After cleanup:
5.176.Expected behavior:
Another strong repro: the problem correlates with a few giant histories, not high thread count. One 825MB completed rollout caused ~4.5-5GB app-server RSS after opening, 148-253s app-server responses, and a dropped 405MB stream-state payload. The hot path appears to be large histories being hydrated/resumed, not just general UI/system load.
Follow-up / PR offer: I read the contribution docs and understand external PRs are invitation-only. If the team thinks this direction fits, I’d be happy to take a stab at an invited PR for the open-source app-server side.
Conceptually, the fix I’d propose is:
thread/read,thread/resume, and stream-state snapshots cannot produce 100MB+ payloadsThe desktop side still needs closed-code changes, but the app-server can provide the safe bounded contract and fail gracefully when a client asks for full hydration of an oversized rollout.
Adding a current datapoint from another affected macOS workstation. This still reproduces on a newer CLI build and looks consistent with the large-local-history/random-exit family described here.
Environment:
codex-cli 0.130.0/opt/homebrew/bin/codex26.4.1(25E253), Darwin25.4.0, Apple Silicon / arm64Mac13,1in crash report)TERM=xterm-256color)Observed:
codex-*.ipscrash reports.codex-2026-05-08-195441.000.ipsprocName:codexprocPath:/opt/homebrew/*/codexexception:EXC_CRASH,SIGABRTtermination:Abort trap: 6, by processcodex2026-05-08 19:11:29 -0400, exited/crashed at2026-05-08 19:54:40 -0400tokio-runtime-workerand severalsqlx-sqlite-worker-*workersLocal profile/history signals:
~/.codex/archived_sessions:1.4G~/.codex/logs_2.sqlite:63M~/.codex/state_5.sqlite:58M681M363M193M46Mand77MThis looks like either the same root cause or a closely related CLI-side failure mode: large local histories plus long-running agent sessions eventually lead to abrupt process exit rather than graceful compaction, truncation, or recovery. I have not attached raw
.ipsor rollout files publicly because they may contain private repo/session data, but the crash report summary above is available from local diagnostics.If the root cause is too much data at once from codex, might I propose that the codex team takes peek at Turso in place of sqlite?
A few things that might be relevant:
Adding a Windows 11 datapoint that closely matches this issue.
Environment
26.707.9981.026200Observed
ChatGPT (Not Responding)while the rest of Windows remains responsive.Local history profile (anonymized)
2.06 GB128unarchived threads and7archived threads22rollout files over10 MB5rollout files over100 MB: approximately586.8,267.7,267.7,218.4, and108.4 MB218 MBthread was still growing in the background while another thread was in the foreground.inProgressturns on that large thread.1.8 GBcombined.Reversible A/B test
I archived five inactive giant threads totaling about
1.32 GB, without deleting rollout files and without touching the active large thread.Afterward:
128to1230non-responsive samples and0new crash events16%with a34%peak160–410 msThis is preliminary because the active
218 MBbackground thread is still running, but the result supports the same large-history hydration/indexing pattern described here.A durable fix likely needs:
No raw rollout files, local paths, thread IDs, screenshots, or dumps are included for privacy.
This also appears related to #11011.