[macOS] Idle cloud profile/sidebar refresh rewrites full global state and .bak (~69 MB/3 min)
What version of the Codex App are you using?
- Initial observation: 26.930.51102, build 13100.
- Follow-up after official reinstallation: 26.930.61225, build 13232. The reinstalled bundle passed deep/strict signature verification with the OpenAI Developer ID, and its ASAR integrity hash matched Info.plist.
- Component: macOS desktop app, bundle identifier
com.openai.codex. The main executable is namedChatGPT, under/Applications/ChatGPT.app; this report measures that Electron main process.
What subscription do you have?
Not collected for this report.
What platform is your computer?
Observation date: 2026-10-06.
macOS 26.6.2 (build 25G83), Apple Silicon.
Darwin 25.6.0 arm64 arm
What issue are you seeing?
Small background updates to cloud profile/sidebar cache fields cause the desktop main process to rewrite the entire global-state JSON and its full backup. The state contains several megabytes of unchanged MCP/plugin catalog data, so even a changed avatar URL or refresh timestamp results in approximately 7.67 MB of process disk writes. Some saves also occur with no semantic JSON change.
The user observes writes while the app is idle. In a 180.08-second observation on build 13100, the diagnostic operator did not open panels or switch chats. There were 9 primary-state file replacements, and the main process disk-write counter increased by 69,009,408 bytes. 3 replacements had identical parsed JSON before and after. The other replacements coincided with these fields:
electron-persisted-atom-state/primary-aeon-selection-v1/response/profile/avatar_urlelectron-persisted-atom-state/cloud-aeon-sidebar-cache-v1/profilesByThreadId/<redacted>/avatar_url- The same sidebar profiles'
messaging_room_preview electron-persisted-atom-state/cloud-aeon-sidebar-cache-v1/refreshStartedAtMs
The affected files are:
~/.codex/.codex-global-state.json
~/.codex/.codex-global-state.json.bak
Each is approximately 3.83 MB. One full primary-plus-backup save accounted for 7,667,712 bytes in this environment; the nine-save window's total exactly matched nine times that amount. Poll-level counter deltas can split the two file writes, so individual poll deltas are not presented as complete per-save attribution.
| Approx. elapsed seconds | Observed primary-state saves |
|---|---|
| 3.73 / 4.40 / 5.37 | Unchanged JSON / primary-profile avatar / sidebar cache |
| 84.03 / 84.71 / 85.99 | Unchanged JSON / primary-profile avatar / sidebar cache |
| 154.31 / 155.14 / 156.10 | Unchanged JSON / primary-profile avatar / sidebar cache |
The large, unchanged payload includes:
| Top-level state field | Serialized bytes |
|---|---|
mcp-server-tools-cache-v2 |
1,448,123 |
mcp-extension-sidebar-catalog |
1,357,425 |
mcp-global-entrypoints-v2 |
279,621 |
These total approximately 3.09 MB / 80.6% of the state. Their contents were not observed changing in the idle sample; they amplify the writes caused by other small updates.
What steps can reproduce the bug?
Observed reproduction with the existing account/state, rather than a clean-profile minimal reproducer:
- Run the macOS desktop app with Your dot/cloud-agent sidebar data available. In this environment, installed MCP/plugin catalogs make the global-state JSON approximately 3.8 MB.
- Identify the main
ChatGPTexecutable process, rather than a renderer, the CLI or the Rust app-server. - Record its disk bytes written in Activity Monitor, or use
proc_pid_rusagewithRUSAGE_INFO_V2andri_diskio_byteswritten. - For about three minutes, observe the primary global-state file's inode/mtime. On replacement, compare the previous and current parsed JSON locally, recording only changed field names and sizes. Do not publish the raw state.
- Avoid typing, opening panels or switching chats during the idle observation. Observe background profile/sidebar cache changes and occasional semantically unchanged replacements.
- Correlate those replacements with the main process's disk-write counter and the full-sized primary/backup files.
The diagnostic collection did not manually modify state files or the app bundle during either measurement window; the app continued its normal persistence. Session IDs and raw cache values are omitted because this is a desktop persistence report and those values can contain private data.
What is the expected behavior?
- Skip persistence when serialized/semantic state has not changed.
- Avoid rewriting several megabytes of unrelated catalogs plus a full backup for every small, transient profile/sidebar-cache update.
- Consider persisting large catalogs separately and batching/throttling derived cache updates while preserving necessary state durability.
Additional information
Follow-up on the official reinstalled build 13232: a 180.01-second observation still recorded 23,003,136 bytes and 3 primary-state saves: one tab-route change, one primary-profile avatar update and one cloud-sidebar cache update. This window included a UI-state change, so it is not a controlled idle-only sample and should not be used to infer an improvement from the older version's total. It confirms that small cache updates still coincide with full-state persistence in the newer official installation.
Read-only inspection of the installed build 13100's bundled JavaScript found the following path:
persisted-atom-update->updatePersistedAtomStatein.vite/build/main-C7cfj__D.js-> the global state store'sset.- In
.vite/build/startup-requirements-CLgOyk51.js, the state store serializes the complete map and atomically replaces the primary file and then its.bakwith the same complete JSON, with a 500 ms debounce for atom updates and no serialized-content equality guard at that saving layer. - The primary-profile and cloud-sidebar query paths in
webview/assets/app-shared-9d148924be0b.jsupdate the persisted keys listed above after refreshes.
Limits of the diagnosis: the upstream event starting each refresh and the call stacks submitting identical values were not captured. The observed 70–80-second gaps do not establish a fixed polling timer. The byte counts are macOS process disk-I/O counters, not SSD-controller physical-write measurements. This is an existing-profile observation; background account activity has not been independently isolated.
Related reports checked before filing:
- #43393 reports the same primary-plus-backup amplification from Windows composer editing, and explicitly reports idle drafts stopping writes. This report adds macOS idle cloud profile/sidebar refreshes and unchanged-state saves as a different trigger.
- #35401 concerns the Rust CLI/app-server's separate
cache/remote_plugin_catalogfiles, rather than the desktop Electron global-state files measured here.
Could maintainers investigate deduplication and persistence granularity for these desktop cache updates? Only aggregate measurements, field names and installed-build identifiers are included here; no conversation contents, avatar URLs, message-preview values, account/thread identifiers or credentials are attached.
Still happening on 26.1007.30912 (build 20156), macOS 27.0.1, Apple Silicon.
What I measured on my Mac:
- The app was open but not used since the morning. In a 60-second check this evening,
~/.codex/.codex-global-state.jsonwas replaced 3 to 4 times, and each save also rewrote.codex-global-state.json.bak. Each file is about 976 KB here. That works out to roughly 8 to 11 GB a day of writes while the app sits idle. - In an earlier 180-second sample during light use, each file was replaced 27 times, and 6 of those back-to-back saves had byte-identical contents. At that rate it is about 25 GB a day.
The code path in this build is the one described above: each save writes the full JSON to the primary file, then writes the same JSON to .bak, with no general check for whether anything changed.
Two changes would cut most of this:
- Skip the write when the serialized JSON is the same as what is already on disk.
- Don't rewrite
.bakon every save. The primary is already replaced atomically (temp file plus rename), and the backup is an identical copy each time, so rewriting it on every save doubles the writes without adding much protection. Writing it once per launch, or every few minutes, would keep a recovery copy at a fraction of the cost.
A warning for anyone trying a local workaround: don't lock the .bak file (for example with chflags uchg). Some saves (project creation, account status, startup migrations) go through a path that treats a failed backup write as a failed save, so a locked backup can break those. For now I quit the app when I'm not using it.
Same behaviour on Linux, desktop app 26.1013.40934 (deb chatgpt), Ubuntu 26.04, 2026-10-18.
- Idle app, no turns running:
.codex-global-state.json(773 KB) was replaced 3 times in 120 s, each time with a full.bakrewrite. That's about 39 kB/s of writes from this file pair alone. - I took snapshots straddling a replacement and compared them as flattened JSON: 0 changed keys. So the save is content-identical.
- 99.9% of the file is
electron-persisted-atom-state, which holds 2,597 keys. The largest arelibrary-suggested-cache-v1at 118 KB,chatgpt-work-models-v1/...at 68 KB,orbit-outputs-v1at 64 KB andprompt-historyat 60 KB. - Attribution came from bpftrace
vfs_writeon ext4, keyed by path.
The app writes .bak.tmp and then renames it into the home dir, so neither a symlink nor a tmpfs redirect can absorb this from outside the app. Skipping the save when the serialized state is unchanged, or splitting the cache atoms out of the primary state file, would remove nearly all of it.
Same on macOS 27.0.1 (26A434), Apple M2 Max, desktop app 26.1013.40934 (build 20770). macOS filed a disk-writes resource report for the app (redacted copy: https://gist.github.com/trukhinyuri/4077831a7a80e14e23566c13ee689ddb):
Writes: 549.76 GB of file backed memory dirtied over 80027 seconds (6869.61 KB per second average), exceeding limit of 6362.91 KB per second over 86400 seconds
An earlier report on 26.1007.71326 hit the same 549.76 GB in 37,289 s (14.74 MB/s). Heaviest sampled stack in the Electron main process: JS → node::fs → uv_fs_write → write (1,084 of 3,944 samples); a few other samples are better_sqlite3 WAL frames.
State files now (app not running):
~/.codex/.codex-global-state.jsonand.json.bak: both 3,770,475 bytes, byte-identical (cmp). Both were created by replacement (birth time = mtime: 16:52:11.117 for the primary, 16:52:11.126 for.bak), so the primary is written via temp+rename and.bakfollows ~9 ms later.- 2,597 keys under
electron-persisted-atom-state; largest by serialized size:prompt-history~2.0 MB (about half the file),mcp-global-entrypoints-v2438 KB,heartbeat-thread-permissions-by-id182 KB,thread-descriptions-v1170 KB,composer-prompt-drafts-v2167 KB.
Scale: one primary + .bak save is ~7.5 MB, so 549.76 GB is ~73,000 saves (~0.9/s over the 80,027 s window) if this pair were the only writer. I have not attributed the writes to this file pair.
A 60 s fs_usage -w -f filesys filtered on codex-global-state with the app closed showed no writes, so I have no fresh rewrite rate for this version. Related: #32431.
Additional macOS measurements — app 26.1023.50603 (22391)
Read-only observations on October 27, 2026, from another Apple Silicon macOS installation. This adds a current-version active/untouched comparison to the full global-state/backup rewrite behavior reported here.
Environment: ChatGPT/Codex desktop 26.1023.50603, build 22391, bundle com.openai.codex; bundled CLI/app-server 0.165.0-alpha.1.2.
Measurements
macOS proc_pid_rusage (RUSAGE_INFO_V4) supplied per-process disk-write counters. Primary/backup inode, mtime and size were observed once per second. JSON comparisons were performed locally, retaining only changed key identities, counts and hashes; no values or conversation contents are included.
| Measurement | Active investigation, 89.977 s | User-agreed untouched app, 89.982 s |
|---|---|---|
| Electron main-process disk bytes written | 121,774,080 | 14,954,496 |
| Bundled app-server disk bytes written | 44,847,104 | 36,663,296 |
| Observed primary global-state replacements | 14 | 2 |
Observed .bak replacements |
14 | 2 |
| Primary replacement sizes summed | 30,585,229 bytes | 4,372,020 bytes |
| Backup replacement sizes summed | 30,585,229 bytes | 4,372,020 bytes |
| Observed primary replacements with unchanged byte content | 2 | 0 |
The windows were 10:50:29–10:51:59 p.m. and 10:55:25–10:56:55 p.m. EDT on October 27. The same main/server processes remained running throughout. During the second window, the user avoided ChatGPT interaction and investigation subagents paused their tools. The sampler and minimal status activity continued; this is an untouched-app comparison, not a claim of a completely idle server. Main-process writes fell approximately 87.7%, while server writes continued.
The global-state JSON was approximately 2.19 MB, including approximately 2.01 MB in electron-persisted-atom-state with 1,311 entries. During the untouched window, the observed changed keys were electron-thread-read-state-v1 once and persisted atom mcp-global-entrypoints-v3 once. SQLite write-ahead files also changed; server-write attribution is unresolved.
Shipped-code inspection
Static inspection of this build found that ordinary persistence serializes the complete state map and writes it to both .codex-global-state.json and .codex-global-state.json.bak, using temporary files plus rename. Persisted atom updates have a 500 ms trailing debounce; general setters do not perform an equality check before scheduling persistence. This is consistent with the observed replacements and write amplification, but it is not a per-file I/O trace establishing the cause of every process-counter byte.
Relevant members of the shipped ASAR:
.vite/build/startup-requirements-Cn9_CoZa.js: state store and persistence helpers, near extracted character offsets 80620–85200..vite/build/bootstrap-BLyztc2V.js: global-state store construction, near offset 512813.- ASAR SHA-256:
94a7fac7fdf222261170204df0406249822431cf4db3627d5524b6ba033ce3e6.
Limits and requested investigation
These are short observation windows, not daily-rate predictions or physical NAND-wear measurements. One-second polling can miss intermediate replacements; two identical observed versions do not rule out intervening versions. Replacement-size sums are file-size observations, not exact per-file write counters. Direct per-file tracing was unavailable without administrator access. Background activity and writeback timing were not controlled.
Please investigate skipping unchanged saves and safely coalescing persistence, while preserving state durability and recovery. A supported repair should preserve conversations, settings and existing global state. No cache/database reset, state deletion, permission change, app patch, process termination or restart was used during these measurements; local configuration remained byte-identical.
Prepared and submitted by Codex, the AI assistant, with the account owner's explicit authorization. Private identifiers, state values, credentials, conversation contents and raw logs are omitted.
Additional reproduction on Linux / XWayland, confirmed on October 30, 2026.
Environment
- Ubuntu 26.04.1 LTS
- KDE Plasma 6.6.6 / Wayland session
- ChatGPT Desktop 26.1027.30824
- Electron backend: X11/XWayland
Reproduction
The application repeatedly rewrites both ~/.codex/.codex-global-state.json and .codex-global-state.json.bak, even when their SHA-256 hashes remain unchanged.
Each file is approximately 6.98 MB.
During a controlled 90-second observation, at 10:28:47 CET, both files were rewritten without any content changes.
At the same time, the main ChatGPT process recorded approximately 13.598 MiB of writes during the corresponding two-second sampling interval.
The complete observation recorded 28.324 MiB of writes over 90 seconds.
The same redundant persistence behavior was reproduced before and after upgrading to version 26.1027.30824.
Unlike the more severe Linux/Wayland behavior described in #55565, we have not observed sustained excessive writes on this machine. However, the underlying full-state rewrite amplification appears related to this issue.
Feedback submitted through ChatGPT Desktop
no-active-thread-01a18c4b-15e6-7a00-b9ff-881450b26ac5
This report was submitted without sharing private Codex sessions.
Please investigate whether unchanged serialized state can be detected before rewriting the entire JSON and backup.
Sanitized technical measurements are available if needed.
Follow-up from a November 23, 2026 retest on Apple Silicon macOS 27.3, running ChatGPT/Codex desktop 26.1117.41037 (build 29803).
| Five-minute sample (EST) | Main-process disk reads | Main-process disk writes | Full state and backup replacements |
|---|---|---|---|
| Pet bar closed, 12:36 a.m. | 24,576 bytes | 18,677,760 bytes | 2 pairs |
| Orko visible, 2:58 a.m. | 0 bytes | 18,407,424 bytes | 2 pairs |
Both samples used macOS per-process disk counters on the same desktop main process and file metadata polling. Each save replaced the full .codex-global-state.json and its .bak, about 6.8 MB combined per pair. The rewrite pattern persists on this build with the pet bar closed or open. Background activity was not controlled, so the small difference between the two windows does not isolate the pet's effect.
Codex product feedback ID: no-active-thread-01a20981-85ae-7ef2-9666-08b40dda8cf2. Please use it to connect this follow-up to the submitted report.